调用GetResourceTypeTemplate接口根据资源类型生成一个示例模板。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String GetResourceTypeTemplate

系统规定参数。取值:GetResourceTypeTemplate

ResourceType String ALIYUN::ECS::VPC

资源类型。

您可以调用ListResourceTypes接口获取资源类型。

返回数据

名称 类型 示例值 描述
RequestId String 87F54B2B-AEF0-4C33-A72A-3F8856A575E9

请求ID。

TemplateBody Map

模板主体的结构。

长度为1~51,200个字节。

更多信息,请参见模板语法

示例

请求示例

http(s)://ros.aliyuncs.com/?Action=GetResourceTypeTemplate
&ResourceType=ALIYUN::ECS::VPC
&<公共请求参数>

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<GetResourceTypeTemplateResponse>
    <RequestId>82CEA644-757E-54B9-B730-0502328DA5F1</RequestId>
    <TemplateBody>
        <Parameters>
            <Ipv6Isp>
                <Type>String</Type>
                <Description>The Internet service provider (ISP) for IPv6 addresses of the VPC. Valid values:
                  BGP(default): Alibaba Cloud BGP IPv6
                  ChinaMobile: China Mobile (single line)
                  ChinaUnicom: China Unicom (single line)
                  ChinaTelecom: China Telecom (single line)
              Note If your Alibaba Cloud account is allowed to activate single-ISP bandwidth, you can set the parameter to ChinaTelecom, ChinaUnicom, and ChinaMobile.</Description>
            </Ipv6Isp>
            <Description>
                <Type>String</Type>
                <Description>Description of the vpc, [2, 256] characters. Do not fill or empty, the default is empty.</Description>
            </Description>
            <SecondaryCidrBlock>
                <Type>String</Type>
                <Description>The secondary IPv4 CIDR block. 
                  You can specify one of the following standard IPv4 CIDR blocks or their subnets asthe secondary IPv4 CIDR block: 192.168.0.0/16, 172.16.0.0/12, 
                  and 10.0.0.0/8.To use a public CIDR block as the secondary IPv4 CIDR block, 
                  submit a ticket. When you add a secondary IPv4 CIDR block, take note of 
                  the following rules: 
                  1. The CIDR block cannot start with 0. 
                  2. The subnet mask must be 8 to 24 bits in length.
                  The secondary CIDR block cannot overlap with the primary 
                  CIDR block or an existing secondary CIDR block.</Description>
            </SecondaryCidrBlock>
            <ResourceGroupId>
                <Type>String</Type>
                <Description>Resource group id.</Description>
            </ResourceGroupId>
            <CidrBlock>
                <Type>String</Type>
                <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.X.X/8
                    172.16.X.X/12 (Default)
                    192.168.X.X/16</Description>
            </CidrBlock>
            <VpcName>
                <Type>String</Type>
                <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>
            </VpcName>
            <Ipv6CidrBlock>
                <Type>String</Type>
                <Description>IPv6 network cidr of the VPC.</Description>
                <MinLength>1</MinLength>
            </Ipv6CidrBlock>
            <Tags>
                <Type>Json</Type>
                <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>
                <MaxLength>20</MaxLength>
            </Tags>
            <EnableIpv6>
                <Type>Boolean</Type>
                <Description>Whether to enable an IPv6 network cidr, the value is:False (default): not turned on.True: On.</Description>
                <AllowedValues>True</AllowedValues>
                <AllowedValues>true</AllowedValues>
                <AllowedValues>False</AllowedValues>
                <AllowedValues>false</AllowedValues>
                <Default>false</Default>
            </EnableIpv6>
            <UserCidr>
                <Type>String</Type>
                <Description>The user CIDR block. Separate multiple CIDR blocks with commas (,). At most three CIDR blocks are supported.</Description>
            </UserCidr>
        </Parameters>
        <ROSTemplateFormatVersion>2015-09-01</ROSTemplateFormatVersion>
        <Outputs>
            <VRouterId>
                <Description>Router id of created VPC.</Description>
                <Value>
                    <Fn::GetAtt>Vpc</Fn::GetAtt>
                    <Fn::GetAtt>VRouterId</Fn::GetAtt>
                </Value>
            </VRouterId>
            <RouteTableId>
                <Description>The router table id of created VPC.</Description>
                <Value>
                    <Fn::GetAtt>Vpc</Fn::GetAtt>
                    <Fn::GetAtt>RouteTableId</Fn::GetAtt>
                </Value>
            </RouteTableId>
            <VpcId>
                <Description>Id of created VPC.</Description>
                <Value>
                    <Fn::GetAtt>Vpc</Fn::GetAtt>
                    <Fn::GetAtt>VpcId</Fn::GetAtt>
                </Value>
            </VpcId>
        </Outputs>
        <Resources>
            <Vpc>
                <Type>ALIYUN::ECS::VPC</Type>
                <Properties>
                    <Ipv6Isp>
                        <Ref>Ipv6Isp</Ref>
                    </Ipv6Isp>
                    <Description>
                        <Ref>Description</Ref>
                    </Description>
                    <SecondaryCidrBlock>
                        <Ref>SecondaryCidrBlock</Ref>
                    </SecondaryCidrBlock>
                    <ResourceGroupId>
                        <Ref>ResourceGroupId</Ref>
                    </ResourceGroupId>
                    <CidrBlock>
                        <Ref>CidrBlock</Ref>
                    </CidrBlock>
                    <VpcName>
                        <Ref>VpcName</Ref>
                    </VpcName>
                    <Ipv6CidrBlock>
                        <Ref>Ipv6CidrBlock</Ref>
                    </Ipv6CidrBlock>
                    <Tags>
                        <Ref>Tags</Ref>
                    </Tags>
                    <EnableIpv6>
                        <Ref>EnableIpv6</Ref>
                    </EnableIpv6>
                    <UserCidr>
                        <Ref>UserCidr</Ref>
                    </UserCidr>
                </Properties>
            </Vpc>
        </Resources>
    </TemplateBody>
</GetResourceTypeTemplateResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "82CEA644-757E-54B9-B730-0502328DA5F1",
  "TemplateBody" : {
    "Parameters" : {
      "Ipv6Isp" : {
        "Type" : "String",
        "Description" : "The Internet service provider (ISP) for IPv6 addresses of the VPC. Valid values:\nBGP(default): Alibaba Cloud BGP IPv6\nChinaMobile: China Mobile (single line)\nChinaUnicom: China Unicom (single line)\nChinaTelecom: China Telecom (single line)\nNote If your Alibaba Cloud account is allowed to activate single-ISP bandwidth, you can set the parameter to ChinaTelecom, ChinaUnicom, and ChinaMobile."
      },
      "Description" : {
        "Type" : "String",
        "Description" : "Description of the vpc, [2, 256] characters. Do not fill or empty, the default is empty."
      },
      "SecondaryCidrBlock" : {
        "Type" : "String",
        "Description" : "The secondary IPv4 CIDR block. \nYou can specify one of the following standard IPv4 CIDR blocks or their \nsubnets as the secondary IPv4 CIDR block: 192.168.0.0/16, 172.16.0.0/12, \nand 10.0.0.0/8.To use a public CIDR block as the secondary IPv4 CIDR block, \nsubmit a ticket. When you add a secondary IPv4 CIDR block, take note of \nthe following rules: \n1. The CIDR block cannot start with 0. \n2. The subnet mask must be 8 to 24 bits in length.\nThe secondary CIDR block cannot overlap with the primary \nCIDR block or an existing secondary CIDR block."
      },
      "ResourceGroupId" : {
        "Type" : "String",
        "Description" : "Resource group id."
      },
      "CidrBlock" : {
        "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.X.X/8\n172.16.X.X/12 (Default)\n192.168.X.X/16"
      },
      "VpcName" : {
        "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 '.', '-'"
      },
      "Ipv6CidrBlock" : {
        "Type" : "String",
        "Description" : "IPv6 network cidr of the VPC.",
        "MinLength" : 1
      },
      "Tags" : {
        "Type" : "Json",
        "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.",
        "MaxLength" : 20
      },
      "EnableIpv6" : {
        "Type" : "Boolean",
        "Description" : "Whether to enable an IPv6 network cidr, the value is:False (default): not turned on.True: On.",
        "AllowedValues" : [ "True", true, "False", false ],
        "Default" : false
      },
      "UserCidr" : {
        "Type" : "String",
        "Description" : "The user CIDR block. Separate multiple CIDR blocks with commas (,). At most three CIDR blocks are supported."
      }
    },
    "ROSTemplateFormatVersion" : "2015-09-01",
    "Outputs" : {
      "VRouterId" : {
        "Description" : "Router id of created VPC.",
        "Value" : {
          "Fn::GetAtt" : [ "Vpc", "VRouterId" ]
        }
      },
      "RouteTableId" : {
        "Description" : "The router table id of created VPC.",
        "Value" : {
          "Fn::GetAtt" : [ "Vpc", "RouteTableId" ]
        }
      },
      "VpcId" : {
        "Description" : "Id of created VPC.",
        "Value" : {
          "Fn::GetAtt" : [ "Vpc", "VpcId" ]
        }
      }
    },
    "Resources" : {
      "Vpc" : {
        "Type" : "ALIYUN::ECS::VPC",
        "Properties" : {
          "Ipv6Isp" : {
            "Ref" : "Ipv6Isp"
          },
          "Description" : {
            "Ref" : "Description"
          },
          "SecondaryCidrBlock" : {
            "Ref" : "SecondaryCidrBlock"
          },
          "ResourceGroupId" : {
            "Ref" : "ResourceGroupId"
          },
          "CidrBlock" : {
            "Ref" : "CidrBlock"
          },
          "VpcName" : {
            "Ref" : "VpcName"
          },
          "Ipv6CidrBlock" : {
            "Ref" : "Ipv6CidrBlock"
          },
          "Tags" : {
            "Ref" : "Tags"
          },
          "EnableIpv6" : {
            "Ref" : "EnableIpv6"
          },
          "UserCidr" : {
            "Ref" : "UserCidr"
          }
        }
      }
    }
  }
}

错误码

访问错误中心查看更多错误码。

HttpCode

错误码

错误信息

描述

404

ResourceTypeNotFound

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

资源类型不存在。name为资源类型名。