All Products
Search
Document Center

Elastic Compute Service:DescribeLaunchTemplateVersions

Last Updated:Dec 16, 2024

Queries the information of launch template versions, such as the total number of launch templates, launch template names, and launch template version numbers.

Operation description

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ecs:DescribeLaunchTemplateVersionsget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the launch template.

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

cn-hangzhou
LaunchTemplateVersionarrayNo

The versions of the launch template.

longNo

Version N of the launch template.

1
LaunchTemplateIdstringNo

The ID of the launch template.

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

lt-bp168lnahrdwl39p****
LaunchTemplateNamestringNo

The name of the launch template.

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

testLaunchTemplateName
MinVersionlongNo

The minimum version number in the version range to query. This parameter is used together with MaxVersion to specify a version range to query.

1
MaxVersionlongNo

The maximum version number in the version range to query. This parameter is used together with MinVersion to specify a version range to query.

10
DefaultVersionbooleanNo

Specifies whether to query the default version.

true
DetailFlagbooleanNo

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.

true
PageNumberintegerNo

The number of the page to return.

Pages start from page 1.

Default value: 1.

1
PageSizeintegerNo

The number of entries to return on each page.

Default value: 10.

10

Response parameters

ParameterTypeDescriptionExample
object

The response.

PageSizeinteger

The number of entries returned per page.

10
RequestIdstring

The ID of the request.

3989ED0C-20A1-4351-A127-2067FF8390AX
PageNumberinteger

The page number of the returned page.

1
TotalCountinteger

The total number of launch templates.

1
LaunchTemplateVersionSetsarray<object>

Details about the launch template versions.

LaunchTemplateVersionSetobject

Details about the launch template version.

LaunchTemplateNamestring

The name of the launch template.

testLaunchTemplateName
DefaultVersionboolean

Indicates whether the launch template version is the default version.

true
VersionNumberlong

The number of the launch template version.

1
ModifiedTimestring

The time when the launch template version was modified.

2022-01-17T08:40:00Z
LaunchTemplateIdstring

The ID of the launch template.

lt-bp67acfmxazb4p****
CreateTimestring

The time when the launch template version was created.

2022-01-17T08:22:43Z
CreatedBystring

The ID of the Alibaba Cloud account that created the launch template.

123456789****
VersionDescriptionstring

The description of the launch template version.

testVersionDescription
LaunchTemplateDataobject

The configurations of the launch template.

DeploymentSetIdstring

The ID of the deployment set.

ds-bp1brhwhoqinyjd6****
VpcIdstring

The ID of the virtual private cloud (VPC).

v-bp67acfmxazb4p****
SystemDisk.PerformanceLevelstring

The performance level of the Enterprise 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 information about ESSD performance levels, see ESSDs .

PL0
KeyPairNamestring

The name of the key pair.

testKeyPairName
SecurityGroupIdstring

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

Note SecurityGroupId and SecurityGroupIds are mutually exclusive in the response.
sg-bp67acfmxazb4p****
NetworkTypestring

The network type. Valid values:

  • classic: classic network
  • vpc: VPC
vpc
SpotStrategystring

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

  • NoSpot: The instance is a regular pay-as-you-go instance.
  • SpotWithPriceLimit: The instance is a preemptible instance with a user-defined maximum hourly price.
  • SpotAsPriceGo: The instance is a preemptible instance for which the market price at the time of purchase is automatically used as the bid price. The market price can be up to the pay-as-you-go price.
NoSpot
EnableVmOsConfigboolean

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

false
Descriptionstring

The description of the system disk.

testInstanceDescription
SpotDurationinteger

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

  • 1: After a preemptible instance is created, Alibaba Cloud ensures that the instance is not automatically released within 1 hour. After the 1-hour protection period ends, the system compares the bid price with the market price and checks the resource inventory to determine whether to retain or release the instance.
  • 0: After a preemptible instance is created, Alibaba Cloud does not ensure that the instance runs for 1 hour. The system compares the bid price with the market price and checks the resource inventory to determine whether to retain or release the instance.

