Queries the versions of a launch template.

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 DescribeLaunchTemplateVersions

The operation that you want to perform. Set the value to DescribeLaunchTemplateVersions.

RegionId String Yes cn-hangzhou

The region ID of the launch template.

You can call the DescribeRegions operation to query the most recent region list.

LaunchTemplateVersion.N Long No 1

Version N of the launch template.

LaunchTemplateId String No lt-bp168lnahrdwl39p****

The ID of the launch template.

You must set LaunchTemplateId or LaunchTemplateName to specify a launch template.

LaunchTemplateName String No testLaunchTemplateName

The name of the launch template.

MinVersion Long No 1

The minimum version number in the version range to query.

MaxVersion Long No 10

The maximum version number in the version range to query.

DefaultVersion Boolean No true

Specifies whether to query the default version.

DetailFlag Boolean No true

Specifies whether to query the configurations of the launch template. Valid values:

  • true: queries the basic information and other details of the launch template. The details include the image ID and system disk size.
  • false: queries only the basic information of the launch template. The basic information includes the template ID, template name, and default version.

Default value: true.

PageNumber Integer No 1

The number of the page to return.

Pages start from page 1.

Default value: 1.

PageSize Integer No 10

The number of entries to return on each page.

Default value: 10.

Response parameters

Parameter Type Example Description
PageSize Integer 10

The number of entries returned per page.

RequestId String 3989ED0C-20A1-4351-A127-2067FF8390AX

The ID of the request.

PageNumber Integer 1

The page number of the returned page.

TotalCount Integer 1

The total number of launch templates.

LaunchTemplateVersionSets Array of LaunchTemplateVersionSet

Details about the launch template versions.

LaunchTemplateVersionSet
LaunchTemplateName String testLaunchTemplateName

The name of the launch template.

DefaultVersion Boolean true

Indicates whether the launch template version is the default version.

VersionNumber Long 1

The number of the launch template version.

ModifiedTime String 2022-01-17T08:40:00Z

The time when the launch template was modified.

LaunchTemplateId String lt-bp67acfmxazb4p****

The ID of the launch template.

CreateTime String 2022-01-17T08:22:43Z

The time when the launch template was created.

CreatedBy String 123456789****

The creator of the launch template.

VersionDescription String testVersionDescription

The description of the launch template version.

LaunchTemplateData Object

The configurations of the launch template.

DeploymentSetId String ds-bp1brhwhoqinyjd6****

The ID of the deployment set.

VpcId String v-bp67acfmxazb4p****

The ID of the virtual private cloud (VPC).

SystemDisk.PerformanceLevel String PL0

The performance level of the enhanced SSD (ESSD) to use as the system disk. Default value: PL0. Valid values:

  • PL0: A single ESSD can deliver up to 10,000 random read/write IOPS.
  • PL1: A single ESSD can deliver up to 50,000 random read/write IOPS.
  • PL2: A single ESSD can deliver up to 100,000 random read/write IOPS.
  • PL3: A single ESSD can deliver up to 1,000,000 random read/write IOPS.

For more information about ESSD performance levels, see ESSDs.

KeyPairName String testKeyPairName

The name of the key pair.

SecurityGroupId String sg-bp67acfmxazb4p****

The ID of the security group to which to assign the instance.

Note The SecurityGroupId and SecurityGroupIds parameters are mutually exclusive in the response.
NetworkType String vpc

The network type. Valid values:

  • classic: classic network
  • vpc: VPC
SpotStrategy String NoSpot

The bidding policy for the pay-as-you-go instance. Valid values:

  • NoSpot: The instance is created as a regular pay-as-you-go instance.
  • SpotWithPriceLimit: The instance is created as a preemptible instance with a user-defined maximum hourly price.
  • SpotAsPriceGo: The instance is created as a preemptible instance for which the market price at the time of purchase is automatically used as the bid price.
EnableVmOsConfig Boolean false

Indicates whether to enable the operating system configuration of the instance.

Description String testInstanceDescription

The description of the instance.

SpotDuration Integer 1

The protection period of the preemptible instance. Unit: hours. Valid values: 0, 1, 2, 3, 4, 5, and 6.

Take note of the following items:

  • The following protection periods are in invitational preview: 2, 3, 4, 5, and 6 hours. If you want to set this parameter to one of these values, submit a ticket.
  • A value of 0 indicates that no protection period is configured for the preemptible instance.
