You call this operation to query versions of an ECS instance 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.

LaunchTemplateId String No lt-bp168lnahrdwl39p****

The ID of the launch template.

You must specify LaunchTemplateId or LaunchTemplateName to determine a specific launch template.

LaunchTemplateName String No testLaunchTemplateName

The name of the launch template.

LaunchTemplateVersion.N RepeatList No 1

The version N of the launch template.

MinVersion Long No 1

The minimum version number when a range is used to specify the template.

MaxVersion Long No 10

The maximum version number when a range is used to specify the template.

DefaultVersion Boolean No true

Specifies whether to query the default version.

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
LaunchTemplateVersionSets Array of LaunchTemplateVersionSet

Details about the launch template versions.

LaunchTemplateVersionSet
CreateTime String 2018-05-14T14:18:00Z

The time when the launch template was created.

CreatedBy String 1234567890

The creator of the launch template.

DefaultVersion Boolean true

The default version of the launch template.

LaunchTemplateData Struct

The specific configurations of the launch template.

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

The time when the instance is automatically released.

DataDisks Array of DataDisk

Details about the data disks.

DataDisk
Category String cloud_ssd

The category of the data disk.

DeleteWithInstance Boolean true

Indicates whether the data disk is released together with the instance.

Description String testDiskDescription

The description of 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 compatibility.
DiskName String testDiskName

The name of the data disk.

Encrypted String false

Indicates whether the data disk is encrypted.

Size Integer 2000

The size of the data disk.

SnapshotId String s-bp67acfmxazb4p****

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

Description String testInstanceDescription

The description of the instance.

EnableVmOsConfig Boolean false

Indicates whether the operating system configuration of the instance is enabled.

HostName String testHostName

The hostname of the instance.

ImageId String m-bp67acfmxazb4p****

The ID of the image used to create the instance.

ImageOwnerAlias String system

The source of the image.

InstanceChargeType String Postpaid

The billing method of the instance.

InstanceName String testInstanceName

The name of the instance.

InstanceType String ecs.g5.large

The instance type of the instance.

InternetChargeType String PayByTraffic

The billing method for network usage.

InternetMaxBandwidthIn Integer 5

The maximum inbound public bandwidth.

InternetMaxBandwidthOut Integer 100

The maximum outbound public bandwidth.

IoOptimized String none

Indicates whether the instance is I/O optimized.

KeyPairName String testKeyPairName

The name of the key pair.

NetworkInterfaces Array of NetworkInterface

Details about the elastic network interfaces (ENIs).

NetworkInterface
Description String testNetworkInterfacesDescription

The description of the ENI.

NetworkInterfaceName String testNetworkInterfaceName

The name of the ENI.

PrimaryIpAddress String 203.0.113.2

The primary private IP address of the ENI.

SecurityGroupId String sg-bp67acfmxazb4p****

The ID of the security group to which the ENI belongs. The security group of the ENI must be within the same VPC as that of the instance.

VSwitchId String vsw-bp67acfmxazb4p****

The ID of the VSwitch to which the ENI is connected.

NetworkType String vpc

The network type.

PasswordInherit Boolean true

Indicates whether the username and password pair of the original image is used.

Period Integer 1

The subscription period.

RamRoleName String testRamRoleName

The RAM role name of the instance.

ResourceGroupId String rg-bp67acfmxazb4p****

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

SecurityEnhancementStrategy String active

Indicates whether security hardening is enabled.

SecurityGroupId String sg-bp67acfmxazb4p****

The ID of the security group.

SpotDuration Integer 1

The protection period of the preemptible instance. Unit: hours. Valid values: 0 to 6.

  • Protection periods of two to six hours are in invitational preview. If you want to set the protection period value to one of these values, submit a ticket.
  • A value of 0 indicates that no protection period is configured for the preemptible instance.
SpotPriceLimit Float 0.98

The maximum hourly price of the preemptible instance.

SpotStrategy String NoSpot

The bidding policy of the preemptible instance.

SystemDisk.Category String cloud_ssd

The category of the system disk.

SystemDisk.Description String testSystemDiskDescription

The description of the system disk.

SystemDisk.DiskName String testSystemDiskName

The name of the system disk.

SystemDisk.Iops Integer 30000

The number of I/O operations per second of the system disk.

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

The size of the system disk. Unit: GiB.

Tags Array of InstanceTag

Details about the tags of the instance.

InstanceTag
Key String TestKey

The tag key of the instance.

Value String TestValue

The tag value of the instance.

UserData String SGVsbG9FQ1M=

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

VSwitchId String vsw-bp67acfmxazb4p****

The ID of the VSwitch that is in the VPC to which the instance belongs.

VpcId String v-bp67acfmxazb4p****

The ID of the VPC.

ZoneId String cn-hangzhou-g

The zone ID of the instance.

LaunchTemplateId String lt-bp67acfmxazb4p****

The ID of the launch template.

LaunchTemplateName String testLaunchTemplateName

The name of the launch template.

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

The time when the launch template was modified.

VersionDescription String testVersionDescription

The description of the launch template version.

VersionNumber Long 1

The version number of the launch template.

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

The ID of the request.

PageSize Integer 10

The number of entries returned per page.