Alibaba Cloud sends an ECS system event to notify you 5 minutes before the instance is released. Preemptible instances are billed by second. We recommend that you specify a protection period based on your business requirements.

Note This parameter is returned when SpotStrategy is set to SpotWithPriceLimit or SpotAsPriceGo.
1
InstanceNamestring

The name of the instance.

testInstanceName
SecurityEnhancementStrategystring

Indicates whether Security Hardening is enabled.

active
UserDatastring

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

SGVsbG9FQ1M=
SystemDisk.DiskNamestring

The name of the system disk.

testSystemDiskName
SystemDisk.Sizeinteger

The size of the system disk. Unit: GiB.

40
SpotPriceLimitfloat

The maximum hourly price of the preemptible instance.

0.98
PasswordInheritboolean

Indicates whether the username and password preset in the image are used.

true
PrivateIpAddressstring

The private IP address to assign to the instance.

10.1.**.**
ImageIdstring

The ID of the image.

m-bp67acfmxazb4p****
SystemDisk.DeleteWithInstanceboolean

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

  • true
  • false
true
SystemDisk.Categorystring

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 SystemDisk.PerformanceLevel to set the performance level of the ESSD used as the system disk.

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

cloud_ssd
AutoReleaseTimestring

The automatic release time of the instance.

2018-05-14T14:18:00Z
SystemDisk.Descriptionstring

The description of the system disk.

testSystemDiskDescription
ImageOwnerAliasstring

The source of the image. Valid values:

  • system: public image provided by Alibaba Cloud
  • self: custom image that you created
  • others: shared image from another Alibaba Cloud account
  • marketplace: Alibaba Cloud Marketplace image
system
HostNamestring

The hostname of the instance.

testHostName
SystemDisk.Iopsinteger

The number of IOPS on the system disk.

101800
SystemDisk.AutoSnapshotPolicyIdstring

The ID of the automatic snapshot policy.

sp-bp1j0alc2z1fhvie****
InternetMaxBandwidthOutinteger

The maximum outbound public bandwidth.

100
InternetMaxBandwidthIninteger

The maximum inbound public bandwidth.

5
InstanceTypestring

The instance type of the instance.

ecs.g5.large
Periodinteger

The subscription duration of the instance.

1
InstanceChargeTypestring

The billing method of the instance. Valid values:

  • PrePaid: subscription
  • PostPaid: pay-as-you-go
Postpaid
IoOptimizedstring

Indicates whether the instance is I/O optimized.

none
RamRoleNamestring

The name of the instance Resource Access Management (RAM) role.

testRamRoleName
VSwitchIdstring

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

vsw-bp67acfmxazb4p****
ResourceGroupIdstring

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

rg-bp67acfmxazb4p****
InternetChargeTypestring

The billing method for network usage.

PayByTraffic
ZoneIdstring

The zone ID of the instance.

cn-hangzhou-g
Ipv6AddressCountinteger

The number of IPv6 addresses to assign to the instance.

1
DataDisksarray<object>

Details about the data disks.

DataDiskobject

Details about the data disk.

PerformanceLevelstring

The performance level of the ESSD to use as a data disk. This parameter is returned only when the 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.
PL1
Descriptionstring

The description of the data disk.

testDiskDescription
SnapshotIdstring

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

s-bp67acfmxazb4p****
Devicestring

The mount point of the data disk. The mount points are named based on the number of data disks:

  • 1st to 25th data disks: /dev/xvd[b-z].
  • From the 26th data disk on: /dev/xvd[aa-zz]. For example, the 26th data disk is named /dev/xvdaa, the 27th data disk is named /dev/xvdab, and so on.
Note This parameter is applicable to scenarios in which a full image is used to create instances. A full image is an image that contains an operating system, application software, and business data. For these scenarios, you can set the parameter to the mount point of data disk N contained in the full image and modify DataDisk.N.Size and DataDisk.N.Category to change the category and size of data disk N created based on the image.
/dev/xvda
Sizeinteger

The size of the data disk.

2000
DiskNamestring

The name of the data disk.

testDiskName
Categorystring

The category of the data disk.

cloud_ssd
DeleteWithInstanceboolean

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