InstanceName String testInstanceName

The name of the instance.

SecurityEnhancementStrategy String active

Indicates whether to enable security hardening.

UserData String SGVsbG9FQ1M=

The user data of the instance, which is Base64-encoded.

SystemDisk.DiskName String testSystemDiskName

The name of the system disk.

SystemDisk.Size Integer 40

The size of the system disk. Unit: GiB.

SpotPriceLimit Float 0.98

The maximum hourly price of the preemptible instance.

PasswordInherit Boolean true

Indicates whether to use the password preset in the image.

PrivateIpAddress String 10.1.**.**

The private IP address to assign to the instance.

ImageId String m-bp67acfmxazb4p****

The ID of the image.

SystemDisk.DeleteWithInstance Boolean true

Indicates whether to release the system disk when the instance is released. Valid values:

  • true: releases the system disk when the instance is released.
  • false: does not release the system disk when the instance is released.
SystemDisk.Category String cloud_ssd

The category of the system disk. Valid values:

  • cloud: basic disk.
  • cloud_efficiency: ultra disk.
  • cloud_ssd: standard SSD.
  • cloud_essd: ESSD. You can use the SystemDisk.PerformanceLevel parameter to set the performance level of the ESSD to use as the system disk.

For non-I/O optimized instances of retired instance types, the default value is cloud. For other instances, the default value is cloud_efficiency.

AutoReleaseTime String 2018-05-14T14:18:00Z

The automatic release time of the instance.

SystemDisk.Description String testSystemDiskDescription

The description of the system disk.

ImageOwnerAlias String system

The source of the image. Valid values:

  • system: public images provided by Alibaba Cloud
  • self: custom images that you create
  • others: shared images from other Alibaba Cloud accounts
  • marketplace: Alibaba Cloud Marketplace images
HostName String testHostName

The hostname of the instance.

SystemDisk.Iops Integer 101800

The number of IOPS on the system disk.

SystemDisk.AutoSnapshotPolicyId String sp-bp1j0alc2z1fhvie****

The ID of the automatic snapshot policy.

InternetMaxBandwidthOut Integer 100

The maximum outbound public bandwidth.

InternetMaxBandwidthIn Integer 5

The maximum inbound public bandwidth.

InstanceType String ecs.g5.large

The instance type.

Period Integer 1

The subscription duration.

InstanceChargeType String Postpaid

The billing method of the instance. Valid values:

  • PrePaid: subscription
  • PostPaid: pay-as-you-go
IoOptimized String none

Indicates whether the instance is I/O optimized.

RamRoleName String testRamRoleName

The name of the instance RAM role.

VSwitchId String vsw-bp67acfmxazb4p****

The ID of the vSwitch to which to connect the instance.

ResourceGroupId String rg-bp67acfmxazb4p****

The ID of the resource group to which the launch template belongs.

InternetChargeType String PayByTraffic

The billing method for network usage.

ZoneId String cn-hangzhou-g

The ID of the zone.

Ipv6AddressCount Integer 1

The number of IPv6 addresses to assign to the instance.

DataDisks Array of DataDisk

Details about the data disks.

DataDisk
PerformanceLevel String PL1

The performance level of ESSD to use as the data disk. This parameter is returned only when tne value of Category is cloud_essd. Valid values:

  • PL0: A single ESSD can deliver up to 10,000 random read/write IOPS.
  • PL1: A single ESSD can deliver up to 50,000 random read/write IOPS.
  • PL2: A single ESSD can deliver up to 100,000 random read/write IOPS.
  • PL3: A single ESSD can deliver up to 1,000,000 random read/write IOPS.
Description String testDiskDescription

The description of the data disk.

SnapshotId String s-bp67acfmxazb4p****

The ID of the snapshot to use to create the data disk.

Device String /dev/xvda

The device name of the data disk.

Note This parameter will be removed in the future. We recommend that you use other parameters to ensure future compatibility.
Size Integer 2000

The size of the data disk.

DiskName String testDiskName

The name of the data disk.

Category String cloud_ssd

The category of the data disk.

DeleteWithInstance Boolean true

Indicates whether to release the data disk when the instance is released.

Encrypted String false

Indicates whether to encrypt the data disk.

