Global Init Script
Get GA
GET
Gets all the details of a script, including its Base64-encoded contents.
API scopes: global-init-scripts
Parameters
- script_idstringpath
The ID of the global init script.
Response
- script_idstring
The global init script ID.
- namestring
The name of the script
- positionint32
The position of a script, where 0 represents the first script to run, 1 is the second script to run, in ascending order.
- enabledboolean
Specifies whether the script is enabled. The script runs only if enabled.
- created_bystring
The username of the user who created the script.
- created_atint64
Time when the script was created, represented as a Unix timestamp in milliseconds.
- updated_bystring
The username of the user who last updated the script
- updated_atint64
Time when the script was updated, represented as a Unix timestamp in milliseconds.
List GA
GET
Get a list of all global init scripts for this workspace. This returns all properties for each script but not the script contents. To retrieve the contents of a script, use the get a global init script operation.
API scopes: global-init-scripts
Response
- scriptsarray of object
Show child attributesHide child attributes
- script_idstring
The global init script ID.
- namestring
The name of the script
- positionint32
The position of a script, where 0 represents the first script to run, 1 is the second script to run, in ascending order.
- enabledboolean
Specifies whether the script is enabled. The script runs only if enabled.
- created_bystring
The username of the user who created the script.
- created_atint64
Time when the script was created, represented as a Unix timestamp in milliseconds.
- updated_bystring
The username of the user who last updated the script
- updated_atint64
Time when the script was updated, represented as a Unix timestamp in milliseconds.
Create GA
POST
Creates a new global init script in this workspace.
API scopes: global-init-scripts
Request body
- namestring
The name of the script
- scriptstring
The Base64-encoded content of the script.
- positionint32
The position of a global init script, where 0 represents the first script to run, 1 is the second script to run, in ascending order.
If you omit the numeric position for a new global init script, it defaults to last position. It will run after all current scripts. Setting any value greater than the position of the last script is equivalent to the last position. Example: Take three existing scripts with positions 0, 1, and 2. Any position of (3) or greater puts the script in the last position. If an explicit position value conflicts with an existing script value, your request succeeds, but the original script at that position and all later scripts have their positions incremented by 1.
- enabledboolean
Specifies whether the script is enabled. The script runs only if enabled.
Response
- script_idstring
The global init script ID.
Update GA
PATCH
Updates a global init script, specifying only the fields to change. All fields are optional. Unspecified fields retain their current value.
API scopes: global-init-scripts
Parameters
- script_idstringpath
The ID of the global init script.
Request body
- namestring
The name of the script
- scriptstring
The Base64-encoded content of the script.
- positionint32
The position of a script, where 0 represents the first script to run, 1 is the second script to run, in ascending order. To move the script to run first, set its position to 0.
To move the script to the end, set its position to any value greater or equal to the position of the last script. Example, three existing scripts with positions 0, 1, and 2. Any position value of 2 or greater puts the script in the last position (2).
If an explicit position value conflicts with an existing script, your request succeeds, but the original script at that position and all later scripts have their positions incremented by 1.
- enabledboolean
Specifies whether the script is enabled. The script runs only if enabled.
Delete GA
DELETE
Deletes a global init script.
API scopes: global-init-scripts
Parameters
- script_idstringpath
The ID of the global init script.