true
Encryptedstring

Indicates whether the data disk is encrypted.

false
ProvisionedIopslong

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 you set DataDisk.N.Category to cloud_auto. For more information, see ESSD AutoPL disks and Modify the performance configurations of an ESSD AutoPL disk.
50000
BurstingEnabledboolean

Indicates whether the performance burst feature is enabled. Valid values:

  • true
  • false
true
AutoSnapshotPolicyIdstring

The ID of the automatic snapshot policy.

sp-wz91dz3ghear2a5s****
NetworkInterfacesarray<object>

Details about the secondary elastic network interfaces (ENIs).

NetworkInterfaceobject

Details about the secondary elastic network interfaces (ENIs).

NetworkInterfaceNamestring

The name of the secondary ENI.

testNetworkInterfaceName
VSwitchIdstring

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

vsw-bp67acfmxazb4p****
Descriptionstring

The description of the secondary ENI.

testNetworkInterfacesDescription
PrimaryIpAddressstring

The primary private IP address of the secondary ENI.

203.0.*.*
SecurityGroupIdstring

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 SecurityGroupId and SecurityGroupIds are mutually exclusive in the response.
sg-bp67acfmxazb4p****
SecurityGroupIdsarray

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

Note SecurityGroupId and SecurityGroupIds are mutually exclusive in the response.
SecurityGroupIdstring

The ID of the security group to which to assign the secondary ENI.

Note SecurityGroupId and SecurityGroupIds are mutually exclusive in the response.
["sg-bp15ed6xe1yxeycg7****"]
InstanceTypestring

The instance type of the instance.

ecs.s2.xlarge
NetworkInterfaceTrafficModestring

The communication mode of the primary ENI. Valid values:

  • Standard: uses the TCP communication mode.
  • HighPerformance: uses the remote direct memory access (RDMA) communication mode with Elastic RDMA Interface (ERI) enabled.
Standard
Tagsarray<object>

The tags to add to the instance.

InstanceTagobject

The tags to add to the instance.

Keystring

The key of the tag to add to the instance.

TestKey
Valuestring

The value of the tag to add to the instance.

TestValue
SecurityGroupIdsarray

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

Note SecurityGroupId and SecurityGroupIds are mutually exclusive in the response.
SecurityGroupIdstring

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

Note SecurityGroupId and SecurityGroupIds are mutually exclusive in the response.
["sg-bp15ed6xe1yxeycg7****"]
SystemDisk.ProvisionedIopslong

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 you set DataDisk.N.Category to cloud_auto. For more information, see ESSD AutoPL disks and Modify the performance configurations of an ESSD AutoPL disk.
50000
SystemDisk.BurstingEnabledboolean

Indicates whether the performance burst feature is enabled. Valid values:

  • true
  • false
true
SystemDisk.Encryptedstring

Indicates whether the system disk is encrypted. Valid values:

  • true
  • false

Default value: false.

Note If you create an instance in Hong Kong Zone D or Singapore Zone A, you cannot encrypt the system disk.
false
DeletionProtectionboolean

Indicates whether release protection is enabled for the instance. This parameter indicates whether you can use the ECS console or call the DeleteInstance operation to release the instance. Valid values:

  • true
  • false

Default value: false.

Note This parameter is applicable only to pay-as-you-go instances. The release protection feature can protect instances against manual releases, but not against automatic releases.
false
CreditSpecificationstring

The performance mode of the burstable instance. Valid values:

Standard
AutoRenewboolean

Indicates whether auto-renewal is enabled for the instance. This parameter is valid only if InstanceChargeType is set to PrePaid. Valid values:

  • true
  • false

Default value: false.

true
AutoRenewPeriodinteger

The auto-renewal period of the instance. Valid values:

Valid values when PeriodUnit is set to Month: 1, 2, 3, 6, 12, 24, 36, 48, and 60.

Default value: 1.

1
PeriodUnitstring

The unit of the subscription period. Valid values:

Month (default)

Month
HttpEndpointstring

Indicates whether the access channel is enabled for instance metadata. Valid values:

  • enabled
  • disabled

