All Products
Search
Document Center

Operation Orchestration Service:GetExecutionTemplate

Last Updated:Oct 28, 2022

Queries the information about the template of an execution, including the content of the template.

Authorization information

The following table is the authorization information corresponding to the API, which can be found in the RAM permission policy statement.Action Used in the element to grant the RAM user or RAM role permission to call this API. The specific instructions are as follows:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All resources is used in the Resource type column of the operation.
  • Condition keyword: refers to the condition keyword defined by the cloud product itself.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operateaccess levelResource typeconditional keywordAssociation operation
oos:GetExecutionTemplateREAD
  • OOS
    acs:oos:{#regionId}:{#accountId}:execution/{#executionId}
  • oos:tag
without

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringNo

The ID of the region.

cn-hangzhou
ExecutionIdstringYes

The ID of the execution.

exec-046490ff88f242

Response parameters

ParameterTypeDescriptionExample
object
Contentstring

The content of the template.

"{\n \"FormatVersion\": \"OOS-2019-06-01\",\n \"Parameters\": {\n \"Status\": {\n \"Type\": \"String\",\n \"Description\": \"(Required) The ID of the ECS instance.\"\n }\n },\n \"Tasks\": [\n {\n \"Name\": \"bar\",\n \"Properties\": {\n \"Parameters\": {\n \"Status\": \"{{ Status }}\"\n },\n \"API\": \"DescribeInstances\",\n \"Service\": \"Ecs\"\n },\n \"Action\": \"acs::ExecuteAPI\",\n \"Outputs\": {\n \"InstanceIds\", {\n \"ValueSelector\": \".Instances.Instance[].InstanceId\",\n \"Type\": \"List\"\n }\n }\n }\n ],\n \"Outputs\": {\n \"InstanceIds\": {\n \"Value\": \" {{ bar.InstanceIds }} \",\n \"Type\": \"List\"\n }\n }\n}\n"
RequestIdstring

The ID of the request.

14A60-EBE7-47CA-9757-12C1D47A
Templateobject

The metadata of the template.

Hashstring

The SHA-256 value of the template content.

4bc7d7a21b3e003434b9c223f6e6d2578b5ebfeb5be28c1fcf8a8a1b11907bb4
UpdatedDatestring

The time when the template was last updated.

2019-05-16T10:26:14Z
UpdatedBystring

The user who last updated the template.

root(13090000)
Tagsobject

The tag keys and values. The number of key-value pairs ranges from 1 to 20.

TemplateNamestring

The name of the template.

MyTemplate
TemplateVersionstring

The version of the template. The name of the version contains the letter v and a number. The number starts from 1.

v1
TemplateFormatstring

The format of the template. The system automatically determines whether the format of the template is JSON or YAML.

JSON
Descriptionstring

The description of the template.

Descirbe instances of given status
CreatedBystring

The creator of the template.

root(13090000)
CreatedDatestring

The creation time of the template.

2019-05-16T10:26:14Z
TemplateIdstring

The ID of the template.

t-94753d4d828d38
ShareTypestring

The share type of the template. The share type of the template that you create is Private.

Private

Example

Normal return example

JSONFormat

{
  "Content": {
    "FormatVersion": "OOS-2019-06-01",
    "Parameters": {
        "Status": {
        "Type": "String",
        "Description": "(Required) The ID of the ECS instance."
        }
    },
    "Tasks": [
        {
        "Name": "bar",
        "Properties": {
            "Parameters": {
            "Status": "{{ Status }}"
            },
            "API": "DescribeInstances",
            "Service": "Ecs"
        },
        "Action": "acs::ExecuteAPI",
        "Outputs": {
            "InstanceIds": {
            "ValueSelector": ".Instances.Instance[].InstanceId",
            "Type": "List<String>"
            }
        }
        }
    ],
    "Outputs": {
        "InstanceIds": {
        "Value": " {{ bar.InstanceIds }} ",
        "Type": "List<String>"
        }
    }
    },
  "RequestId": "FAAFA45-AB65-4049-BFE0-868E1C80AF",
  "Template": {
    "CreatedBy": "root(13092000)",
    "CreatedDate": "2019-05-27T10:32:52Z",
    "UpdatedBy": "root(13092000)",
    "UpdatedDate": "2019-05-27T08:46:33Z",
    "Description": "",
    "Hash": "62eac5c64b9dae5c41e1e8b648baad95f812cab4f9221a5283edb882b5f8d712",
    "ShareType": "Private",
    "TemplateFormat": "JSON",
    "TemplateName": "MyTemplate",
    "TemplateId": "t-94753deea28d38",
    "TemplateVersion": "v1"
  }
}

XMLFormat

<GetExecutionTemplateResponse>
    <Content>
        <FormatVersion>OOS-2019-06-01</FormatVersion>
        <Parameters>
            <Status>
                <Type>String</Type>
                <Description>(Required) The ID of the ECS instance.</Description>
            </Status>
        </Parameters>
        <Tasks>
            <Name>bar</Name>
            <Properties>
                <Parameters>
                    <Status>{{ Status }}</Status>
                </Parameters>
                <API>DescribeInstances</API>
                <Service>Ecs</Service>
            </Properties>
            <Action>acs::ExecuteAPI</Action>
            <Outputs>
                <InstanceIds>
                    <ValueSelector>.Instances.Instance[].InstanceId</ValueSelector>
                    <Type>List&amp;lt;String&amp;gt;</Type>
                </InstanceIds>
            </Outputs>
        </Tasks>
        <Outputs>
            <InstanceIds>
                <Value> {{ bar.InstanceIds }} </Value>
                <Type>List&amp;lt;String&amp;gt;</Type>
            </InstanceIds>
        </Outputs>
    </Content>
    <RequestId>FAAFA45-AB65-4049-BFE0-868E1C80AF</RequestId>
    <Template>
        <CreatedBy>root(13092000)</CreatedBy>
        <CreatedDate>2019-05-27T10:32:52Z</CreatedDate>
        <UpdatedBy>root(13092000)</UpdatedBy>
        <UpdatedDate>2019-05-27T08:46:33Z</UpdatedDate>
        <Description/>
        <Hash>62eac5c64b9dae5c41e1e8b648baad95f812cab4f9221a5283edb882b5f8d712</Hash>
        <ShareType>Private</ShareType>
        <TemplateFormat>JSON</TemplateFormat>
        <TemplateName>MyTemplate</TemplateName>
        <TemplateId>t-94753deea28d38</TemplateId>
        <TemplateVersion>v1</TemplateVersion>
    </Template>
</GetExecutionTemplateResponse>

Error codes

For a list of error codes, visit the API error center.