All Products
Search
Document Center

:GetResourceTypeTemplate

Last Updated:May 29, 2026

Menghasilkan templat contoh berdasarkan tipe resource.

Debugging

OpenAPI Explorer secara otomatis menghitung nilai signature. Untuk kenyamanan Anda, kami menyarankan agar Anda memanggil operasi ini di OpenAPI Explorer. OpenAPI Explorer secara dinamis menghasilkan kode contoh operasi untuk berbagai SDK.

Parameter permintaan

Parameter Tipe Wajib Contoh Deskripsi
Action String Ya GetResourceTypeTemplate

Operasi yang ingin Anda lakukan. Tetapkan nilainya ke GetResourceTypeTemplate.

ResourceType String Ya ALIYUN::ECS::VPC

Tipe resource.

Anda dapat memanggil operasi ListResourceTypes untuk menanyakan tipe resource.

Parameter respons

Parameter Tipe Contoh Deskripsi
RequestId String 87F54B2B-AEF0-4C33-A72A-3F8856A575E9

ID permintaan.

TemplateBody Map

Struktur yang berisi isi templat.

Isi templat harus memiliki panjang 1 hingga 51.200 byte.

Untuk informasi selengkapnya, lihat Sintaks templat.

Contoh

Permintaan Contoh

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

Respons Sukses Contoh

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

Kode kesalahan

Untuk daftar kode kesalahan, kunjungi Error Center.

Kode status HTTP

Kode kesalahan

Pesan kesalahan

Deskripsi

404

ResourceTypeNotFound

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

Pesan kesalahan yang dikembalikan karena tipe resource yang ditentukan tidak ada. name menunjukkan nama tipe resource tersebut.