ProvisionedIops Long 50000

The provisioned read/write IOPS of the ESSD AutoPL disk. Valid values: 0 to min{50,000, 1,000 × Capacity - Baseline IOPS}

Baseline IOPS = min{1,800 + 50 × Capacity, 50,000}

Note This parameter is available only if the corresponding disk category parameter is set to cloud_auto. For more information, see ESSD AutoPL disks and Modify the performance configurations of an ESSD AutoPL disk.
BurstingEnabled Boolean true

Indicates whether to enable the performance burst feature. Valid values:

  • true: enables the performance burst feature.
  • false: does not enable the performance burst feature.
AutoSnapshotPolicyId String sp-wz91dz3ghear2a5s****

The ID of the automatic snapshot policy.

NetworkInterfaces Array of NetworkInterface

Details about the secondary elastic network interfaces (ENIs).

NetworkInterface
NetworkInterfaceName String testNetworkInterfaceName

The name of the secondary ENI.

VSwitchId String vsw-bp67acfmxazb4p****

The ID of the vSwitch to which to connect the secondary ENI.

Description String testNetworkInterfacesDescription

The description of the secondary ENI.

PrimaryIpAddress String 203.0.*.*

The primary private IP address of the secondary ENI.

SecurityGroupId String sg-bp67acfmxazb4p****

The ID of the security group to which to assign the secondary ENI. The security group and the ENI must belong to the same VPC.

Note The SecurityGroupId and SecurityGroupIds parameters are mutually exclusive in the response.
SecurityGroupIds Array of String ["sg-bp15ed6xe1yxeycg7****"]

The IDs of the security groups to which to assign the secondary ENI.

Note The SecurityGroupId and SecurityGroupIds parameters are mutually exclusive in the response.
InstanceType String ecs.s2.xlarge

The instance type.

NetworkInterfaceTrafficMode String Standard

The communication mode of the primary ENI. Valid values:

  • Standard: uses the TCP communication mode.
  • HighPerformance: enables Elastic RDMA Interface (ERI) and uses the remote direct memory access (RDMA) communication mode.
Tags Array of InstanceTag

The tags to add to the instance.

InstanceTag
Key String TestKey

The key of the tag to add to the instance.

Value String TestValue

The value of the tag to add to the instance.

SecurityGroupIds Array of String ["sg-bp15ed6xe1yxeycg7****"]

The IDs of the security groups to which to assign the instance.

Note The SecurityGroupId and SecurityGroupIds parameters are mutually exclusive in the response.
SystemDisk.ProvisionedIops Long 50000

The provisioned read/write IOPS of the ESSD AutoPL disk. Valid values: 0 to min{50,000, 1,000 × Capacity - Baseline IOPS}

Baseline IOPS = min{1,800 + 50 × Capacity, 50,000}

Note This parameter is available only if the corresponding disk category parameter is set to cloud_auto. For more information, see ESSD AutoPL disks and Modify the performance configurations of an ESSD AutoPL disk.
SystemDisk.BurstingEnabled Boolean true

Indicates whether to enable the performance burst feature. Valid values:

  • true: enables the performance burst feature.
  • false: does not enable the performance burst feature.

Examples

Sample requests

http(s)://ecs.aliyuncs.com/?Action=DescribeLaunchTemplateVersions
&RegionId=cn-hangzhou
&LaunchTemplateId=lt-bp168lnahrdwl39p****
&Common request parameters

Sample success responses

XML format

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

