跳到主要内容

Operate sandbox with YAML

List of YAML parameters and examples for the "Operate sandbox" action

YAML parameters for Start sandbox

名称类型描述
action
必填
StringThe ID of the action.
type
必填
StringThe type of the action. Must be set to SANDBOX_START.
sandbox_references 必填StringDefines the sandbox selection method. Available values: BY_TAGS, BY_NAME, BY_PROJECT, BY_DAYS, BY_ID, BY_ACTION.
sandbox_idStringID of the sandbox to which the files are uploaded. Required when sandbox_references is set to BY_ID.
referenced_action_idIntID of the action that creates the target sandbox.Required when sandbox_references is set to BY_ACTION.
referenced_sanbox_nameStringName of the target sandbox. Required when sandbox_references is set to BY_NAME.
tagsString[]List of tags applied to the target sandbox. Required when sandbox_references is set to BY_TAGS.
sandbox_project_idIntID of the project with the target sandbox. Required when sandbox_references is set to BY_PROJECT.
daysIntNumber of days passed since the creation of the target sandbox. One of 1, 2, 3, 7, 14, 30. Required when sandbox_references is set to BY_DAYS.

YAML example for Start sandbox

actions:
- action: "Start sandbox"
type: "SANDBOX_START"
sandbox_references:
- "BY_ID"
sandbox_id: "BJ7YnoUVtfGdo"

YAML parameters for Stop sandbox

名称类型描述
action
必填
StringThe ID of the action.
type
必填
StringThe type of the action. Must be set to SANDBOX_STOP.
sandbox_references 必填StringDefines the sandbox selection method. Available values: BY_TAGS, BY_NAME, BY_PROJECT, BY_DAYS, BY_ID, BY_ACTION.
sandbox_idStringID of the sandbox to which the files are uploaded. Required when sandbox_references is set to BY_ID.
referenced_action_idIntID of the action that creates the target sandbox.Required when sandbox_references is set to BY_ACTION.
referenced_sanbox_nameStringName of the target sandbox. Required when sandbox_references is set to BY_NAME.
tagsString[]List of tags applied to the target sandbox. Required when sandbox_references is set to BY_TAGS.
sandbox_project_idIntID of the project with the target sandbox. Required when sandbox_references is set to BY_PROJECT.
daysIntNumber of days passed since the creation of the target sandbox. One of 1, 2, 3, 7, 14, 30. Required when sandbox_references is set to BY_DAYS.

YAML example for Stop sandbox

actions:
- action: "Stop sandbox"
type: "SANDBOX_STOP"
sandbox_references:
- "BY_ID"
sandbox_id: "Cgn3QO34klUri"

YAML parameters for Destroy sandbox

名称类型描述
action
必填
StringThe ID of the action.
type
必填
StringThe type of the action. Must be set to SANDBOX_DELETE.
sandbox_references 必填StringDefines the sandbox selection method. Available values: BY_TAGS, BY_NAME, BY_PROJECT, BY_DAYS, BY_ID, BY_ACTION.
sandbox_idStringID of the sandbox to which the files are uploaded. Required when sandbox_references is set to BY_ID.
referenced_action_idIntID of the action that creates the target sandbox.Required when sandbox_references is set to BY_ACTION.
referenced_sanbox_nameStringName of the target sandbox. Required when sandbox_references is set to BY_NAME.
tagsString[]List of tags applied to the target sandbox. Required when sandbox_references is set to BY_TAGS.
sandbox_project_idIntID of the project with the target sandbox. Required when sandbox_references is set to BY_PROJECT.
daysIntNumber of days passed since the creation of the target sandbox. One of 1, 2, 3, 7, 14, 30. Required when sandbox_references is set to BY_DAYS.

YAML example for Destroy sandbox

actions:
- action: "Destroy sandbox"
type: "SANDBOX_DELETE"
sandbox_references:
- "BY_ID"
sandbox_id: "Cgn3QO34klUri"

YAML parameters for Snapshot

名称类型描述
action
必填
StringThe ID of the action.
type
必填
StringThe type of the action. Must be set to SANDBOX_SNAPSHOT.
sandbox_references 必填StringDefines the sandbox selection method. Available values: BY_TAGS, BY_NAME, BY_PROJECT, BY_DAYS, BY_ID, BY_ACTION.
sandbox_idStringID of the sandbox to which the files are uploaded. Required when sandbox_references is set to BY_ID.
referenced_action_idIntID of the action that creates the target sandbox.Required when sandbox_references is set to BY_ACTION.
referenced_sanbox_nameStringName of the target sandbox. Required when sandbox_references is set to BY_NAME.
tagsString[]List of tags applied to the target sandbox. Required when sandbox_references is set to BY_TAGS.
sandbox_project_idIntID of the project with the target sandbox. Required when sandbox_references is set to BY_PROJECT.
daysIntNumber of days passed since the creation of the target sandbox. One of 1, 2, 3, 7, 14, 30. Required when sandbox_references is set to BY_DAYS.
snapshot_name 必填StringDefines the name of the created snapshot.

YAML example for Snapshot

actions:
- action: "Take snapshot"
type: "SANDBOX_SNAPSHOT"
sandbox_references:
- "BY_ID"
sandbox_id: "Cgn3QO34klUri"
snapshot_name: "snapshot-$BUDDY_EXECUTION_ID