Starts a task execution.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
oos:StartExecution |
update |
*Execution
|
|
None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
No |
The region ID. |
cn-hangzhou |
| TemplateName |
string |
No |
The template name. The name can contain letters, digits, hyphens (-), and underscores (_), and can be up to 200 characters in length. |
vmeixme |
| TemplateVersion |
string |
No |
The version number. If you do not specify this parameter, the latest version number is used by default. |
v1 |
| Mode |
string |
No |
The execution mode. Valid values:
|
Automatic |
| LoopMode |
string |
No |
The loop mode. Valid values:
|
Automatic |
ParentExecutionId
deprecated
|
string |
No |
The parent execution ID. |
exec-xxx |
| SafetyCheck |
string |
No |
The safety check mode. Valid values:
|
Skip |
| Parameters |
string |
No |
A JSON string that consists of a set of parameters. Default value: {}. |
{"Status":"Running"} |
| ClientToken |
string |
No |
The access token. |
123e56767-e89b-12d3-a456-426655440000 |
| Tags |
object |
No |
The tags to add to the task execution. |
{ "k1": "v1", "k2": "v2" } |
| Description |
string |
No |
The description to add to the task execution. |
test execution. |
| TemplateContent |
string |
No |
The template content in JSON or YAML format. This is the same as the Content field in the CreateTemplate request parameters. If you specify this parameter, the tasks in TemplateContent are directly executed without the need to create a template first. You do not need to specify this parameter if you use an existing template to create a task execution. |
{ "Description": "Example template, describe instances in some status", "FormatVersion": "OOS-2019-06-01", "Parameters": {}, "Tasks": [ { "Name": "describeInstances", "Action": "ACS::ExecuteAPI", "Description": "desc-en", "Properties": { "Service": "ECS", "API": "DescribeInstances", "Parameters": { "Status": "Running" } } } ] } |
| ResourceGroupId |
string |
No |
The resource group ID. |
rg-acfmxsn4m4****** |
| TemplateURL |
string |
No |
The URL of the OOS template content stored in Alibaba Cloud Object Storage Service (OSS). Only publicly readable URLs are supported. If you specify this parameter, a task execution is created based on the template content stored at the TemplateURL without the need to create a template first. You do not need to specify this parameter if you use an existing template to create a task execution. |
http://oos-template.cn-hangzhou.oss.aliyun-inc.com/oos-test-template.json |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
14A07460-EBE7-47CA-9757-12CC4761D47A |
| Execution |
object |
The task execution data. |
|
| Outputs |
string |
The output of the task execution. |
{ "InstanceId":"i-xxx" } |
| Status |
string |
The task execution status. |
Success |
| EndDate |
string |
The end time in ISO 8601 format (UTC). |
2019-05-16T10:26:14Z |
| ExecutedBy |
string |
The user who executed the template. |
root(13092080xx12344) |
| IsParent |
boolean |
Indicates whether the task execution contains child tasks. |
false |
| Tags |
object |
The tags of the task execution. |
{"k1":"v2","k2":"v2"} |
| StartDate |
string |
The start time in ISO 8601 format (UTC). |
2019-05-16T10:26:14Z |
| SafetyCheck |
string |
The safety check mode. |
Skip |
| Mode |
string |
The execution mode. |
Automatic |
| TemplateName |
string |
The template name. |
MyTemplate |
| CreateDate |
string |
The time when the task execution was created, in ISO 8601 format (UTC). |
2019-05-16T10:26:14Z |
| TemplateVersion |
string |
The template version number. |
v1 |
| ExecutionId |
string |
The unique identifier of the task execution. |
exec-xxxyyy |
| Parameters |
string |
The input parameters of the task execution. |
{ "Status":"Running" } |
| Description |
string |
The description of the task execution. |
test execution. |
| Counters |
object |
The number of executions. |
1 |
| UpdateDate |
string |
The update time in ISO 8601 format (UTC). |
2019-05-16T10:26:14Z |
| ResourceGroupId |
string |
The resource group ID. |
rg-acfmxsn4m4****** |
| ParentExecutionId |
string |
The parent execution ID. |
exec-xxxx |
| RamRole |
string |
The RAM role used to execute the template. |
OOSServiceRole |
| TemplateId |
string |
The template ID. |
t-1bd341007f |
| StatusMessage |
string |
The status message. |
"" |
| LoopMode |
string |
The loop mode. |
Automatic |
| CurrentTasks |
array<object> |
The tasks that are currently running. |
|
|
object |
|||
| TaskExecutionId |
string |
The task execution ID. |
exec-dsadasdawq |
| TaskName |
string |
The task name. |
testTask |
| TaskAction |
string |
The action of the task. |
ACS::TimerTrigger |
Examples
Success response
JSON format
{
"RequestId": "14A07460-EBE7-47CA-9757-12CC4761D47A",
"Execution": {
"Outputs": "{ \"InstanceId\":\"i-xxx\" }",
"Status": "Success",
"EndDate": "2019-05-16T10:26:14Z",
"ExecutedBy": "root(13092080xx12344)",
"IsParent": false,
"Tags": {
"k1": "v2",
"k2": "v2"
},
"StartDate": "2019-05-16T10:26:14Z",
"SafetyCheck": "Skip",
"Mode": "Automatic",
"TemplateName": "MyTemplate",
"CreateDate": "2019-05-16T10:26:14Z",
"TemplateVersion": "v1",
"ExecutionId": "exec-xxxyyy",
"Parameters": "{ \"Status\":\"Running\" }",
"Description": "test execution.",
"Counters": 1,
"UpdateDate": "2019-05-16T10:26:14Z",
"ResourceGroupId": "rg-acfmxsn4m4******",
"ParentExecutionId": "exec-xxxx",
"RamRole": "OOSServiceRole",
"TemplateId": "t-1bd341007f",
"StatusMessage": "\"\"",
"LoopMode": "Automatic",
"CurrentTasks": [
{
"TaskExecutionId": "exec-dsadasdawq",
"TaskName": "testTask",
"TaskAction": "ACS::TimerTrigger"
}
]
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.