You call this operation to query versions of ECS instance launch templates.

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 ID of the region to which the launch template belongs.

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

LaunchTemplateId String No lt-launchtemplateid1

The ID of the launch template.

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

LaunchTemplateName String No FinanceJoshua

The name of the launch template.

LaunchTemplateVersion.N RepeatList No 1

The version of launch template N.

MinVersion Long No 1

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

MaxVersion Long No 10

The maximum version number when a range is used to specify the launch 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
RequestId String 04F0F334-1335-436C-A1D7-6C044FExxxxx

The ID of the request.

TotalCount Integer 1

The total number of launch templates.

PageNumber Integer 1

The page number of the returned page.

PageSize Integer 10

The number of entries returned per page.

LaunchTemplateVersionSets Array

An array consisting of LaunchTemplateVersionSet data.

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

The time when the launch template was created.

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

The time when the launch template was last modified.

LaunchTemplateId String lt-bp67acfmxazb4ph***

The ID of the launch template.

LaunchTemplateName String FinanceJoshua

The name of the launch template.

DefaultVersion Boolean true

The default version of the launch template.

VersionNumber Long 1

The version number of the launch template.

VersionDescription String InitialVersion

The description of the launch template version.

CreatedBy String 1942111349714***

The creator of the launch template.

LaunchTemplateData Struct

The specific configurations of the launch template.

ImageId String m-bp67acfmxazb4ph***

The ID of the image from which the instance is created.

ImageOwnerAlias String system

The source of the image.

PasswordInherit Boolean true

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

InstanceType String ecs.g5.large

The instance type of the instance.

SecurityGroupId String sg-bp67acfmxazb4ph***

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

VpcId String v-bp67acfmxazb4ph***

The ID of the VPC to which the instance belongs.

VSwitchId String vsw-bp67acfmxazb4ph***

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

InstanceName String FinanceJoshua

The name of the instance.

Description String FinanceDept

The description of the instance.

InternetMaxBandwidthIn Integer 5

The maximum bandwidth of inbound traffic from the Internet.

InternetMaxBandwidthOut Integer 100

The maximum bandwidth of outbound traffic to the Internet.

HostName String JoshuaHost

The hostname of the instance.

ZoneId String cn-hangzhou-g

The zone ID of the instance.

SystemDisk.Size Integer 80

The size of the system disk. Unit: GiB.

SystemDisk.Category String cloud_ssd

The category of the system disk.

SystemDisk.DiskName String FinanceJoshua

The name of the system disk.

SystemDisk.Description String FinanceDept

The description 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.
IoOptimized String none

Indicates whether the instance is I/O optimized.

InstanceChargeType String Postpaid

The billing method of the instance.

Period Integer 1

The subscription period.

InternetChargeType String PayByTraffic

The billing method for network usage.

EnableVmOsConfig Boolean false

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

NetworkType String vpc

The network type.

UserData String SGVsbG9FQ1M=

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

KeyPairName String FinanceJoshuaV25

The name of the key pair.

RamRoleName String FinanceDeptTest

The RAM role name of the instance.

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

The time when the instance was automatically released.

SpotStrategy String NoSpot

The bidding policy of the pay-as-you-go instance.

SpotPriceLimit Float 0.98

The maximum hourly price of the instance.

SpotDuration Integer 1

The protection period of the instance.

ResourceGroupId String rg-bp67acfmxazb4ph***

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

SecurityEnhancementStrategy String active

Indicates whether the security hardening is enabled.

DataDisks Array

An array consisting of DataDisk data.

Size Integer 2000

The size of the data disk.

SnapshotId String s-bp67acfmxazb4ph***

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

Category String cloud_ssd

The category of the data disk.

Encrypted String false

Indicates whether the data disk is encrypted.

DiskName String FinanceJoshua

The name of the data disk.

Description String FinanceDept

The description of the data disk.

DeleteWithInstance Boolean true

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

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.
NetworkInterfaces Array

An array consisting of NetworkInterface data.

PrimaryIpAddress String 203.0.113.2

The primary private IP address of the ENI.

VSwitchId String vsw-bp67acfmxazb4ph***

The ID of the VSwitch to which the ENI belongs.

SecurityGroupId String sg-bp67acfmxazb4ph***

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.

NetworkInterfaceName String FinanceJoshua

The name of the ENI.

Description String FinanceDept

The description of the ENI.

Tags Array

An array consisting of Tag data.

Key String FinanceDept

The key of the tag.

Value String FinanceDeptJoshua

The value of the tag.

Examples

Sample requests

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

Sample success responses

XML format

