Generates a sample template based on a 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 resource type.

You can call the ListResourceTypes operation to query the resource type.

Response parameters

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

The ID of the request.

TemplateBody Map

The structure that contains the template body.

The template body must be 1 to 51,200 bytes in length.

For more information, see Template syntax.

Examples

Sample requests

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

Sample success responses

XML format

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 format

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"
          }
        }
      }
    }
  }
}

Error codes

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

HTTP status code

Error code

Error message

Description

404

ResourceTypeNotFound

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

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