Listing Template Versions
Function
This API is used to filter and list the launch template versions based on the request conditions. You can filter templates by image_id and flavor_id.
Debugging
You can debug this API in API Explorer.
Authorization
- If you are using role/policy-based authorization, see the required permissions in Permissions and Supported Actions.
- If you are using identity policy-based authorization, the permissions listed below are required.
| Action | Access Level | Resource Type (*: required) | Condition Key | Alias | Dependencies |
|---|---|---|---|---|---|
| ecs:launchTemplateVersions:list | list | - | - | - | - |
URI
GET /v3/{project_id}/launch-template-versions
| Parameter | Mandatory | Description |
|---|---|---|
| project_id | Yes | Definition Specifies the project ID. For details about how to obtain the ID, see Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| limit | No | Integer | Definition Specifies the maximum number of templates that can be returned. Constraints A maximum of 100 templates can be returned. Range N/A Default Value N/A |
| marker | No | String | Definition Specifies the template ID to which the marker corresponds. The query will start from the next ID. Constraints This parameter must be used together with the parameter limit. Range N/A Default Value N/A |
| launch_template_id | No | String | Definition Specifies the template ID. Constraints N/A Range N/A Default Value N/A |
| image_id | No | String | Definition Specifies the image ID of the template. Constraints N/A Range N/A Default Value N/A |
| flavor_id | No | String | Definition Specifies the flavor ID of the template. Constraints N/A Range N/A Default Value N/A |
| version | No | Array of Integers | Definition Specifies the template version. Constraints N/A Range N/A Default Value N/A |
Request
None
Response
Table 3 describes the response parameters.
| Parameter | Type | Description |
|---|---|---|
| template_data | Object | Definition Specifies the request for creating an ECS. For details, see Table 5. Range N/A |
| version_number | Integer | Definition Specifies the template version. Range N/A |
| version_id | String | Definition Specifies the template version ID. Range N/A |
| version_description | String | Definition Specifies the template version description. Range N/A |
| created_at | String | Definition Specifies the time when the template version was created. Range N/A |
| launch_template_id | String | Definition Specifies the template ID. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| flavor_id | String | Definition Specifies the flavor ID of the ECS created based on the template. Range N/A |
| name | String | Definition Specifies the template name. Range N/A |
| description | String | Definition Specifies the template description. Range N/A |
| availability_zone_id | String | Definition Specifies the AZ of the template. Range N/A |
| enterprise_project_id | String | Definition Specifies the enterprise project ID of the template. Range N/A |
| auto_recovery | Boolean | Definition Enables auto-recovery. Range N/A |
| os_profile | Object | Definition Specifies the OS attributes. For details, see Table 6. Range N/A |
| security_group_ids | Array of strings | Definition Specifies the security group ID list. This parameter applies to all network interfaces. Range N/A |
| network_interfaces | Array of Objects | Definition Specifies the network interfaces. For details, see Table 7. Range N/A |
| block_device_mappings | Array of Objects | Definition Specifies the BDM mounting information, which is subject to the flavor restrictions. For details, see Table 9. Range N/A |
| market_options | Object | Definition Specifies the billing information. For details, see Table 11. Range N/A |
| internet_access | Object | Definition Specifies the public network access. For details, see Table 13. Range N/A |
| metadata | Object | Definition Specifies the user-defined metadata key-value pair. Range N/A |
| tag_options | Array of Objects | Definition Specifies VM tags. Currently, only VMs can be tagged. In the future, associated resources such as volumes can be tagged, too. For details, see Table 16. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| key_name | String | Definition Specifies the key name. Range N/A |
| user_data | String | Definition Specifies the custom user data to be injected into the instance during instance creation. Text and text files can be injected. Range N/A |
| iam_agency_name | String | Definition Specifies the agency name. Range N/A |
| enable_monitoring_service | Boolean | Definition Enables HSS. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| virsubnet_id | String | Definition Specifies the subnet ID. Range N/A |
| attachment | Object | Definition Specifies the network interface details. For details, see Table 8. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| device_index | Integer | Definition Specifies the loading sequence. The value 0 indicates the primary network interface. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| source_id | String | Definition Specifies the data source type of the ECS volume. Range N/A |
| source_type | String | Definition Specifies the source type of the volume device. Range N/A |
| encrypted | Boolean | Definition Encrypted or not. Range N/A |
| cmk_id | String | Definition Specifies the key ID. Range N/A |
| volume_type | String | Definition Specifies the volume type. Range N/A |
| volume_size | Integer | Definition Specifies the volume size. Range N/A |
| attachment | Object | Definition Specifies the disk interface. For details, see Table 10. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| boot_index | Integer | Definition Specifies the loading sequence. The value 0 indicates the system disk. Range N/A |
| delete_on_termination | Boolean | Definition Specifies whether the disk is released along with the instance. Range
By default, this parameter is set to true for the system disk, indicating that the system disk is released along with the instance, and set to false for data disks, indicating that they are not released along with the instance. |
| Parameter | Type | Description |
|---|---|---|
| market_type | String | Definition Specifies the billing mode. Range N/A |
| spot_options | Object | Definition Specifies spot instance parameters. For details, see Table 12. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| spot_price | Float | Definition Specifies the highest price per hour you are willing to pay for a spot ECS. Range N/A |
| block_duration_minutes | Integer | Definition Specifies the predefined duration of the spot ECS. Range N/A |
| instance_interruption_behavior | String | Definition Specifies the spot ECS interruption policy, which can only be set to immediate currently. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| publicip | Object | Definition Specifies the public network access. For details, see Table 14. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| publicip_type | String | Definition Specifies the EIP type. Range N/A |
| charging_mode | String | Definition Specifies the EIP billing mode. Range N/A |
| bandwidth | Object | Definition Specifies the EIP bandwidth. For details, see Table 15. Range N/A |
| delete_on_termination | Boolean | Definition Specifies whether the EIP is released along with the instance. Range
|
| Parameter | Type | Description |
|---|---|---|
| share_type | String | Definition Specifies the bandwidth type. Range N/A |
| size | Integer | Definition Specifies the bandwidth size. Range N/A |
| charge_mode | String | Definition Specifies the billing mode. Range N/A |
| id | String | Definition Specifies the bandwidth ID. You can use an existing shared bandwidth when applying for an EIP for the bandwidth of type WHOLE. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| tags | Array of Objects | Definition Specifies tags. For details, see Table 17. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| key | String | Definition Specifies the tag key. Range N/A |
| value | String | Definition Specifies the tag value. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| next_marker | String | Definition Specifies the start index ID of the next page. Range N/A |
| previous_marker | String | Definition Specifies the start index ID of the previous page. Range N/A |
Example Request
List template versions.
GET https://{endpoint}/v3/{project_id}/launch-template-versions Example Response
{
"launch_template_versions": [
{
"template_data": {
"flavor_id": "c1.2xlarge.2",
"name": "new-server",
"description": "test server",
"availability_zone_id": "az1.dc1",
"enterprise_project_id": "e6b99563-xxxx-xxxx-xxxx-1820d4fd2a67",
"auto_recovery": false,
"os_profile": {
"key_name": "new-key",
"user_data": "XXXXXXXXXXXXXXXX",
"iam_agency_name": "new-agency",
"enable_monitoring_service": false
},
"security_group_ids": [
"e6b99563-xxxx-xxxx-xxxx-1820d4fd2a67"
],
"network_interfaces": [
{
"virsubnet_id": "e6b99563-xxxx-xxxx-xxxx-1820d4fd2a67",
"attachment": {
"device_index": 0
}
}
],
"block_device_mappings": [
{
"source_id": "e6b99563-xxxx-xxxx-xxxx-1820d4fd2a67",
"source_type": "image",
"encrypted": false,
"cmk_id": "e6b99563-xxxx-xxxx-xxxx-1820d4fd2a67",
"volume_type": "SATA",
"volume_size": 40,
"attachment": {
"boot_index": 0
}
}
],
"market_options": {
"market_type": "postpaid",
"spot_options": {
"spot_price": 3.5,
"block_duration_minutes": 60,
"instance_interruption_behavior": "immediate"
}
},
"internet_access": {
"publicip": {
"publicip_type": "5_bgp",
"charging_mode": "postPaid",
"bandwidth": {
"share_type": "PER",
"size": 2,
"charge_mode": "traffic",
"id": "e6b99563-xxxx-xxxx-xxxx-1820d4fd2a67"
}
}
},
"metadata": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"tag_options": [
{
"tags": [
{
"key": "tag-key",
"value": "tag-value"
}
]
}
]
},
"version_number": 2,
"version_id": "e6b99563-xxxx-xxxx-xxxx-1820d4fd2a67",
"version_description": "this template version is used for XXXXXX",
"created_at": "XXXXX-XX-XX",
"launch_template_id": "e6b99563-xxxx-xxxx-xxxx-1820d4fd2a67"
}
],
"page_info": {
"next_marker": "string"
}
} Returned Values
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot