You can call this operation to query detailed information about a template, including stacks and change sets associated with the template.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes GetTemplate

The operation that you want to perform. Set the value to GetTemplate.

RegionId String Yes cn-hangzhou

The region ID of the stack to which the template belongs. You can call the DescribeRegions operation to query the most recent region list.

StackId String No 4a6c9851-3b0f-4f5f-b4ca-a14bf691****

The ID of the stack.

ChangeSetId String No 1f6521a4-05af-4975-afe9-bc4b45ad****

The ID of the change set.

TemplateId String No 5ecd1e10-b0e9-4389-a565-e4c15efc****

The ID of the template.

Response parameters

Parameter Type Example Description
RequestId String B288A0BE-D927-4888-B0F7-B35EF84B6E6

The ID of the request.

TemplateBody String {\"ROSTemplateFormatVersion\": \"2015-09-01\"}

The structure of the template body.

Examples

Sample requests


http(s)://[Endpoint]/? Action=GetTemplate
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

<GetTemplateResponse>
        <TemplateBody>{"ROSTemplateFormatVersion": "2015-09-01", "Resources": {"dummy2": {"Type": "ALIYUN::DEBUG::Dummy", "Properties": {"Map": {"Ref": "param_has_default"}, "List": {"Ref": "param_list"}}}, "dummy": {"Type": "ALIYUN::DEBUG::Dummy", "Properties": {"Map": {"Ref": "param_json_dict"}, "String": {"Ref": "param_str"}, "List": {"Ref": "param_json_list"}, "Number": {"Ref": "param_float"}, "Bool": {"Ref": "param_bool"}, "Integer": {"Ref": "param_integer"}}}, "nested": {"Type": "ALIYUN::ROS::Stack", "Properties": {"TemplateURL": "oss://nested-stack/simple/nested_demo", "TimeoutMins": 16}}, "WaitConditionHandle": {"Type": "ALIYUN::ROS::WaitConditionHandle", "Properties": {"UpdateVersion": {"Ref": "UpdateVersion"}}}}, "Parameters": {"param_integer": {"Type": "Number"}, "param_float": {"Type": "Number"}, "param_bool": {"Type": "Boolean"}, "param_json_list": {"Type": "Json"}, "param_has_default": {"Default": "{\"c\": []}", "Type": "Json"}, "UpdateVersion": {"Type": "Number"}, "param_str": {"Type": "String"}, "param_list": {"Type": "CommaDelimitedList"}, "param_json_dict": {"Type": "Json"}}, "Outputs": {"param_integer": {"Value": {"Ref": "param_integer"}}, "param_float": {"Value": {"Ref": "param_float"}}, "param_bool": {"Value": {"Ref": "param_bool"}}, "param_json_list": {"Value": {"Ref": "param_json_list"}}, "param_has_default": {"Value": {"Ref": "param_has_default"}}, "param_str": {"Value": {"Ref": "param_str"}}, "CurlCli": {"Value": {"Fn::GetAtt": ["WaitConditionHandle", "CurlCli"]}}, "param_list": {"Value": {"Ref": "param_list"}}, "param_json_dict": {"Value": {"Ref": "param_json_dict"}}}}</TemplateBody>
        <RequestId>B288A0BE-D927-4888-B0F7-B35EF84B6E6F</RequestId>
</GetTemplateResponse>

JSON format

{
	"TemplateBody":"{\"ROSTemplateFormatVersion\": \"2015-09-01\", \"Resources\": {\"dummy2\": {\"Type\": \"ALIYUN::DEBUG::Dummy\", \"Properties\": {\"Map\": {\"Ref\": \"param_has_default\"}, \"List\": {\"Ref\": \"param_list\"}}}, \"dummy\": {\"Type\": \"ALIYUN::DEBUG::Dummy\", \"Properties\": {\"Map\": {\"Ref\": \"param_json_dict\"}, \"String\": {\"Ref\": \"param_str\"}, \"List\": {\"Ref\": \"param_json_list\"}, \"Number\": {\"Ref\": \"param_float\"}, \"Bool\": {\"Ref\": \"param_bool\"}, \"Integer\": {\"Ref\": \"param_integer\"}}}, \"nested\": {\"Type\": \"ALIYUN::ROS::Stack\", \"Properties\": {\"TemplateURL\": \"oss://nested-stack/simple/nested_demo\", \"TimeoutMins\": 16}}, \"WaitConditionHandle\": {\"Type\": \"ALIYUN::ROS::WaitConditionHandle\", \"Properties\": {\"UpdateVersion\": {\"Ref\": \"UpdateVersion\"}}}}, \"Parameters\": {\"param_integer\": {\"Type\": \"Number\"}, \"param_float\": {\"Type\": \"Number\"}, \"param_bool\": {\"Type\": \"Boolean\"}, \"param_json_list\": {\"Type\": \"Json\"}, \"param_has_default\": {\"Default\": \"{\\\"c\\\": []}\", \"Type\": \"Json\"}, \"UpdateVersion\": {\"Type\": \"Number\"}, \"param_str\": {\"Type\": \"String\"}, \"param_list\": {\"Type\": \"CommaDelimitedList\"}, \"param_json_dict\": {\"Type\": \"Json\"}}, \"Outputs\": {\"param_integer\": {\"Value\": {\"Ref\": \"param_integer\"}}, \"param_float\": {\"Value\": {\"Ref\": \"param_float\"}}, \"param_bool\": {\"Value\": {\"Ref\": \"param_bool\"}}, \"param_json_list\": {\"Value\": {\"Ref\": \"param_json_list\"}}, \"param_has_default\": {\"Value\": {\"Ref\": \"param_has_default\"}}, \"param_str\": {\"Value\": {\"Ref\": \"param_str\"}}, \"CurlCli\": {\"Value\": {\"Fn::GetAtt\": [\"WaitConditionHandle\", \"CurlCli\"]}}, \"param_list\": {\"Value\": {\"Ref\": \"param_list\"}}, \"param_json_dict\": {\"Value\": {\"Ref\": \"param_json_dict\"}}}}",
	"RequestId":"B288A0BE-D927-4888-B0F7-B35EF84B6E6F"
}

Error codes

For a list of error codes, visit the API Error Center.

For more information about errors common to all operations, see Common errors.

Error code

Error message

HTTP status code

Description

ChangeSetNotFound

The ChangeSet ({name}) of Stack ({stack}) could not be found.

404

The error message returned because the specified change set does not exist. name indicates the name or ID of the change set, and stack indicates the name or ID of the stack.

ChangeSetNotFound

The ChangeSet {ID} could not be found.

404

The error message returned because the specified change set does not exist. ID indicates the ID of the change set.

StackNotFound

The Stack ({name}) could not be found.

404

The error message returned because the specified stack does not exist. name indicates the name or ID of the stack.

TemplateNotFound

The Tempalte ({ ID }) could not be found.

404

The error message returned because the specified template does not exist. ID indicates the template ID.