The ALIYUN::OOS::Execution resource starts an execution.
Syntax
{
"Type": "ALIYUN::OOS::Execution",
"Properties": {
"ResourceOptions": Map,
"Parameters": Map,
"Tags": Map,
"TemplateName": String,
"ParentExecutionId": String,
"SafetyCheck": String,
"Mode": String,
"TemplateVersion": String,
"ResourceGroupId": String,
"LoopMode": String,
"Description": String,
"TemplateContent": String,
"TemplateURL": String
}
}Properties
Property name | Type | Required | Update allowed | Description | Constraints |
ResourceOptions | Map | No | No | The resource options that ROS uses. | For more information, see the ResourceOptions properties. |
Parameters | Map | No | No | A JSON string that consists of a collection of parameters. | Example: Default value: {}. |
Tags | Map | No | No | The tags, which consist of key-value pairs. For example: {"k1":"v1", "k2":"v2"}. | A maximum of 20 tags are supported. |
TemplateName | String | No | No | The template name. | The name can be up to 200 characters long. It cannot start with ALIYUN, ACS, or ALIBABA. It can contain letters, digits, hyphens (-), and underscores (_). |
ParentExecutionId | String | No | No | The parent execution ID. | None |
SafetyCheck | String | No | No | The safety check pattern. | Valid values:
|
Mode | String | No | No | The execution pattern. | Valid values:
|
TemplateVersion | String | No | No | The version number. | If you do not specify this parameter, the latest version is used. |
ResourceGroupId | String | No | No | The resource group ID. | None |
LoopMode | String | No | No | The loop pattern. | None |
Description | String | No | No | The description to add to the execution. | None |
TemplateContent | String | No | No | The template content. | The content must be in JSON or YAML format. This is the same as the Content field in the CreateTemplate API request parameter. You can pass this field to directly execute the tasks in TemplateContent without creating a template first. You do not need to pass this field if you use an existing template to create the execution task. |
TemplateURL | String | No | No | The URL of the OOS template content stored in Alibaba Cloud Object Storage Service (OSS). Only public-read URLs are supported. | You can pass this field to create an execution task directly from the template content stored at the TemplateURL. You do not need to create a template first. You do not need to pass this field if you use an existing template to create the execution task. |
ResourceOptions syntax
"ResourceOptions": {
"SuccessStatuses": List,
"Timeout": Number,
"CancelOnDelete": Boolean,
"FailureStatuses": List
}ResourceOptions properties
Property name | Type | Required | Update allowed | Description | Constraints |
SuccessStatuses | List | No | No | ROS uses this property to determine whether the resource was created successfully. | Valid values:
If the execution status is in FailureStatuses, the creation fails. If the execution status is in SuccessStatuses, the creation is successful. If neither condition is met, ROS waits until the operation times out. |
Timeout | Number | No | No | The timeout period. | Unit: seconds. Default value: 1800. |
CancelOnDelete | Boolean | No | No | Specifies whether to cancel the execution if it is not complete when the resource is deleted. | Valid values:
|
FailureStatuses | List | No | No | ROS uses this property to determine whether the resource failed to be created. FailureStatuses has a higher priority than SuccessStatuses. | Valid values:
Default value: |
Return values
Fn::GetAtt
Status: The status of the execution.
WindowsCurlCli: The curl command-line interface (CLI) command prefix for Windows. You can use this prefix to signal that the process is complete or has failed. For more information, see NotifyExecution.
PowerShellCurlCli: The curl CLI command prefix for PowerShell. You can use this prefix to signal that the process is complete or has failed.
Outputs: The output of the execution.
ExecutionId: The unique identity of the execution.
CurlCli: The curl command.
StatusMessage: The status message.
Counters: The number of executions.
Examples
YAML
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
TemplateName:
Type: String
Description: The template name. The name can be up to 200 characters long. It can contain letters, digits, and underscores (_). It cannot start with ALIYUN, ACS, or ALIBABA.
Label: Template Name
ConstraintDescription: '[2, 128] English characters'
MinLength: 2
MaxLength: 128
Default: mytest
Resources:
Execution:
Type: ALIYUN::OOS::Execution
Properties:
Parameters: {}
TemplateName:
Ref: TemplateName
ResourceOptions:
SuccessStatuses:
- Running
- Success
- Queued
- Waiting
CancelOnDelete: true
Outputs:
Status:
Description: The execution status.
Value:
Fn::GetAtt:
- Execution
- Status
WindowsCurlCli:
Description: 'A convenience attribute that provides the curl CLI command prefix for Windows. You can use this to notify an OOS execution instead of using the OOS API NotifyExecution. To approve an execution, add --data-binary "{\"data\": {\"NotifyType\": \"Approve\"}}". You can also notify an execution using the ROS API SignalResource. The Status and UniqueId API parameters are ignored. Use the Data API parameter to pass data.'
Value:
Fn::GetAtt:
- Execution
- WindowsCurlCli
PowerShellCurlCli:
Description: 'A convenience attribute that provides the curl CLI command prefix for PowerShell. You can use this to notify an OOS execution instead of using the OOS API NotifyExecution. To approve an execution, add -Body ''{"data": {"NotifyType": "Approve"}}''. You can also notify an execution using the ROS API SignalResource. The Status and UniqueId API parameters are ignored. Use the Data API parameter to pass data.'
Value:
Fn::GetAtt:
- Execution
- PowerShellCurlCli
Outputs:
Description: The execution output.
Value:
Fn::GetAtt:
- Execution
- Outputs
ExecutionId:
Description: The execution ID.
Value:
Fn::GetAtt:
- Execution
- ExecutionId
CurlCli:
Description: 'A convenience attribute that provides the curl CLI command prefix. You can use this to notify an OOS execution instead of using the OOS API NotifyExecution. To approve an execution, add --data-binary ''{"data": {"NotifyType": "Approve"}}''. You can also notify an execution using the ROS API SignalResource. The Status and UniqueId API parameters are ignored. Use the Data API parameter to pass data.'
Value:
Fn::GetAtt:
- Execution
- CurlCli
StatusMessage:
Description: The execution status information.
Value:
Fn::GetAtt:
- Execution
- StatusMessage
Counters:
Description: 'The task statistics: FailedTasks, SuccessTasks, TotalTasks.'
Value:
Fn::GetAtt:
- Execution
- CountersJSON
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"TemplateName": {
"Type": "String",
"Description": "The template name. The name can be up to 200 characters long. It can contain letters, digits, and underscores (_). It cannot start with ALIYUN, ACS, or ALIBABA.",
"Label": "Template Name",
"ConstraintDescription": "[2, 128] English characters",
"MinLength": 2,
"MaxLength": 128,
"Default": "mytest"
}
},
"Resources": {
"Execution": {
"Type": "ALIYUN::OOS::Execution",
"Properties": {
"Parameters": {
},
"TemplateName": {
"Ref": "TemplateName"
},
"ResourceOptions": {
"SuccessStatuses": [
"Running",
"Success",
"Queued",
"Waiting"
],
"CancelOnDelete": true
}
}
}
},
"Outputs": {
"Status": {
"Description": "The execution status.",
"Value": {
"Fn::GetAtt": [
"Execution",
"Status"
]
}
},
"WindowsCurlCli": {
"Description": "A convenience attribute that provides the curl CLI command prefix for Windows. You can use this to notify an OOS execution instead of using the OOS API NotifyExecution. To approve an execution, add --data-binary \"{\\\"data\\\": {\\\"NotifyType\\\": \\\"Approve\\\"}}\". You can also notify an execution using the ROS API SignalResource. The Status and UniqueId API parameters are ignored. Use the Data API parameter to pass data.",
"Value": {
"Fn::GetAtt": [
"Execution",
"WindowsCurlCli"
]
}
},
"PowerShellCurlCli": {
"Description": "A convenience attribute that provides the curl CLI command prefix for PowerShell. You can use this to notify an OOS execution instead of using the OOS API NotifyExecution. To approve an execution, add -Body '{\\\"data\\\": {\\\"NotifyType\\\": \\\"Approve\\\"}}'. You can also notify an execution using the ROS API SignalResource. The Status and UniqueId API parameters are ignored. Use the Data API parameter to pass data.",
"Value": {
"Fn::GetAtt": [
"Execution",
"PowerShellCurlCli"
]
}
},
"Outputs": {
"Description": "The execution output.",
"Value": {
"Fn::GetAtt": [
"Execution",
"Outputs"
]
}
},
"ExecutionId": {
"Description": "The execution ID.",
"Value": {
"Fn::GetAtt": [
"Execution",
"ExecutionId"
]
}
},
"CurlCli": {
"Description": "A convenience attribute that provides the curl CLI command prefix. You can use this to notify an OOS execution instead of using the OOS API NotifyExecution. To approve an execution, add --data-binary '{\\\"data\\\": {\\\"NotifyType\\\": \\\"Approve\\\"}}'. You can also notify an execution using the ROS API SignalResource. The Status and UniqueId API parameters are ignored. Use the Data API parameter to pass data.",
"Value": {
"Fn::GetAtt": [
"Execution",
"CurlCli"
]
}
},
"StatusMessage": {
"Description": "The execution status information.",
"Value": {
"Fn::GetAtt": [
"Execution",
"StatusMessage"
]
}
},
"Counters": {
"Description": "The task statistics: FailedTasks, SuccessTasks, TotalTasks.",
"Value": {
"Fn::GetAtt": [
"Execution",
"Counters"
]
}
}
}
}