6.5 Script

Script definitions and example definitions are shown below. For details of Script, see “UI design”.
Although the script version of the action defined in the Script YAML file must match the UI version of the UI, the Script will always be the following apiVersion1.0 YAML definition. For details of UI versions, see “UI version”.

(Table) Script definitions

Label Default value Required* Description
apiVersion: Yes API version
Specify 1.0.
kind: Yes Specify "script".
type: No Specify "resource".
It indicates a new definition to be added to the operational function of Ops I.
name: Yes Internal name of the Script definition.
"name" should follow the conventions shown below:
  • Specify the directory name of this YAML file.
  • The following characters can be entered:
    • Single-byte alphanumeric characters:
      a–z A–Z 0–9
    • Single-byte special characters:
      _ . ( ) -
  • The first character must be a single-byte alphanumeric character or an underscore (_).
  • For other precautions, see "Notes on creating YAML files" 2–4.
label: Yes Display name of the operational function to be written in the YAML file
includes: No List the related YAML files for use in this YAML file
TipsTips
  • Before this YAML file is registered, the YAML file to be written to must be registered in Ops I.
  • By specifying the "includes" label, you can import information defined in another YAML file.
- kind: Yes Type of YAML file to be loaded
  name: Yes Internal name of YAML file to be loaded
description: No Detailed description of this YAML file
actions: Yes Defines the action
- name: Yes Action name
  file: Yes Path of the script file describing the action. The starting point is the directory in which the script YAML file is saved.
Example:
If the created script is called “sample.js” and sample.js is saved in the directory where the script YAML file is saved, the file path of the script will be as follows.
sample.js
*If a label that is not nested has its "Required" field set to "No", the definition is not required. For nested labels, the "Required" setting of a lower-level label applies only when the "Required" setting of its upper-level label is set to "Yes".

For a list of components for which actions can be defined, see the following.


<Definition example>

apiVersion: 1.0
kind: script

type: resource
name: create_vm
label: create_vm
description: A custom script that generates VMs.

actions:
  - name: create_vm_action
    file: create_vm_action.js




Section structure

6.5.1 Action scripts (UI Version 1.0)
6.5.2 Action scripts (UI Version 1.1)