Default value: enabled.

enabled
HttpTokensstring

Indicates whether the security hardening mode (IMDSv2) is forcefully used to access instance metadata. Valid values:

  • optional: The security hardening mode (IMDSv2) is not forcefully used.
  • required: The security hardening mode (IMDSv2) is forcefully used. After you set this parameter to required, you cannot access instance metadata in normal mode.

Default value: optional.

Note For more information about the modes of accessing instance metadata, see Obtain information about an ECS instance, such as instance attributes, by using instance metadata.
optional
HttpPutResponseHopLimitinteger
Note This parameter is not publicly available.
3

Examples

Sample success responses

JSONformat

{
  "PageSize": 10,
  "RequestId": "3989ED0C-20A1-4351-A127-2067FF8390AX",
  "PageNumber": 1,
  "TotalCount": 1,
  "LaunchTemplateVersionSets": {
    "LaunchTemplateVersionSet": [
      {
        "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,
          "SystemDisk.AutoSnapshotPolicyId": "sp-bp1j0alc2z1fhvie****",
          "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": {
            "DataDisk": [
              {
                "PerformanceLevel": "PL1",
                "Description": "testDiskDescription",
                "SnapshotId": "s-bp67acfmxazb4p****",
                "Device": "/dev/xvda",
                "Size": 2000,
                "DiskName": "testDiskName",
                "Category": "cloud_ssd",
                "DeleteWithInstance": true,
                "Encrypted": "false",
                "ProvisionedIops": 50000,
                "BurstingEnabled": true,
                "AutoSnapshotPolicyId": "sp-wz91dz3ghear2a5s****"
              }
            ]
          },
          "NetworkInterfaces": {
            "NetworkInterface": [
              {
                "NetworkInterfaceName": "testNetworkInterfaceName",
                "VSwitchId": "vsw-bp67acfmxazb4p****",
                "Description": "testNetworkInterfacesDescription",
                "PrimaryIpAddress": "203.0.*.*",
                "SecurityGroupId": "sg-bp67acfmxazb4p****",
                "SecurityGroupIds": {
                  "SecurityGroupId": [
                    "[\"sg-bp15ed6xe1yxeycg7****\"]"
                  ]
                },
                "InstanceType": "ecs.s2.xlarge",
                "NetworkInterfaceTrafficMode": "Standard"
              }
            ]
          },
          "Tags": {
            "InstanceTag": [
              {
                "Key": "TestKey",
                "Value": "TestValue"
              }
            ]
          },
          "SecurityGroupIds": {
            "SecurityGroupId": [
              "[\"sg-bp15ed6xe1yxeycg7****\"]"
            ]
          },
          "SystemDisk.ProvisionedIops": 50000,
          "SystemDisk.BurstingEnabled": true,
          "SystemDisk.Encrypted": "false",
          "DeletionProtection": false,
          "CreditSpecification": "Standard",
          "AutoRenew": true,
          "AutoRenewPeriod": 1,
          "PeriodUnit": "Month",
          "HttpEndpoint": "enabled",
          "HttpTokens": "optional",
          "HttpPutResponseHopLimit": 3
        }
      }
    ]
  }
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidRegion.NotExist%sThe specified region does not exist.
400MissingParameter%sA parameter is not specified.
400InvalidParameter%sThe specified parameter is invalid.
403InnerServiceFailed%sAn internal service cannot be called.
404InvalidLaunchTemplate.NotFoundThe specified LaunchTemplate is not found.The specified launch template does not exist.
500InternalErrorThe request processing has failed due to some unknown error, exception or failure.An internal error has occurred. Try again later.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-10-12The Error code has changed. The response structure of the API has changedView Change Details
2024-05-28The Error code has changed. The response structure of the API has changedView Change Details
2023-10-18The Error code has changed. The response structure of the API has changedView Change Details
2023-08-01The Error code has changed. The response structure of the API has changedView Change Details
2023-03-28The Error code has changedView Change Details
2022-07-11API Description Update. The Error code has changed. The response structure of the API has changedView Change Details
2021-12-20The Error code has changed. The response structure of the API has changedView Change Details