Todos los productos
Search
Centro de documentos

:GetResourceTypeTemplate

Última actualización: Sep 05, 2026

Genera una plantilla de ejemplo basada en un tipo de recurso.

Depuración

OpenAPI Explorer calcula automáticamente el valor de la firma. Para su comodidad, le recomendamos que llame a esta operación en OpenAPI Explorer. OpenAPI Explorer genera dinámicamente el código de ejemplo de la operación para diferentes SDK.

Parámetros de solicitud

Parámetro

Tipo

Obligatorio

Ejemplo

Descripción

Action

String

Sí

GetResourceTypeTemplate

La operación que desea ejecutar. Establezca el valor en GetResourceTypeTemplate.

ResourceType

String

Sí

ALIYUN::ECS::VPC

El tipo de recurso.

Puede llamar a la operación ListResourceTypes para consultar el tipo de recurso.

Parámetros de respuesta

Parámetro Tipo Ejemplo Descripción
RequestId String 87F54B2B-AEF0-4C33-A72A-3F8856A575E9

El ID de la solicitud.

TemplateBody Map

La estructura que contiene el cuerpo de la plantilla.

El cuerpo de la plantilla debe tener una longitud de 1 a 51,200 bytes.

Para obtener más información, consulte Sintaxis de plantillas.

Ejemplos

Solicitudes de ejemplo

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

Respuestas exitosas de ejemplo

Formato 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>

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

Códigos de error

Para obtener una lista de códigos de error, visite el Centro de errores.

Código de estado HTTP

Código de error

Mensaje de error

Descripción

404

ResourceTypeNotFound

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

Mensaje de error que indica que el tipo de recurso especificado no existe. name es el nombre del tipo de recurso.