<DescribeLaunchTemplateVersionsResponse>
    <PageSize>10</PageSize>
    <RequestId>3989ED0C-20A1-4351-A127-2067FF8390AX</RequestId>
    <PageNumber>1</PageNumber>
    <TotalCount>1</TotalCount>
    <LaunchTemplateVersionSets>
        <LaunchTemplateName>testLaunchTemplateName</LaunchTemplateName>
        <DefaultVersion>true</DefaultVersion>
        <VersionNumber>1</VersionNumber>
        <ModifiedTime>2022-01-17T08:40:00Z</ModifiedTime>
        <LaunchTemplateId>lt-bp67acfmxazb4p****</LaunchTemplateId>
        <CreateTime>2022-01-17T08:22:43Z</CreateTime>
        <CreatedBy>123456789****</CreatedBy>
        <VersionDescription>testVersionDescription</VersionDescription>
        <LaunchTemplateData>
            <DeploymentSetId>ds-bp1brhwhoqinyjd6****</DeploymentSetId>
            <VpcId>v-bp67acfmxazb4p****</VpcId>
            <SystemDisk.PerformanceLevel>PL0</SystemDisk.PerformanceLevel>
            <KeyPairName>testKeyPairName</KeyPairName>
            <SecurityGroupId>sg-bp67acfmxazb4p****</SecurityGroupId>
            <NetworkType>vpc</NetworkType>
            <SpotStrategy>NoSpot</SpotStrategy>
            <EnableVmOsConfig>false</EnableVmOsConfig>
            <Description>testInstanceDescription</Description>
            <SpotDuration>1</SpotDuration>
            <InstanceName>testInstanceName</InstanceName>
            <SecurityEnhancementStrategy>active</SecurityEnhancementStrategy>
            <UserData>SGVsbG9FQ1M=</UserData>
            <SystemDisk.DiskName>testSystemDiskName</SystemDisk.DiskName>
            <SystemDisk.Size>40</SystemDisk.Size>
            <SpotPriceLimit>0.98</SpotPriceLimit>
            <PasswordInherit>true</PasswordInherit>
            <PrivateIpAddress>10.1.**.**</PrivateIpAddress>
            <ImageId>m-bp67acfmxazb4p****</ImageId>
            <SystemDisk.DeleteWithInstance>true</SystemDisk.DeleteWithInstance>
            <SystemDisk.Category>cloud_ssd</SystemDisk.Category>
            <AutoReleaseTime>2018-05-14T14:18:00Z</AutoReleaseTime>
            <SystemDisk.Description>testSystemDiskDescription</SystemDisk.Description>
            <ImageOwnerAlias>system</ImageOwnerAlias>
            <HostName>testHostName</HostName>
            <SystemDisk.Iops>101800</SystemDisk.Iops>
            <InternetMaxBandwidthOut>100</InternetMaxBandwidthOut>
            <InternetMaxBandwidthIn>5</InternetMaxBandwidthIn>
            <InstanceType>ecs.g5.large</InstanceType>
            <Period>1</Period>
            <InstanceChargeType>Postpaid</InstanceChargeType>
            <IoOptimized>none</IoOptimized>
            <RamRoleName>testRamRoleName</RamRoleName>
            <VSwitchId>vsw-bp67acfmxazb4p****</VSwitchId>
            <ResourceGroupId>rg-bp67acfmxazb4p****</ResourceGroupId>
            <InternetChargeType>PayByTraffic</InternetChargeType>
            <ZoneId>cn-hangzhou-g</ZoneId>
            <Ipv6AddressCount>1</Ipv6AddressCount>
            <DataDisks>
                <PerformanceLevel>PL1</PerformanceLevel>
                <Description>testDiskDescription</Description>
                <SnapshotId>s-bp67acfmxazb4p****</SnapshotId>
                <Device>/dev/xvda</Device>
                <Size>2000</Size>
                <DiskName>testDiskName</DiskName>
                <Category>cloud_ssd</Category>
                <DeleteWithInstance>true</DeleteWithInstance>
                <Encrypted>false</Encrypted>
            </DataDisks>
            <NetworkInterfaces>
                <NetworkInterfaceName>testNetworkInterfaceName</NetworkInterfaceName>
                <VSwitchId>vsw-bp67acfmxazb4p****</VSwitchId>
                <Description>testNetworkInterfacesDescription</Description>
                <PrimaryIpAddress>203.0.*.*</PrimaryIpAddress>
                <SecurityGroupId>sg-bp67acfmxazb4p****</SecurityGroupId>
                <SecurityGroupIds>["sg-bp15ed6xe1yxeycg7****"]</SecurityGroupIds>
            </NetworkInterfaces>
            <Tags>
                <Key>TestKey</Key>
                <Value>TestValue</Value>
            </Tags>
            <SecurityGroupIds>["sg-bp15ed6xe1yxeycg7****"]</SecurityGroupIds>
        </LaunchTemplateData>
    </LaunchTemplateVersionSets>
</DescribeLaunchTemplateVersionsResponse>

JSON format

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