PageNumber Integer 1

The page number of the returned page.

TotalCount Integer 1

The total number of launch templates.

Examples

Sample requests

https://ecs.aliyuncs.com/?Action=DescribeLaunchTemplateVersions
&RegionId=cn-hangzhou
&LaunchTemplateName=lt-bp168lnahrdwl39p****
&<Common request parameters>

Sample success responses

XML format

<DescribeLaunchTemplateVersionsResponse>
      <PageNumber>1</PageNumber>
      <TotalCount>1</TotalCount>
      <PageSize>10</PageSize>
      <RequestId>3989ED0C-20A1-4351-A127-2067FF8390AX</RequestId>
      <LaunchTemplateVersionSets>
            <LaunchTemplateVersionSet>
                  <LaunchTemplateId>lt-bp16jovvln1cgaaqg****</LaunchTemplateId>
                  <CreateTime>2018-10-17T07:36:22Z</CreateTime>
                  <CreatedBy>1234567890</CreatedBy>
                  <ModifiedTime>2018-10-17T07:36:22Z</ModifiedTime>
                  <LaunchTemplateData>
                        <ImageId>centos_7_04_64_20G_alibase_201701015.vhd</ImageId>
                        <SecurityGroupId>sg-bp1azkttqpldxgte****</SecurityGroupId>
                        <Description>testDescription</Description>
                        <NetworkInterfaces>
                </NetworkInterfaces>
                        <DataDisks>
                </DataDisks>
                        <SecurityEnhancementStrategy>Active</SecurityEnhancementStrategy>
                        <ZoneId>random</ZoneId>
                        <ImageOwnerAlias>system</ImageOwnerAlias>
                        <InternetChargeType>PayByTraffic</InternetChargeType>
                        <VSwitchId>vsw-bp1s5fnvk4gn2tws0****</VSwitchId>
                        <VpcId>vpc-bp1opxu1zkhn00gzv****</VpcId>
                        <HostName>LocalHost</HostName>
                        <InstanceType>ecs.g5.large</InstanceType>
                        <IoOptimized>true</IoOptimized>
                        <Tags>
                </Tags>
                        <NetworkType>vpc</NetworkType>
                        <InternetMaxBandwidthOut>5</InternetMaxBandwidthOut>
                        <SystemDisk.Size>40</SystemDisk.Size>
                        <InstanceChargeType>PostPaid</InstanceChargeType>
                        <SystemDisk.Category>cloud_efficiency</SystemDisk.Category>
                        <InstanceName>testInstanceName</InstanceName>
                  </LaunchTemplateData>
                  <VersionNumber>1</VersionNumber>
                  <DefaultVersion>true</DefaultVersion>
                  <VersionDescription>testVersionDescription</VersionDescription>
                  <LaunchTemplateName>testLaunchTemplateName</LaunchTemplateName>
            </LaunchTemplateVersionSet>
      </LaunchTemplateVersionSets>
</DescribeLaunchTemplateVersionsResponse>

JSON format

{
    "PageNumber": 1,
    "TotalCount": 1,
    "PageSize": 10,
    "RequestId": "3989ED0C-20A1-4351-A127-2067FF8390AX",
    "LaunchTemplateVersionSets": {
        "LaunchTemplateVersionSet": [
            {
                "LaunchTemplateId": "lt-bp16jovvln1cgaaqg****",
                "CreateTime": "2018-10-17T07:36:22Z",
                "CreatedBy": "1234567890",
                "ModifiedTime": "2018-10-17T07:36:22Z",
                "LaunchTemplateData": {
                    "ImageId": "centos_7_04_64_20G_alibase_201701015.vhd",
                    "SecurityGroupId": "sg-bp1azkttqpldxgte****",
                    "Description": "testDescription",
                    "NetworkInterfaces": {
                        "NetworkInterface": []
                    },
                    "DataDisks": {
                        "DataDisk": []
                    },
                    "SecurityEnhancementStrategy": "Active",
                    "ZoneId": "random",
                    "ImageOwnerAlias": "system",
                    "InternetChargeType": "PayByTraffic",
                    "VSwitchId": "vsw-bp1s5fnvk4gn2tws0****",
                    "VpcId": "vpc-bp1opxu1zkhn00gzv****",
                    "HostName": "LocalHost",
                    "InstanceType": "ecs.g5.large",
                    "IoOptimized": "true",
                    "Tags": {
                        "InstanceTag": []
                    },
                    "NetworkType": "vpc",
                    "InternetMaxBandwidthOut": 5,
                    "SystemDisk.Size": 40,
                    "InstanceChargeType": "PostPaid",
                    "SystemDisk.Category": "cloud_efficiency",
                    "InstanceName": "testInstanceName"
                },
                "VersionNumber": 1,
                "DefaultVersion": true,
                "VersionDescription": "testVersionDescription",
                "LaunchTemplateName": "testLaunchTemplateName"
            }
        ]
    }
}

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. Check whether the region ID is correct.
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.
404 InvalidLaunchTemplate.NotFound The specified LaunchTemplate is not found. The error message returned because the specified LaunchTemplateId parameter does not exist.
403 InnerServiceFailed %s The error message returned because an internal service failed to be called.

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