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”.
| 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:
|
||
| 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
Tips
|
||
| - 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.
- For UI version 1.0 YAML definitions: “Action scripts (UI Version 1.0)”
- For UI version 1.1 YAML definitions: “Action scripts (UI Version 1.1)”
<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)
Tips