Querying Details About an ECS
Function
This API is used to query details about an ECS.
The information that can be queried includes the ECS billing mode and whether the ECS is frozen.
URI
GET /v1/{project_id}/cloudservers/{server_id}
Parameter |
Mandatory |
Description |
---|---|---|
project_id |
Yes |
Specifies the project ID. For details about how to obtain the ID, see Obtaining a Project ID. |
server_id |
Yes |
Specifies the ECS ID. |
Request
None
Response
Parameter |
Type |
Description |
---|---|---|
server |
Object |
Definition Specifies the ECS information. For details, see Table 3. Range N/A |
Parameter |
Type |
Description |
---|---|---|
status |
String |
Definition Specifies the ECS status. Range ACTIVE, BUILD, ERROR, HARD_REBOOT, MIGRATING, REBOOT, REBUILD, RESIZE, REVERT_RESIZE, SHUTOFF, VERIFY_RESIZE, DELETED, SHELVED, SHELVED_OFFLOADED, and UNKNOWN For details, see ECS Statuses. |
updated |
String |
Definition Specifies the last time when the ECS was updated, such as started, stopped, or restarted. The time is in the format of "2019-05-22T03:30:52Z". Range N/A |
hostId |
String |
Definition Specifies the hash value of the host ID of the ECS. Range N/A |
OS-EXT-SRV-ATTR:host |
String |
Definition Specifies the name of the host where the ECS is deployed. Range N/A |
addresses |
Map<String, Array of objects> |
Definition Specifies the network attribute of the ECS. Range
|
key_name |
String |
Definition Specifies the key pair that is used to authenticate an ECS. Range N/A |
image |
Object |
Definition Specifies the ECS image. For details, see Table 7. Range N/A |
OS-EXT-STS:task_state |
String |
Definition Specifies the ECS task status. This is an extended attribute. For details, see ECS Statuses. Range N/A |
OS-EXT-STS:vm_state |
String |
Definition Specifies the ECS status. This is an extended attribute. For details, see ECS Statuses. Range N/A |
OS-EXT-SRV-ATTR:instance_name |
String |
Definition Specifies the ECS alias. This is an extended attribute. Range N/A |
OS-EXT-SRV-ATTR:hypervisor_hostname |
String |
Definition Specifies the name of the host on which the ECS is deployed. This is an extended attribute. Range N/A |
flavor |
Object |
Definition Specifies the ECS flavor. For details, see Table 1. Range N/A |
id |
String |
Definition Specifies the ECS ID in UUID format. Range N/A |
security_groups |
Array of objects |
Definition Specifies the security groups of the ECS. For details, see Table 3. Range N/A |
OS-EXT-AZ:availability_zone |
String |
Definition Specifies the AZ of an ECS. This is an extended attribute. Range N/A |
user_id |
String |
Definition Specifies the ID of the user for creating the ECS. The value is in UUID format. Range N/A |
name |
String |
Definition Specifies the ECS name. Range N/A |
created |
String |
Definition Specifies the time when the ECS was created. The time is in the format of "2019-05-22T03:19:19Z". Range N/A |
tenant_id |
String |
Definition Specifies the ID of the tenant to which the ECS belongs, which is the project ID in UUID format. Range N/A |
OS-DCF:diskConfig |
String |
Definition Specifies the disk configuration type. This is an extended attribute. Options: Range
|
accessIPv4 |
String |
Definition This is a reserved parameter. Range N/A |
accessIPv6 |
String |
Definition This is a reserved parameter. Range N/A |
fault |
Object |
Definition Specifies the ECS failure cause. Range
|
progress |
Integer |
Definition Specifies the ECS progress. Range 0 to 100 |
OS-EXT-STS:power_state |
Integer |
Definition Specifies the power status of the ECS. This is an extended attribute. Range
|
config_drive |
String |
Definition Specifies the config drive. Range N/A |
metadata |
Map<String,String> |
Definition Specifies the ECS metadata. For details, see Table 5.
NOTE:
Metadata includes system default fields and the fields set by users. Range N/A |
OS-SRV-USG:launched_at |
String |
Definition Specifies the time when the ECS was started. The time is in the format of "2019-05-22T03:23:59.000000". Range N/A |
OS-SRV-USG:terminated_at |
String |
Definition Specifies the time when the ECS was deleted. The time is in the format of "2019-05-22T03:23:59.000000". Range N/A |
os-extended-volumes:volumes_attached |
Array of objects |
Definition Specifies the disks attached to an ECS. For details, see Table 4. Range N/A |
description |
String |
Definition Specifies the ECS description. Range N/A |
host_status |
String |
Definition Specifies the status of the host accommodating the ECS. Range
|
OS-EXT-SRV-ATTR:hostname |
String |
Definition Specifies the host name of the ECS. Range N/A |
OS-EXT-SRV-ATTR:reservation_id |
String |
Definition Specifies the ID reserved for the ECSs to be created in a batch. You can use this ID to obtain all the ECSs created in the batch. Range N/A |
OS-EXT-SRV-ATTR:launch_index |
Integer |
Definition Specifies the sequence in which ECSs start if the ECSs are created in a batch. The value ranges from 0 to the number of ECSs created in the batch. Range N/A |
OS-EXT-SRV-ATTR:kernel_id |
String |
Definition Specifies the UUID of the kernel image if an AMI image is used. In other scenarios, leave this parameter blank. Range N/A |
OS-EXT-SRV-ATTR:ramdisk_id |
String |
Definition Specifies the UUID of the ramdisk image if an AMI image is used. In other scenarios, leave this parameter blank. Range N/A |
OS-EXT-SRV-ATTR:root_device_name |
String |
Definition Specifies the device name of the ECS system disk. For example, if the device type of the system disk is VBD, the value of this parameter is /dev/vda. If the device type of the system disk is SCSI, the value of this parameter is /dev/sda. Range N/A |
OS-EXT-SRV-ATTR:user_data |
String |
Definition Specifies the user data (encoded) configured during ECS creation. Range N/A |
locked |
Boolean |
Definition Specifies whether an ECS is locked. Range
|
tags |
Array of strings |
Definition Specifies ECS tags. Range N/A |
os:scheduler_hints |
Object |
Definition Specifies the ECS scheduling information. For details, see Table 13. Range N/A |
sys_tags |
Array of objects |
Definition Specifies ECS system tags. For details, see Table 6. Range N/A |
auto_terminate_time |
String |
Definition Specifies the scheduled deletion time for the ECS.
NOTE:
If no scheduled deletion time is set for the ECS, the value is left blank. A yearly/monthly ECS does not support scheduled deletion. In this case, the value is left blank. Range N/A |
cpu_options |
Object |
Definition Specifies the CPU options. For details, see Table 5. Range N/A |
hypervisor |
Object |
Definition Specifies the virtualization information. This is an extended attribute. For details, see Table 6. Range N/A |
network_interfaces |
Array of objects |
Definition Specifies the network interface information. For details, see Table 7. Range N/A |
Parameter |
Type |
Description |
---|---|---|
version |
String |
Definition Specifies the IP address version. Range
|
addr |
String |
Definition Specifies the IP address. Range N/A |
primary |
Boolean |
Definition Specifies whether the network interface is a primary network interface. Range
|
OS-EXT-IPS:type |
String |
Definition Specifies the IP address type. Range
|
OS-EXT-IPS-MAC:mac_addr |
String |
Definition Specifies the MAC address. Range N/A |
OS-EXT-IPS:port_id |
String |
Definition Specifies the port ID corresponding to the IP address. Range N/A |
Parameter |
Type |
Description |
---|---|---|
hw:cpu_threads |
Integer |
Definition Specifies whether to enable CPU hyper-threading. This parameter can be set to 1 (disabling hyper-threading) only when all of the following conditions are met:
Range
|
Parameter |
Type |
Description |
---|---|---|
port_id |
String |
Definition Specifies the port ID. Range N/A |
primary |
Boolean |
Definition Specifies whether the network interface is a primary network interface. Range
|
ip_addresses |
Array of strings |
Definition Specifies private IPv4 addresses. Range N/A |
ipv6_addresses |
Array of strings |
Definition Specifies private IPv6 addresses. Range N/A |
association |
Object |
Definition Specifies information about the associated EIP. For details, see Table 8. Range N/A |
subnet_id |
String |
Definition Specifies the subnet ID. Range N/A |
Parameter |
Type |
Description |
---|---|---|
public_ip_address |
String |
Definition Specifies the IPv4 address of the EIP. Range N/A |
Example Request
Query details about the ECS whose ID is 4f4b3dfa-eb70-47cf-a60a-998a53bd598a.
GET https://{endpoint}/v1/{project_id}/cloudservers/{server_id}
Example Response
{ "server": { "fault": null, "id": "4f4b3dfa-eb70-47cf-a60a-998a53bd598a", "name": "ecs-2ecf", "addresses": { "0431c5e5-bc94-4a44-8263-15da2a642435": [ { "version": "4", "addr": "192.168.1.99", "primary": true, "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:df:18:6d", "OS-EXT-IPS:type": "fixed", "OS-EXT-IPS:port_id": "23037c18-027a-44e5-b6b9-f8d8f113fe02" } ] }, "flavor": { "disk": "0", "vcpus": "2", "ram": "1024", "id": "s3.large.1", "name": "s3.large.1", "gpus": [ ], "asic_accelerators": [ ] }, "accessIPv4": "", "accessIPv6": "", "status": "ACTIVE", "progress": 0, "hostId": "c7145889b2e3202cd295ceddb1742ff8941b827b586861fd0acedf64", "updated": "2018-09-13T07:06:51Z", "created": "2018-09-13T07:03:44Z", "metadata": { "metering.order_id": "CS1809131459IGC24", "image_name": "Public_Cloudinit_Oracle_Linux_7.4_64bit_40G", "metering.resourcespeccode": "s3.large.1", "charging_mode": "1", "vpc_id": "0431c5e5-bc94-4a44-8263-15da2a642435", "os_type": "Linux", "metering.resourcetype": "1", "metering.image_id": "c71b64e7-4767-4406-afde-2c7c7ac2242c", "os_bit": "64", "__support_agent_list": "hss,ces", "cascaded.instance_extrainfo": "pcibridge:2", "metering.imagetype": "gold" }, "tags": [ ], "description": "", "locked": false, "config_drive": "", "tenant_id": "ff2eb406effc455aba53174463eb9322", "user_id": "0bc5e11f91dd48849bb03b7c8a263b2c", "key_name": "KeyPair-d750", "os-extended-volumes:volumes_attached": [ { "id": "80c15cff-2473-4982-a816-d760cad6c42c", "delete_on_termination": "false", "device": "/dev/vda", "bootIndex": "0" } ], "OS-EXT-STS:task_state": null, "OS-EXT-STS:power_state": 1, "OS-EXT-STS:vm_state": "active", "OS-EXT-SRV-ATTR:host": "az21.dc1", "OS-EXT-SRV-ATTR:instance_name": "instance-0015147f", "OS-EXT-SRV-ATTR:hypervisor_hostname": "nova003@74", "OS-DCF:diskConfig": "MANUAL", "OS-EXT-AZ:availability_zone": "az1-dc1", "os:scheduler_hints": { }, "OS-EXT-SRV-ATTR:root_device_name": "/dev/vda", "OS-EXT-SRV-ATTR:ramdisk_id": "", "OS-EXT-SRV-ATTR:user_data": null, "OS-SRV-USG:launched_at": "2018-09-13T07:04:09.197749", "OS-EXT-SRV-ATTR:kernel_id": "", "OS-EXT-SRV-ATTR:launch_index": 0, "host_status": "UP", "OS-EXT-SRV-ATTR:reservation_id": "r-nrd8b5c4", "OS-EXT-SRV-ATTR:hostname": "ecs-2ecf", "OS-SRV-USG:terminated_at": null, "sys_tags": [ { "key": "_sys_enterprise_project_id", "value": "0" } ], "security_groups": [ { "id": "6505b5d1-7837-41eb-8a1c-869d4355baa3", "name": "sg-95ec" } ], "image": { "id": "c71b64e7-4767-4406-afde-2c7c7ac2242c" }, "hypervisor": null, "auto_terminate_time": "", "cpu_options": { "hw:cpu_threads": null }, "enclave_options": { "enabled": false }, "capacity_reservation_id": null, "capacity_reservation_specification": { "id": null, "preference": null }, "security_options": { "secure_boot_enabled": null, "tpm_enabled": null }, "spod_id": null } }
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