Listing Template Versions
Function
This API is used to filter and query the launch template versions based on the request conditions. You can filter templates by image_id and flavor_id.
URI
GET /v3/{project_id}/launch-template-versions
Parameter |
Mandatory |
Description |
---|---|---|
project_id |
Yes |
Specifies the project ID. For details about how to obtain the project ID, see Obtaining a Project ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
limit |
No |
Integer |
Specifies the maximum number of templates that can be returned. A maximum of 100 templates can be returned. |
marker |
No |
String |
Specifies the template ID to which the marker corresponds. The query will start from the next ID. This parameter must be used together with the parameter limit. |
launch_template_id |
No |
String |
Specifies the template ID. |
image_id |
No |
String |
Specifies the image ID of the template. |
flavor_id |
No |
String |
Specifies the flavor ID of the template. |
version |
No |
Array of Integers |
Specifies the template version. |
Request
None
Response
Table 3 describes the response parameters.
Parameter |
Type |
Description |
---|---|---|
template_data |
Object |
Specifies the request for creating an ECS. For details, see Table 5. |
version_number |
Integer |
Specifies the template version. |
version_id |
String |
Specifies the template version ID. |
version_description |
String |
Specifies the template version description. |
created_at |
String |
Specifies the time when the template version was created. |
launch_template_id |
String |
Specifies the template ID. |
Parameter |
Type |
Description |
---|---|---|
flavor_id |
String |
Specifies the flavor ID of the ECS created based on the template. |
name |
String |
Specifies the template name. |
description |
String |
Specifies the template description. |
availability_zone_id |
String |
Specifies the AZ of the template. |
enterprise_project_id |
String |
Specifies the enterprise project ID of the template. |
auto_recovery |
Boolean |
Enables auto-recovery. |
os_profile |
Object |
Specifies the OS attributes. For details, see Table 6. |
security_group_ids |
Array of strings |
Specifies the security group ID list. This parameter applies to all network interfaces. |
network_interfaces |
Array of Objects |
Specifies the network interfaces. For details, see Table 7. |
block_device_mappings |
Array of Objects |
Specifies the BDM mounting information, which is subject to the flavor restrictions. For details, see Table 9. |
market_options |
Object |
Specifies the billing information. For details, see Table 11. |
internet_access |
Object |
Specifies the public network access. For details, see Table 13. |
metadata |
String |
Specifies the metadata. |
tag_options |
Object |
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. |
Parameter |
Type |
Description |
---|---|---|
key_name |
String |
Specifies the key name. |
user_data |
String |
Specifies the custom user data to be injected into the instance during instance creation. Text and text files can be injected. |
iam_agency_name |
String |
Specifies the agency name. |
enable_monitoring_service |
Boolean |
Enables HSS. |
Parameter |
Type |
Description |
---|---|---|
virsubnet_id |
String |
Specifies the subnet ID. |
attachment |
Object |
Specifies the network interface details. For details, see Table 8. |
Parameter |
Type |
Description |
---|---|---|
device_index |
Integer |
Specifies the loading sequence. The value 0 indicates the primary network interface. |
Parameter |
Type |
Description |
---|---|---|
source_id |
String |
Specifies the data source type of the ECS volume. |
source_type |
String |
Specifies the source type of the volume device. |
encrypted |
Boolean |
Encrypted or not. |
cmk_id |
String |
Specifies the key ID. |
volume_type |
String |
Specifies the volume type. |
volume_size |
Integer |
Specifies the volume size. |
attachment |
Object |
Specifies the disk interface. For details, see Table 10. |
Parameter |
Type |
Description |
---|---|---|
boot_index |
Integer |
Specifies the loading sequence. The value 0 indicates the system disk. |
Parameter |
Type |
Description |
---|---|---|
market_type |
String |
Specifies the billing mode. |
spot_options |
Object |
Specifies spot instance parameters. For details, see Table 12. |
Parameter |
Type |
Description |
---|---|---|
spot_price |
Number |
Specifies the highest price per hour you are willing to pay for a spot ECS. |
block_duration_minutes |
Integer |
Specifies the predefined duration of the spot ECS. |
instance_interruption_behavior |
String |
Specifies the spot ECS interruption policy, which can only be set to immediate currently. |
Parameter |
Type |
Description |
---|---|---|
publicip |
Object |
Specifies the public network access. For details, see Table 14. |
Parameter |
Type |
Description |
---|---|---|
publicip_type |
String |
Specifies the EIP type. |
charging_mode |
String |
Specifies the EIP billing mode. |
bandwidth |
Object |
Specifies the EIP bandwidth. For details, see Table 15. |
Parameter |
Type |
Description |
---|---|---|
share_type |
String |
Specifies the bandwidth type. |
size |
Integer |
Specifies the bandwidth size. |
charge_mode |
String |
Specifies the billing mode. |
id |
String |
Specifies the bandwidth ID. You can use an existing shared bandwidth when applying for an EIP for the bandwidth of type WHOLE. |
Parameter |
Type |
Description |
---|---|---|
tags |
Array of Objects |
Specifies tags. For details, see Table 17. |
Parameter |
Type |
Description |
---|---|---|
key |
String |
Specifies the tag key. |
value |
String |
Specifies the tag value. |
Parameter |
Type |
Description |
---|---|---|
next_marker |
String |
Specifies the start index ID of the next page. |
previous_marker |
String |
Specifies the start index ID of the previous page. |
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