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: 1.0 Yes API version
kind: Yes Specify "script" for script.
type: No Only "resource" can be specified for script.
name: Yes Internal name of the Script definition Specify the directory name for this YAML file.
label: Yes YAML file display name
includes: No List the related YAML files for use in this 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 for 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

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)