调用GetResourceTypeTemplate接口根据资源类型查询该资源的模板。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | GetResourceTypeTemplate |
要执行的操作,取值:GetResourceTypeTemplate。 |
ResourceType | String | 是 | ALIYUN::ECS::VPC |
资源类型。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
RequestId | String | 87F54B2B-AEF0-4C33-A72A-3F8856A575E9 |
请求ID。 |
TemplateBody | Map | {"ROSTemplateFormatVersion": "2015-09-01"} |
模板主体的结构。 长度为1~51,200个字节。 |
示例
请求示例
http(s)://ros.aliyuncs.com/?Action=GetResourceTypeTemplate
&ResourceType=ALIYUN::ECS::VPC
&<公共请求参数>
正常返回示例
XML
格式
<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
格式
{
"RequestId": "87F54B2B-AEF0-4C33-A72A-3F8856A575E9",
"TemplateBody": {
"Parameters": {
"CidrBlock": {
"Type": "String"
},
"Description": {
"Type": "String"
},
"ResourceGroupId": {
"Type": "String"
},
"VpcName": {
"Type": "String"
}
},
"ROSTemplateFormatVersion": "2015-09-01",
"Resources": {
"Vpc": {
"Properties": {
"CidrBlock": {
"Ref": "CidrBlock"
},
"Description": {
"Ref": "Description"
},
"ResourceGroupId": {
"Ref": "ResourceGroupId"
},
"VpcName": {
"Ref": "VpcName"
}
},
"Type": "ALIYUN::ECS::VPC"
}
}
}
}
错误码
访问错误中心查看更多错误码。
HttpCode |
错误码 |
错误信息 |
描述 |
---|---|---|---|
404 |
ResourceTypeNotFound |
The Resource Type ({name}) could not be found. |
资源类型不存在。name为资源类型名。 |