You can call this operation to query the template of a resource by resource type.

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 GetResourceTypeTemplate

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

ResourceType String Yes ALIYUN::ECS::VPC

The type of the resource.

Response parameters

Parameter Type Example Description
RequestId String 87F54B2B-AEF0-4C33-A72A-3F8856A575E9

The ID of the request.

TemplateBody Map {"ROSTemplateFormatVersion":"2015-09-01"}

The structure that contains the template body. The template body must be 1 to 51,200 bytes in length.

Examples

Sample requests


http(s)://ros.aliyuncs.com/? Action=GetResourceTypeTemplate
&ResourceType=ALIYUN::ECS::VPC
&<Common request parameters>

Sample success responses

XML format

<GetResourceTypeTemplateResponse>
       <RequestId type="string">87F54B2B-AEF0-4C33-A72A-3F8856A575E9</RequestId>
       <TemplateBody class="object">
              <Parameters class="object">
                     <CidrBlock class="object">
                            <Type type="string">String</Type>
                     </CidrBlock>
                     <Description class="object">
                            <Type type="string">String</Type>
                     </Description>
                     <ResourceGroupId class="object">
                            <Type type="string">String</Type>
                     </ResourceGroupId>
                     <VpcName class="object">
                            <Type type="string">String</Type>
                     </VpcName>
              </Parameters>
              <ROSTemplateFormatVersion type="string">2015-09-01</ROSTemplateFormatVersion>
              <Resources class="object">
                     <Vpc class="object">
                            <Properties class="object">
                                   <CidrBlock class="object">
                                          <Ref type="string">CidrBlock</Ref>
                                   </CidrBlock>
                                   <Description class="object">
                                          <Ref type="string">Description</Ref>
                                   </Description>
                                   <ResourceGroupId class="object">
                                          <Ref type="string">ResourceGroupId</Ref>
                                   </ResourceGroupId>
                                   <VpcName class="object">
                                          <Ref type="string">VpcName</Ref>
                                   </VpcName>
                            </Properties>
                            <Type type="string">ALIYUN::ECS::VPC</Type>
                     </Vpc>
              </Resources>
       </TemplateBody>
</GetResourceTypeTemplateResponse>

JSON format

{
	"TemplateBody":{
		"Parameters":{
			"VpcName":{
				"Type":"String"
			},
			"CidrBlock":{
				"Type":"String"
			},
			"Description":{
				"Type":"String"
			},
			"ResourceGroupId":{
				"Type":"String"
			}
		},
		"ROSTemplateFormatVersion":"2015-09-01",
		"Resources":{
			"Vpc":{
				"Type":"ALIYUN::ECS::VPC",
				"Properties":{
					"VpcName":{
						"Ref":"VpcName"
					},
					"CidrBlock":{
						"Ref":"CidrBlock"
					},
					"Description":{
						"Ref":"Description"
					},
					"ResourceGroupId":{
						"Ref":"ResourceGroupId"
					}
				}
			}
		}
	},
	"RequestId":"87F54B2B-AEF0-4C33-A72A-3F8856A575E9"
}

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

ResourceTypeNotFound

The Resource Type ({name}) could not be found.

404

The error message returned because the specified resource type does not exist. name indicates the name of the resource type.