Tous les produits
Search
Centre de documentation

:GetResourceTypeTemplate

Dernière mise à jour :Aug 10, 2026

Génère un exemple de modèle basé sur un type de ressource.

Débogage

OpenAPI Explorer calcule automatiquement la valeur de signature. Pour plus de commodité, nous vous recommandons d'appeler cette opération dans OpenAPI Explorer. OpenAPI Explorer génère dynamiquement l'exemple de code de l'opération pour différents SDK.

Paramètres de requête

Paramètre

Type

Obligatoire

Exemple

Description

Action

String

Oui

GetResourceTypeTemplate

Opération à effectuer. Définissez la valeur sur GetResourceTypeTemplate.

ResourceType

String

Oui

ALIYUN::ECS::VPC

Type de ressource.

Appelez l'opération ListResourceTypes pour interroger le type de ressource.

Paramètres de réponse

Paramètre Type Exemple Description
RequestId String 87F54B2B-AEF0-4C33-A72A-3F8856A575E9

ID de la requête.

TemplateBody Map

Structure contenant le corps du modèle.

La taille du corps du modèle doit être comprise entre 1 et 51 200 octets.

Pour plus d'informations, consultez la syntaxe des modèles.

Exemples

Exemple de requête

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

Exemple de réponse réussie

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

Codes d'erreur

Pour obtenir la liste des codes d'erreur, consultez le Centre d'erreurs.

Code d'état HTTP

Code d'erreur

Message d'erreur

Description

404

ResourceTypeNotFound

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

Le type de ressource spécifié n'existe pas. {name} représente le nom du type de ressource.