Queries information about launch template versions of ECS instances, such as the total number of launch templates, template names, and template version numbers.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:DescribeLaunchTemplateVersions |
list |
LaunchTemplate
LaunchTemplate
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the launch template. You can call DescribeRegions to query the most recent region list. |
cn-hangzhou |
| LaunchTemplateVersion |
array |
No |
One or more launch template version numbers. |
1 |
|
integer |
No |
One or more launch template version numbers. |
1 |
|
| LaunchTemplateId |
string |
No |
The launch template ID. You must specify |
lt-bp168lnahrdwl39p**** |
| LaunchTemplateName |
string |
No |
The launch template name. You must specify |
testLaunchTemplateName |
| MinVersion |
integer |
No |
The minimum version number used to filter query results. Used together with |
1 |
| MaxVersion |
integer |
No |
The maximum version number used to filter query results. Used together with |
10 |
| DefaultVersion |
boolean |
No |
Specifies whether to query the default version. |
true |
| DetailFlag |
boolean |
No |
Specifies whether to query detailed template configuration information. Valid values:
Default value: true. |
true |
| PageNumber |
integer |
No |
The page number of the launch template list. Minimum value: 1. Default value: 1. |
1 |
| PageSize |
integer |
No |
The number of entries per page in a paged query. Settings this parameter for paging. Default value: 10. |
10 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The version information collection. |
||
| PageSize |
integer |
The number of entries per page in a paged query. Settings this parameter for paging. |
10 |
| RequestId |
string |
The request ID. |
3989ED0C-20A1-4351-A127-2067FF8390AX |
| PageNumber |
integer |
The current page number. |
1 |
| TotalCount |
integer |
The total number of launch templates. |
1 |
| LaunchTemplateVersionSets |
object |
||
| LaunchTemplateVersionSet |
array<object> |
The information about template versions. |
|
|
array<object> |
The information about template versions. |
||
| LaunchTemplateName |
string |
The name of the launch template. |
testLaunchTemplateName |
| DefaultVersion |
boolean |
Indicates whether the launch template version is the default version. |
true |
| VersionNumber |
integer |
The number of the launch template version. |
1 |
| ModifiedTime |
string |
The time when the launch template version was modified. |
2022-01-17T08:40:00Z |
| LaunchTemplateId |
string |
The ID of the launch template. |
lt-bp67acfmxazb4p**** |
| CreateTime |
string |
The time when the launch template version was created. |
2022-01-17T08:22:43Z |
| CreatedBy |
string |
The ID of the Alibaba Cloud account that created the launch template. |
123456789**** |
| VersionDescription |
string |
The description of the launch template version. |
testVersionDescription |
| LaunchTemplateData |
object |
The configurations of the launch template. |
|
| DeploymentSetId |
string |
The ID of the deployment set. |
ds-bp1brhwhoqinyjd6**** |
| VpcId |
string |
The ID of the virtual private cloud (VPC). |
v-bp67acfmxazb4p**** |
| SystemDisk.PerformanceLevel |
string |
The performance level of the Enterprise SSD (ESSD) to use as the system disk. Default value: PL0. Valid values:
For information about ESSD performance levels, see ESSDs. |
PL0 |
| KeyPairName |
string |
The name of the key pair. |
testKeyPairName |
| SecurityGroupId |
string |
The ID of the security group to which to assign the instance. Note
|
sg-bp67acfmxazb4p**** |
| NetworkType |
string |
The network type. Valid values:
|
vpc |
| SpotStrategy |
string |
The bidding policy for the pay-as-you-go instance. Valid values:
|
NoSpot |
| EnableVmOsConfig |
boolean |
Indicates whether the operating system configuration of the instance is enabled. |
false |
| Description |
string |
The description of the system disk. |
testInstanceDescription |
| SpotDuration |
integer |
The protection period of the spot instance. Unit: hours. Valid values:
Alibaba Cloud sends an ECS system event to notify you 5 minutes before the instance is released. Spot 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 |
| InstanceName |
string |
The name of the instance. |
testInstanceName |
| SecurityEnhancementStrategy |
string |
Indicates whether Security Hardening is enabled. |
active |
| UserData |
string |
The user data of the instance, which is Base64-encoded. |
SGVsbG9FQ1M= |
| SystemDisk.DiskName |
string |
The name of the system disk. |
testSystemDiskName |
| SystemDisk.Size |
integer |
The size of the system disk. Unit: GiB. |
40 |
| SpotPriceLimit |
number |
The maximum hourly price of the spot instance. |
0.98 |
| PasswordInherit |
boolean |
Indicates whether the username and password preset in the image are used. |
true |
| PrivateIpAddress |
string |
The private IP address to assign to the instance. |
10.1.**.** |
| ImageId |
string |
The ID of the image. |
m-bp67acfmxazb4p**** |
| SystemDisk.DeleteWithInstance |
boolean |
Indicates whether to release the system disk when the instance is released. Valid values:
|
true |
| SystemDisk.Category |
string |
The category of the system disk. Valid values:
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 |
| AutoReleaseTime |
string |
The automatic release time of the instance. |
2018-05-14T14:18:00Z |
| SystemDisk.Description |
string |
The description of the system disk. |
testSystemDiskDescription |
| ImageOwnerAlias |
string |
The source of the image. Valid values:
|
system |
| HostName |
string |
The hostname of the instance. |
testHostName |
| SystemDisk.Iops |
integer |
The number of IOPS on the system disk. |
101800 |
| SystemDisk.AutoSnapshotPolicyId |
string |
The ID of the automatic snapshot policy. |
sp-bp1j0alc2z1fhvie**** |
| InternetMaxBandwidthOut |
integer |
The maximum outbound public bandwidth. |
100 |
| InternetMaxBandwidthIn |
integer |
The maximum inbound public bandwidth. |
5 |
| InstanceType |
string |
The instance type of the instance. |
ecs.g5.large |
| Period |
integer |
The subscription duration of the instance. |
1 |
| InstanceChargeType |
string |
The billing method of the instance. Valid values:
|
Postpaid |
| IoOptimized |
string |
Indicates whether the instance is I/O optimized. |
none |
| RamRoleName |
string |
The name of the instance Resource Access Management (RAM) role. |
testRamRoleName |
| VSwitchId |
string |
The ID of the vSwitch to which to connect the instance. |
vsw-bp67acfmxazb4p**** |
| ResourceGroupId |
string |
The ID of the resource group to which the launch template belongs. |
rg-bp67acfmxazb4p**** |
| InternetChargeType |
string |
The billing method for network usage. |
PayByTraffic |
| ZoneId |
string |
The zone ID of the instance. |
cn-hangzhou-g |
| Ipv6AddressCount |
integer |
The number of IPv6 addresses to assign to the instance. |
1 |
| DataDisks |
object |
||
| DataDisk |
array<object> |
Details about the data disks. |
|
|
object |
Details about the data disk. |
||
| PerformanceLevel |
string |
The performance level of the ESSD to use as a data disk. This parameter is returned only when the value of
|
PL1 |
| Description |
string |
The description of the data disk. |
testDiskDescription |
| SnapshotId |
string |
The ID of the snapshot to use to create the data disk. |
s-bp67acfmxazb4p**** |
| Device |
string |
The mount point of the data disk. The mount points are named based on the number of data disks:
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 |
/dev/xvdb |
| Size |
integer |
The size of the data disk. |
2000 |
| DiskName |
string |
The name of the data disk. |
testDiskName |
| Category |
string |
The category of the data disk. |
cloud_ssd |
| DeleteWithInstance |
boolean |
Indicates whether to release the data disk when the instance is released. |
true |
| Encrypted |
string |
Indicates whether the data disk is encrypted. |
false |
| ProvisionedIops |
integer |
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 |
| BurstingEnabled |
boolean |
Indicates whether the performance burst feature is enabled. Valid values:
|
true |
| AutoSnapshotPolicyId |
string |
The ID of the automatic snapshot policy. |
sp-wz91dz3ghear2a5s**** |
| KMSKeyId |
string |
The ID of the KMS key used for the data disk. |
0e478b7a-4262-4802-b8cb-00d3fb40**** |
| NetworkInterfaces |
object |
||
| NetworkInterface |
array<object> |
Details about the secondary elastic network interfaces (ENIs). |
|
|
array<object> |
Details about the secondary ENI. |
||
| NetworkInterfaceName |
string |
The name of the secondary ENI. |
testNetworkInterfaceName |
| VSwitchId |
string |
The ID of the vSwitch to which to connect the ENI. |
vsw-bp67acfmxazb4p**** |
| Description |
string |
The description of the secondary ENI. |
testNetworkInterfacesDescription |
| PrimaryIpAddress |
string |
The primary private IP address of the secondary ENI. |
203.0.*.* |
| SecurityGroupId |
string |
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**** |
| SecurityGroupIds |
object |
||
| SecurityGroupId |
array |
The IDs of the security groups to which to assign the secondary ENI. Note
SecurityGroupId and SecurityGroupIds are mutually exclusive in the response. |
|
|
string |
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****"] |
|
| InstanceType |
string |
The instance type of the instance. |
ecs.s2.xlarge |
| NetworkInterfaceTrafficMode |
string |
The communication mode of the primary ENI. Valid values:
|
Standard |
| DeleteOnRelease |
boolean |
Indicates whether to retain the ENI when the associated instance is released. Valid values:
|
true |
| Tags |
object |
||
| InstanceTag |
array<object> |
The tags to add to the instance. |
|
|
object |
The tags to add to the instance. |
||
| Key |
string |
The key of the tag to add to the instance. |
TestKey |
| Value |
string |
The value of the tag to add to the instance. |
TestValue |
| SecurityGroupIds |
object |
||
| SecurityGroupId |
array |
The IDs of the security groups to which to assign the instance. Note
|
|
|
string |
The ID of the security group to which to assign the instance. Note
|
["sg-bp15ed6xe1yxeycg7****"] |
|
| SystemDisk.ProvisionedIops |
integer |
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.BurstingEnabled |
boolean |
Indicates whether the performance burst feature is enabled. Valid values:
|
true |
| SystemDisk.Encrypted |
string |
Indicates whether the system disk is encrypted. Valid values:
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 |
| DeletionProtection |
boolean |
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:
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 |
| CreditSpecification |
string |
The performance mode of the burstable instance. Valid values:
|
Standard |
| AutoRenew |
boolean |
Indicates whether auto-renewal is enabled for the instance. This parameter is valid only if
Default value: false. |
true |
| AutoRenewPeriod |
integer |
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 |
| PeriodUnit |
string |
The unit of the subscription period. Valid values: Month (default) |
Month |
| HttpEndpoint |
string |
Indicates whether the access channel is enabled for instance metadata. Valid values:
Default value: enabled. Note
For information about instance metadata, see Obtain information about an ECS instance, such as instance attributes, by using instance metadata. |
enabled |
| HttpTokens |
string |
Indicates whether the security hardening mode (IMDSv2) is forcefully used to access instance metadata. Valid values:
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 |
| HttpPutResponseHopLimit |
integer |
Note
This parameter is not publicly available. |
3 |
| SystemDisk.KMSKeyId |
string |
The ID of the KMS key to use for the system disk. |
0e478b7a-4262-4802-b8cb-00d3fb40**** |
| ImageOptions |
object |
Details about the image options. |
|
| LoginAsNonRoot |
boolean |
Specifies whether the instance that uses the image supports logons of the ecs-user user. Valid values:
|
false |
| SecurityOptions |
object |
Security options. |
|
| TrustedSystemMode |
string |
Trusted system mode. Valid value: vTPM. Currently, the following instance families support trusted system mode:
When you create an ECS instance of one of the above instance families, you must set this parameter. The details are as follows:
Note
If you specify an instance as a trusted instance during creation, you can only use images that support the trusted system when replacing its system disk. For more information about the trusted system, see Function Overview of Trusted Features for Security-Enhanced Instances. |
vTPM |
Examples
Success response
JSON format
{
"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/xvdb\n",
"Size": 2000,
"DiskName": "testDiskName",
"Category": "cloud_ssd",
"DeleteWithInstance": true,
"Encrypted": "false",
"ProvisionedIops": 50000,
"BurstingEnabled": true,
"AutoSnapshotPolicyId": "sp-wz91dz3ghear2a5s****",
"KMSKeyId": "0e478b7a-4262-4802-b8cb-00d3fb40****"
}
]
},
"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",
"DeleteOnRelease": true
}
]
},
"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,
"SystemDisk.KMSKeyId": "0e478b7a-4262-4802-b8cb-00d3fb40****\n",
"ImageOptions": {
"LoginAsNonRoot": false
},
"SecurityOptions": {
"TrustedSystemMode": "vTPM"
}
}
}
]
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidRegion.NotExist | %s | The specified region does not exist. |
| 400 | MissingParameter | %s | A parameter is not specified. |
| 400 | InvalidParameter | %s | The specified parameter is invalid. |
| 500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | An internal error has occurred. Try again later. |
| 403 | InnerServiceFailed | %s | An internal service cannot be called. |
| 404 | InvalidLaunchTemplate.NotFound | The specified LaunchTemplate is not found. | The specified launch template does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.