Queries the information of launch template versions, such as the total number of launch templates, launch template names, and launch template version numbers. When you call this operation, you can specify parameters, such as LaunchTemplateVersion, LaunchTemplateId, and DetailFlag, in the request.
Operation description
Debugging
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.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ecs:DescribeLaunchTemplateVersions | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the launch template. You can call the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
LaunchTemplateVersion | array | No | Version N of the launch template. | |
long | No | Version N of the launch template. | 1 | |
LaunchTemplateId | string | No | The ID of the launch template. You must set LaunchTemplateId or LaunchTemplateName to specify a launch template. | lt-bp168lnahrdwl39p**** |
LaunchTemplateName | string | No | The name of the launch template. | testLaunchTemplateName |
MinVersion | long | No | The minimum version number in the version range to query. | 1 |
MaxVersion | long | No | The maximum version number in the version range to query. | 10 |
DefaultVersion | boolean | No | Specifies whether to query the default version. | true |
DetailFlag | boolean | No | Specifies whether to query the configurations of the launch template. Valid values:
Default value: true. | true |
PageNumber | integer | No | The number of the page to return. Pages start from page 1. Default value: 1. | 1 |
PageSize | integer | No | The number of entries to return on each page. Default value: 10. | 10 |
Response parameters
Examples
Sample success responses
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/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"
}
}
]
}
}
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. |
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. |
500 | InternalError | The 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 time | Summary of changes | Operation |
---|---|---|
2024-05-28 | The Error code has changed. The response structure of the API has changed | View Change Details |
2023-10-18 | The Error code has changed. The response structure of the API has changed | View Change Details |
2023-08-01 | The Error code has changed. The response structure of the API has changed | View Change Details |
2023-03-28 | The Error code has changed | View Change Details |
2022-07-11 | API Description Update. The Error code has changed. The response structure of the API has changed | View Change Details |
2021-12-20 | The Error code has changed. The response structure of the API has changed | View Change Details |