{
  "PageSize" : 10,
  "RequestId" : "3989ED0C-20A1-4351-A127-2067FF8390AX",
  "PageNumber" : 1,
  "TotalCount" : 1,
  "LaunchTemplateVersionSets" : [ {
    "LaunchTemplateName" : "testLaunchTemplateName",
    "DefaultVersion" : true,
    "VersionNumber" : 1,
    "ModifiedTime" : "2022-01-17T08:40:00Z",
    "LaunchTemplateId" : "lt-bp67acfmxazb4p****",
    "CreateTime" : "2022-01-17T08:22:43Z",
    "CreatedBy" : "123456789****",
    "VersionDescription" : "testVersionDescription",
    "LaunchTemplateData" : {
      "DeploymentSetId" : "ds-bp1brhwhoqinyjd6****",
      "VpcId" : "v-bp67acfmxazb4p****",
      "SystemDisk.PerformanceLevel" : "PL0",
      "KeyPairName" : "testKeyPairName",
      "SecurityGroupId" : "sg-bp67acfmxazb4p****",
      "NetworkType" : "vpc",
      "SpotStrategy" : "NoSpot",
      "EnableVmOsConfig" : false,
      "Description" : "testInstanceDescription",
      "SpotDuration" : 1,
      "InstanceName" : "testInstanceName",
      "SecurityEnhancementStrategy" : "active",
      "UserData" : "SGVsbG9FQ1M=",
      "SystemDisk.DiskName" : "testSystemDiskName",
      "SystemDisk.Size" : 40,
      "SpotPriceLimit" : 0.98,
      "PasswordInherit" : true,
      "PrivateIpAddress" : "10.1.**.**",
      "ImageId" : "m-bp67acfmxazb4p****",
      "SystemDisk.DeleteWithInstance" : true,
      "SystemDisk.Category" : "cloud_ssd",
      "AutoReleaseTime" : "2018-05-14T14:18:00Z",
      "SystemDisk.Description" : "testSystemDiskDescription",
      "ImageOwnerAlias" : "system",
      "HostName" : "testHostName",
      "SystemDisk.Iops" : 101800,
      "InternetMaxBandwidthOut" : 100,
      "InternetMaxBandwidthIn" : 5,
      "InstanceType" : "ecs.g5.large",
      "Period" : 1,
      "InstanceChargeType" : "Postpaid",
      "IoOptimized" : "none",
      "RamRoleName" : "testRamRoleName",
      "VSwitchId" : "vsw-bp67acfmxazb4p****",
      "ResourceGroupId" : "rg-bp67acfmxazb4p****",
      "InternetChargeType" : "PayByTraffic",
      "ZoneId" : "cn-hangzhou-g",
      "Ipv6AddressCount" : 1,
      "DataDisks" : [ {
        "PerformanceLevel" : "PL1",
        "Description" : "testDiskDescription",
        "SnapshotId" : "s-bp67acfmxazb4p****",
        "Device" : "/dev/xvda",
        "Size" : 2000,
        "DiskName" : "testDiskName",
        "Category" : "cloud_ssd",
        "DeleteWithInstance" : true,
        "Encrypted" : "false"
      } ],
      "NetworkInterfaces" : [ {
        "NetworkInterfaceName" : "testNetworkInterfaceName",
        "VSwitchId" : "vsw-bp67acfmxazb4p****",
        "Description" : "testNetworkInterfacesDescription",
        "PrimaryIpAddress" : "203.0.*.*",
        "SecurityGroupId" : "sg-bp67acfmxazb4p****",
        "SecurityGroupIds" : [ "[\"sg-bp15ed6xe1yxeycg7****\"]" ]
      } ],
      "Tags" : [ {
        "Key" : "TestKey",
        "Value" : "TestValue"
      } ],
      "SecurityGroupIds" : [ "[\"sg-bp15ed6xe1yxeycg7****\"]" ]
    }
  } ]
}

Error codes

HTTP status code Error code Error message Description
400 InvalidRegion.NotExist %s The error message returned because the specified RegionId parameter does not exist.
400 MissingParameter %s The error message returned because a required parameter is not specified.
400 InvalidParameter %s The error message returned because a specified parameter is invalid.
403 InnerServiceFailed %s The error message returned because an internal service cannot be called.
404 InvalidLaunchTemplate.NotFound The specified LaunchTemplate is not found. The error message returned because the specified launch template does not exist.

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