ALIYUN::OOS::Execution類型用于啟動一個執行。
語法
{
"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
}
}
屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
ResourceOptions | Map | 否 | 否 | ROS使用的資源選項。 | 更多信息,請參見ResourceOptions屬性。 |
Parameters | Map | 否 | 否 | 由參數集合組成的JSON字符串。 | 示例值: 默認值:{}。 |
Tags | Map | 否 | 否 | 標簽,由鍵值對組成。例如:{“k1”:”v1”, ”k2”:”v2”}。 | 最多支持20個標簽。 |
TemplateName | String | 否 | 否 | 模板名稱。 | 最長為200個字符,不能以ALIYUN、ACS、ALIBABA開頭。可包含英文字母、數字、短劃線(-)和下劃線(_)。 |
ParentExecutionId | String | 否 | 否 | 父執行ID。 | 無 |
SafetyCheck | String | 否 | 否 | 安全檢查模式。 | 取值:
|
Mode | String | 否 | 否 | 執行模式。 | 取值:
|
TemplateVersion | String | 否 | 否 | 版本號。 | 如果不填默認為最新的版本號。 |
ResourceGroupId | String | 否 | 否 | 資源組ID。 | 無 |
LoopMode | String | 否 | 否 | 循環模式。 | 無 |
Description | String | 否 | 否 | 要給執行添加的描述信息。 | 無 |
TemplateContent | String | 否 | 否 | 模板內容。 | JSON 或 YAML 格式(同 CreateTemplate API 請求參數中的 Content 字段)。用戶傳入此字段可直接執行 TemplateContent 中的任務,而無需提前創建模板再創建執行任務(當用戶選擇已有的 Template 創建執行任務時不需傳入此字段)。 |
TemplateURL | String | 否 | 否 | 阿里云對象存儲 OSS 中存放 OOS 模板內容的 URL(只支持公共讀的 URL)。 | 用戶傳入此字段可直接根據行 TemplateURL 中存儲的模板內容創建執行任務,無需提前創建模板再創建執行任務(當用戶選擇已有的 Template 創建執行任務時不需傳入此字段)。 |
ResourceOptions語法
"ResourceOptions": {
"SuccessStatuses": List,
"Timeout": Number,
"CancelOnDelete": Boolean,
"FailureStatuses": List
}
ResourceOptions屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
SuccessStatuses | List | 否 | 否 | ROS使用該屬性判斷資源是否創建成功。 | 取值:
如果Execution的狀態在FailureStatuses中,則判定為失敗。如果Execution的狀態在SuccessStatuses中,則判定為成功。如果上述條件不符合,則一直等待,直到超時(Timeout)。 |
Timeout | Number | 否 | 否 | 超時時間。 | 單位:秒。 默認值:1800。 |
CancelOnDelete | Boolean | 否 | 否 | 刪除資源時,如果執行未完成是否取消執行。 | 取值:
|
FailureStatuses | List | 否 | 否 | ROS使用該屬性判斷資源是否創建失敗。FailureStatuses優先級高于SuccessStatuses。 | 取值:
默認值: |
返回值
Fn::GetAtt
Status:執行狀態。
WindowsCurlCli:為Windows提供curl CLI命令前綴,可用于發出處理完成或失敗的信號。更多信息,請參見NotifyExecution。
PowerShellCurlCli:為PowerShell提供curl CLI命令前綴,可用于發出信號處理完成或失敗。
Outputs:執行輸出結果。
ExecutionId:執行的唯一標識。
CurlCli:curl命令。
StatusMessage:狀態信息。
Counters:執行數。
示例
YAML
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
TemplateName:
Type: String
Description: Template name. Content is limited to letters, numbers, underlined, underline, the length of 200 characters, and can not begin to ALIYUN, ACS, ALIBABA.
Label: Template Name
ConstraintDescription: '[2, 128] English or Chinese 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: Execution status.
Value:
Fn::GetAtt:
- Execution
- Status
WindowsCurlCli:
Description: 'Convenience attribute, provides curl CLI command prefix for Windows, which can be used to notify oos execution instead of OOS API NotifyExecution. You can notify approve to oos execution by adding --data-binary "{\"data\": {\"NotifyType\": \"Approve\"}}" You can also notify execution via ROS API SignalResource. API parameters Status and UniqueId are ignored. Use API parameter Data to pass data.'
Value:
Fn::GetAtt:
- Execution
- WindowsCurlCli
PowerShellCurlCli:
Description: 'Convenience attribute, provides curl CLI command prefix for PowerShell, which can be used to notify oos execution instead of OOS API NotifyExecution. You can notify approve to oos execution by adding -Body ''{"data": {"NotifyType": "Approve"}}'' You can also notify execution via ROS API SignalResource. API parameters Status and UniqueId are ignored. Use API parameter Data to pass data.'
Value:
Fn::GetAtt:
- Execution
- PowerShellCurlCli
Outputs:
Description: Execution output.
Value:
Fn::GetAtt:
- Execution
- Outputs
ExecutionId:
Description: Execution ID.
Value:
Fn::GetAtt:
- Execution
- ExecutionId
CurlCli:
Description: 'Convenience attribute, provides curl CLI command prefix, which can be used to notify oos execution instead of OOS API NotifyExecution. You can notify approve to oos execution by adding --data-binary ''{"data": {"NotifyType": "Approve"}}'' You can also notify execution via ROS API SignalResource. API parameters Status and UniqueId are ignored. Use API parameter Data to pass data.'
Value:
Fn::GetAtt:
- Execution
- CurlCli
StatusMessage:
Description: Execution status information.
Value:
Fn::GetAtt:
- Execution
- StatusMessage
Counters:
Description: 'Task statistics: FailedTasks, SuccessTasks, TotalTasks.'
Value:
Fn::GetAtt:
- Execution
- Counters
JSON
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"TemplateName": {
"Type": "String",
"Description": "Template name. Content is limited to letters, numbers, underlined, underline, the length of 200 characters, and can not begin to ALIYUN, ACS, ALIBABA.",
"Label": "Template Name",
"ConstraintDescription": "[2, 128] English or Chinese 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": "Execution status.",
"Value": {
"Fn::GetAtt": [
"Execution",
"Status"
]
}
},
"WindowsCurlCli": {
"Description": "Convenience attribute, provides curl CLI command prefix for Windows, which can be used to notify oos execution instead of OOS API NotifyExecution. You can notify approve to oos execution by adding --data-binary \"{\\\"data\\\": {\\\"NotifyType\\\": \\\"Approve\\\"}}\" You can also notify execution via ROS API SignalResource. API parameters Status and UniqueId are ignored. Use API parameter Data to pass data.",
"Value": {
"Fn::GetAtt": [
"Execution",
"WindowsCurlCli"
]
}
},
"PowerShellCurlCli": {
"Description": "Convenience attribute, provides curl CLI command prefix for PowerShell, which can be used to notify oos execution instead of OOS API NotifyExecution. You can notify approve to oos execution by adding -Body '{\"data\": {\"NotifyType\": \"Approve\"}}' You can also notify execution via ROS API SignalResource. API parameters Status and UniqueId are ignored. Use API parameter Data to pass data.",
"Value": {
"Fn::GetAtt": [
"Execution",
"PowerShellCurlCli"
]
}
},
"Outputs": {
"Description": "Execution output.",
"Value": {
"Fn::GetAtt": [
"Execution",
"Outputs"
]
}
},
"ExecutionId": {
"Description": "Execution ID.",
"Value": {
"Fn::GetAtt": [
"Execution",
"ExecutionId"
]
}
},
"CurlCli": {
"Description": "Convenience attribute, provides curl CLI command prefix, which can be used to notify oos execution instead of OOS API NotifyExecution. You can notify approve to oos execution by adding --data-binary '{\"data\": {\"NotifyType\": \"Approve\"}}' You can also notify execution via ROS API SignalResource. API parameters Status and UniqueId are ignored. Use API parameter Data to pass data.",
"Value": {
"Fn::GetAtt": [
"Execution",
"CurlCli"
]
}
},
"StatusMessage": {
"Description": "Execution status information.",
"Value": {
"Fn::GetAtt": [
"Execution",
"StatusMessage"
]
}
},
"Counters": {
"Description": "Task statistics: FailedTasks, SuccessTasks, TotalTasks.",
"Value": {
"Fn::GetAtt": [
"Execution",
"Counters"
]
}
}
}
}