调用GetTemplateSummary接口获取新模板或者现有模板的信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | GetTemplateSummary |
系统规定参数。取值:GetTemplateSummary。 |
StackId | String | 否 | 4a6c9851-3b0f-4f5f-b4ca-a14bf691**** |
资源栈ID。 您仅能指定TemplateBody、TemplateURL、TemplateId、StackId、ChangeSetId、StackGroupName其中一个参数。 |
TemplateBody | String | 否 | {"ROSTemplateFormatVersion":"2015-09-01"} |
模板的结构。长度为1~524,288个字节。 如果长度较大,建议通过HTTP POST+Body Param的方式,将参数放在请求体中进行传递,避免URL过长而导致请求失败。 您仅能指定TemplateBody、TemplateURL、TemplateId、StackId、ChangeSetId、StackGroupName其中一个参数。 |
RegionId | String | 否 | cn-hangzhou |
模板所属资源栈或资源栈组的地域ID。您可以调用DescribeRegions查看最新的阿里云地域列表。 仅在指定StackId、ChangeSetId或StackGroupName时生效。 |
TemplateId | String | 否 | 5ecd1e10-b0e9-4389-a565-e4c15efc**** |
模板ID。支持共享模板和私有模板。 您仅能指定TemplateBody、TemplateURL、TemplateId、StackId、ChangeSetId、StackGroupName其中一个参数。 |
TemplateURL | String | 否 | oss://ros/template/demo |
包含模板主体的文件的位置。URL必须指向位于Web服务器(HTTP或HTTPS)或阿里云OSS存储空间(例如:oss://ros/template/demo、oss://ros/template/demo?RegionId=cn-hangzhou)中的模板,模板最大为524,288个字节。 说明 如果OSS地域未指定,默认与接口参数RegionId相同。
您仅能指定TemplateBody、TemplateURL、TemplateId、StackId、ChangeSetId、StackGroupName其中一个参数。 URL的最大长度为:1024个字节。 |
ChangeSetId | String | 否 | 1f6521a4-05af-4975-afe9-bc4b45ad**** |
更改集ID。 您仅能指定TemplateBody、TemplateURL、TemplateId、StackId、ChangeSetId、StackGroupName其中一个参数。 |
TemplateVersion | String | 否 | v1 |
模板版本。当您设置TemplateId参数时,本参数生效。 |
StackGroupName | String | 否 | my-stack-group |
资源栈组名称。 您仅能指定TemplateBody、TemplateURL、TemplateId、StackId、ChangeSetId、StackGroupName其中一个参数。 |
Parameters.N.ParameterKey | String | 否 | InstanceId |
模板中已定义的参数的名称。如果您未指定参数的名称和值时,ROS将使用模板中指定的默认值。 N最大值为200。 说明 Parameters为可选参数。如果需要指定Parameters,则Parameters.N.ParameterKey和Parameters.N.ParameterValue必须同时指定。
|
Parameters.N.ParameterValue | String | 否 | i-rotp2e20whfrs2**** |
模板中已定义的参数的取值。 N最大值为200。 说明 Parameters为可选参数。如果需要指定Parameters,则Parameters.N.ParameterKey和Parameters.N.ParameterValue必须同时指定。
|
ClientToken | String | 否 | 123e4567-e89b-12d3-a456-42665544**** |
保证请求的幂等性。该参数值由客户端生成,并且必须全局唯一。 长度不超过64个字符。可包含英文字母、数字、短划线(-)和下划线(_)。 更多信息,请参见如何保证幂等性。 |
关于公共请求参数的详情,请参见公共参数。
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
ResourceTypes | Array of String | ["ALIYUN::ECS::VPC"] |
模板中用到的所有资源类型。 |
Description | String | No description |
资源栈模板的描述信息。 |
Parameters | Array of Object | [{"Description":"", "Label":"Name", "NoEcho":"false", "ParameterKey":"Name", "Type":"String"}] |
参数声明的列表。 |
RequestId | String | B288A0BE-D927-4888-B0F7-B35EF84B6E6 |
请求ID。 |
Version | String | 2015-09-01 |
模板版本。 |
Metadata | Map |
模板中定义的数据。 |
|
ResourceIdentifierSummaries | Array of ResourceIdentifierSummary |
资源标识符摘要的列表。 摘要描述了导入操作的目标资源以及在导入过程中用于标识目标资源的属性。 例如:VpcId是ALIYUN::ECS::VPC资源的标识符属性。 |
|
ResourceType | String | ALIYUN::ECS::VPC |
资源类型。 说明 该资源类型支持资源导入。
|
LogicalResourceIds | Array of String | ["Vpc"] |
模板中类型为ResourceType的所有资源的逻辑ID。 |
ResourceIdentifiers | Array of String | ["VpcId"] |
资源属性。用来标识目标资源。 例如:VpcId是ALIYUN::ECS::VPC资源的标识符属性。 |
示例
请求示例
http(s)://ros.aliyuncs.com/?Action=GetTemplateSummary
&StackId=4a6c9851-3b0f-4f5f-b4ca-a14bf691****
&RegionId=cn-hangzhou
&<公共请求参数>
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<GetTemplateSummary>
<Description>No description</Description>
<Metadata />
<Parameters>
<Description>Description of the vpc, [2, 256] characters. Do not fill or empty, the default is empty.</Description>
<Label>Description</Label>
<NoEcho>false</NoEcho>
<ParameterKey>Description</ParameterKey>
<Type>String</Type>
</Parameters>
<Parameters>
<Description>Tags to attach to vpc. Max support 20 tags to add during create vpc. Each tag with two properties Key and Value, and Key is required.</Description>
<Label>Tags</Label>
<MaxLength>20</MaxLength>
<NoEcho>false</NoEcho>
<ParameterKey>Tags</ParameterKey>
<Type>Json</Type>
</Parameters>
<Parameters>
<Description>IPv6 network cidr of the VPC.</Description>
<Label>Ipv6CidrBlock</Label>
<MinLength>1</MinLength>
<NoEcho>false</NoEcho>
<ParameterKey>Ipv6CidrBlock</ParameterKey>
<Type>String</Type>
</Parameters>
<Parameters>
<AllowedValues>True</AllowedValues>
<AllowedValues>true</AllowedValues>
<AllowedValues>False</AllowedValues>
<AllowedValues>false</AllowedValues>
<Default>false</Default>
<Description>Whether to enable an IPv6 network cidr, the value is:False (default): not turned on.True: On.</Description>
<Label>EnableIpv6</Label>
<NoEcho>false</NoEcho>
<ParameterKey>EnableIpv6</ParameterKey>
<Type>Boolean</Type>
</Parameters>
<Parameters>
<Description>Resource group id.</Description>
<Label>ResourceGroupId</Label>
<NoEcho>false</NoEcho>
<ParameterKey>ResourceGroupId</ParameterKey>
<Type>String</Type>
</Parameters>
<Parameters>
<Description>Display name of the vpc instance, [2, 128] English or Chinese characters, must start with a letter or Chinese in size, can contain numbers, '_' or '.', '-'</Description>
<Label>VpcName</Label>
<NoEcho>false</NoEcho>
<ParameterKey>VpcName</ParameterKey>
<Type>String</Type>
</Parameters>
<Parameters>
<Description>
The IP address range of the VPC in the CIDR block form. You can use the following IP address ranges and their subnets:
10.0.0.0/8
172.16.0.0/12 (Default)
192.168.0.0/16</Description>
<Label>CidrBlock</Label>
<NoEcho>false</NoEcho>
<ParameterKey>CidrBlock</ParameterKey>
<Type>String</Type>
</Parameters>
<RequestId>FD70598C-3F4B-4E66-9A76-67F2E2D36938</RequestId>
<ResourceIdentifierSummaries>
<LogicalResourceIds>Vpc</LogicalResourceIds>
<ResourceIdentifiers>VpcId</ResourceIdentifiers>
<ResourceType>ALIYUN::ECS::VPC</ResourceType>
</ResourceIdentifierSummaries>
<ResourceTypes>ALIYUN::ECS::VPC</ResourceTypes>
<Version>2015-09-01</Version>
</GetTemplateSummary>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"Description" : "No description",
"Metadata" : { },
"Parameters" : [ {
"Description" : "Description of the vpc, [2, 256] characters. Do not fill or empty, the default is empty.",
"Label" : "Description",
"NoEcho" : "false",
"ParameterKey" : "Description",
"Type" : "String"
}, {
"Description" : "Tags to attach to vpc. Max support 20 tags to add during create vpc. Each tag with two properties Key and Value, and Key is required.",
"Label" : "Tags",
"MaxLength" : 20,
"NoEcho" : "false",
"ParameterKey" : "Tags",
"Type" : "Json"
}, {
"Description" : "IPv6 network cidr of the VPC.",
"Label" : "Ipv6CidrBlock",
"MinLength" : 1,
"NoEcho" : "false",
"ParameterKey" : "Ipv6CidrBlock",
"Type" : "String"
}, {
"AllowedValues" : [ "True", "true", "False", "false" ],
"Default" : false,
"Description" : "Whether to enable an IPv6 network cidr, the value is:False (default): not turned on.True: On.",
"Label" : "EnableIpv6",
"NoEcho" : "false",
"ParameterKey" : "EnableIpv6",
"Type" : "Boolean"
}, {
"Description" : "Resource group id.",
"Label" : "ResourceGroupId",
"NoEcho" : "false",
"ParameterKey" : "ResourceGroupId",
"Type" : "String"
}, {
"Description" : "Display name of the vpc instance, [2, 128] English or Chinese characters, must start with a letter or Chinese in size, can contain numbers, '_' or '.', '-'",
"Label" : "VpcName",
"NoEcho" : "false",
"ParameterKey" : "VpcName",
"Type" : "String"
}, {
"Description" : "The IP address range of the VPC in the CIDR block form. You can use the following IP address ranges and their subnets:\n10.0.0.0/8\n172.16.0.0/12 (Default)\n192.168.0.0/16",
"Label" : "CidrBlock",
"NoEcho" : "false",
"ParameterKey" : "CidrBlock",
"Type" : "String"
} ],
"RequestId" : "FD70598C-3F4B-4E66-9A76-67F2E2D36938",
"ResourceIdentifierSummaries" : [ {
"LogicalResourceIds" : [ "Vpc" ],
"ResourceIdentifiers" : [ "VpcId" ],
"ResourceType" : "ALIYUN::ECS::VPC"
} ],
"ResourceTypes" : [ "ALIYUN::ECS::VPC" ],
"Version" : "2015-09-01"
}
错误码
访问错误中心查看更多错误码。
HttpCode |
错误码 |
错误信息 |
描述 |
---|---|---|---|
400 |
StackValidationFailed |
{reason}. |
资源栈校验失败。reason为具体原因。 |
404 |
ChangeSetNotFound |
The ChangeSet ({name}) of Stack ({stack}) could not be found. |
更改集不存在。name为更改集名称或ID,stack为资源栈名称或ID。 |
404 |
ChangeSetNotFound |
The ChangeSet {ID} could not be found. |
更改集不存在。ID为更改集ID。 |
404 |
StackNotFound |
The Stack ({name}) could not be found. |
资源栈不存在。name为资源栈名称或ID。 |
404 |
TemplateNotFound |
The Tempalte ({ ID }) could not be found. |
模板不存在。ID为模板ID。 |
404 |
TemplateNotFound |
The Template { ID } with version { version } could not be found. |
模板或指定版本不存在。ID为模板ID,version为模板版本。 |