<DescribeLaunchTemplateVersionsResponse>
      <RequestId>04F0F334-1335-436C-A1D7-6C044FExxxxx</RequestId>
      <TotalCount>1</TotalCount>
      <PageNumber>1</PageNumber>
      <PageSize>10</PageSize>
      <LaunchTemplateVersionSets>
            <LaunchTemplateVersionSet>
                  <CreateTime>2018-05-14T14:18:00Z</CreateTime>
                  <ModifiedTime>2018-05-14T14:18:00Z</ModifiedTime>
                  <LaunchTemplateId>lt-m5e3ofjr1zn1aw7****</LaunchTemplateId>
                  <LaunchTemplateName>wd-1526307480***</LaunchTemplateName>
                  <DefaultVersion>true</DefaultVersion>
                  <VersionNumber>1</VersionNumber>
                  <CreatedBy>1942111349714xxx</CreatedBy>
                  <VersionDescription>wwww</VersionDescription>
                  <launchtemplatedata>
                             <imageowneralias>ImageOwnerAlias1</imageowneralias>
                             <description>Description1</description>
                             <resourcegroupid>ResourceGroupId1</resourcegroupid>
                             <datadisks>
                                   <datadisk>
                                         <snapshotid>SnapshotId1</snapshotid>
                                         <description>Description1</description>
                                         <category>cloud_efficiency</category>
                                         <encrypted>false</encrypted>
                                         <size>44</size>
                                         <deletewithinstance>true</deletewithinstance>
                                         <diskname>DataDiskName1</diskname>
                                   </datadisk>
                             </datadisks>
                             <userdata>UserData1</userdata>
                             <systemdisk.diskname>SystemDiskDiskName1</systemdisk.diskname>
                             <systemdisk.size>44</systemdisk.size>
                             <ramrolename>RamRoleName1</ramrolename>
                             <networktype>NetworkType1</networktype>
                             <networkinterfaces>
                                   <networkinterface>
                                         <description>Description1</description>
                                         <securitygroupid>SecurityGroupId1</securitygroupid>
                                         <vswitchid>VSwitchId1</vswitchid>
                                         <networkinterfacename>NetworkInterfaceName1</networkinterfacename>
                                         <primaryipaddress>PrimaryIpAddress1</primaryipaddress>
                                   </networkinterface>
                             </networkinterfaces>
                             <imageid>windows2008.vhd</imageid>
                             <spotpricelimit>1</spotpricelimit>
                             <systemdisk.category>cloud_efficiency</systemdisk.category>
                             <instancetype>ecs.xn4.small</instancetype>
                             <spotstrategy>SpotWithPriceLimit</spotstrategy>
                             <hostname>HostName1</hostname>
                             <tags>
                                   <instancetag>
                                         <value>bb</value>
                                         <key>ss</key>
                                   </instancetag>
                             </tags>
                             <keypairname>KeyPairName1</keypairname>
                             <systemdisk.iops>22</systemdisk.iops>
                             <iooptimized>true</iooptimized>
                             <zoneid>ZoneId1</zoneid>
                             <systemdisk.description>SystemDiskDescription1</systemdisk.description>
                             <securitygroupid>sg-tiantt****</securitygroupid>
                             <vswitchid>vsw-xxxxxx</vswitchid>
                             <period>1</period>
                             <internetchargetype>PayByBandwidth</internetchargetype>
                             <instancename>InstanceName1</instancename>
                             <internetmaxbandwidthout>20</internetmaxbandwidthout>
                             <internetmaxbandwidthin>1</internetmaxbandwidthin>
                             <securityenhancementstrategy>Active</securityenhancementstrategy>
                             <autoreleasetime>2019-10-21T00:00:00Z</autoreleasetime>
                       </launchtemplatedata>
            </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": "1942111349714xxx",
                "ModifiedTime": "2018-10-17T07:36:22Z",
                "LaunchTemplateData": {
                    "ImageId": "centos_7_04_64_20G_alibase_201701015.vhd",
                    "SecurityGroupId": "sg-bp1azkttqpldxgted***",
                    "Description": "DocV587!",
                    "NetworkInterfaces": {
                        "NetworkInterface": []
                    },
                    "DataDisks": {
                        "DataDisk": []
                    },
                    "SecurityEnhancementStrategy": "Active",
                    "ZoneId": "random",
                    "ImageOwnerAlias": "system",
                    "InternetChargeType": "PayByTraffic",
                    "VSwitchId": "vsw-bp1s5fnvk4gn2tws03***",
                    "VpcId": "vpc-bp1opxu1zkhn00gzv2***",
                    "HostName": "LocalHost",
                    "InstanceType": "ecs.g5.large",
                    "IoOptimized": "true",
                    "Tags": {
                        "InstanceTag": []
                    },
                    "NetworkType": "vpc",
                    "InternetMaxBandwidthOut": 5,
                    "SystemDisk.Size": 40,
                    "InstanceChargeType": "PostPaid",
                    "SystemDisk.Category": "cloud_efficiency",
                    "InstanceName": "JoshuaCentOSPAYG"
                },
                "VersionNumber": 1,
                "DefaultVersion": true,
                "VersionDescription": "EcsV587!",
                "LaunchTemplateName": "JoshuaCentOSPAYG"
            }
        ]
    }
}

Error codes

HTTP status code Error code Error message Description
400 InvalidRegion.NotExist %s The error message returned because the specified region 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 the specified parameter is invalid.
404 InvalidLaunchTemplate.NotFound The specified LaunchTemplate is not found. The error message returned because the specified launch template 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.