Listing ECSs
Function
This API is used to list ECSs and obtain their details based on the search criteria.
URI
GET /v1.1/{project_id}/cloudservers/detail
Parameter |
Mandatory |
Description |
---|---|---|
project_id |
Yes |
Specifies the project ID. For details about how to obtain the ID, see Obtaining a Project ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
marker |
No |
String |
Definition Specifies the ID of the last server on each page as the paging marker. Constraints N/A Range N/A Default Value N/A |
flavor_name |
No |
String |
Definition Specifies the name of the ECS flavor. For details about available flavors, see A Summary List of x86 ECS Specifications. Constraints N/A Range N/A Default Value N/A |
name |
No |
String |
Definition Specifies the cloud name. Fuzzy match is supported. Constraints Periods (.) are supported to match any single characters except \n and \r. A period is equal to [^\n\r]. Range N/A Default Value N/A |
status |
No |
String |
Definition Specifies the ECS status. Constraints N/A Range ACTIVE, BUILD, ERROR, HARD_REBOOT, MIGRATING, REBOOT, REBUILD, RESIZE, REVERT_RESIZE, SHUTOFF, and VERIFY_RESIZE For details about the ECS status, see ECS Statuses.
NOTE:
When an ECS is in an intermediate state, the statuses that can be obtained are as follows:
Default Value N/A |
limit |
No |
Integer |
Definition Specifies the maximum number of ECSs on one page. Constraints Each page contains 10 ECSs by default and a maximum of 100 ECSs. Range N/A Default Value N/A |
tags |
No |
String |
Definition Queries ECSs whose tags contain the specified value. Constraints N/A Range N/A Default Value N/A |
not-tags |
No |
String |
Definition Queries ECSs whose tags do not contain the specified value. For example, if the queried ECS list should not contain BMSs, set this parameter as follows: not-tags=__type_baremetal Constraints N/A Range N/A Default Value N/A |
project_id |
No |
String |
Definition Specifies the project ID. Constraints N/A Range N/A Default Value N/A |
availability_zone_eq |
No |
String |
Definition Specifies the AZ where the ECS resides. The matching rule is exact match. Constraints N/A Range N/A Default Value N/A |
id |
No |
String |
Definition Specifies the ECS ID in the UUID format, which is exactly matched. For example: id={id1}&id={id2}. Constraints N/A Range N/A Default Value N/A |
in_recycle_bin |
No |
Boolean |
Definition Specifies whether the ECS is in the recycle bin. Constraints N/A Range N/A Default Value N/A |
spod_id |
No |
String |
Definition Specifies the ID of the batch of ECSs provisioned by rack in the same resource pool. Constraints N/A Range N/A Default Value N/A |
metadata |
No |
Object |
Definition Specifies the ECS metadata.
NOTE:
Metadata includes system default fields and the fields set by users. Constraints N/A Range N/A Default Value N/A |
metadata-key |
No |
String |
Definition Filters ECSs whose key of the metadata field contains a specified value. Constraints N/A Range N/A Default Value N/A |
charging_mode |
No |
String |
Definition Specifies the ECS billing mode. Constraints N/A Range N/A Default Value N/A |
key_name |
No |
String |
Definition Specifies the key pair that is used to authenticate an ECS. Constraints N/A Range N/A Default Value N/A |
launched_since |
No |
String |
Definition Filters ECSs that are started after the time specified by launched_since. The parameter is in ISO 8601 time format, for example, 2013-06-09T06:42:18Z. Constraints N/A Range N/A Default Value N/A |
expect-fields |
No |
String |
Definition Controls the query output. It controls whether to query based on the default field. Constraints N/A Range
Default Value N/A |
Request
None
Response
Parameter |
Type |
Description |
---|---|---|
servers |
Array of objects |
Definition Queries details about ECSs. For details, see Table 5. Range N/A |
servers_links |
Array of objects |
Definition Specifies the link of the next page in pagination query. For details, see Table 4. Range N/A |
request_id |
String |
Definition Specifies the request ID. Range N/A |
Parameter |
Type |
Description |
---|---|---|
href |
String |
Definition Specifies the resource link. Range N/A |
rel |
String |
Definition Provides the corresponding shortcut link. Range N/A |
Parameter |
Type |
Description |
---|---|---|
tenant_id |
String |
Definition Specifies the ID of the tenant that the ECS belongs to, in UUID format. It is the same as the project ID. Range N/A |
vm_state |
String |
Definition Specifies a stable ECS state after an operation is complete. Range N/A |
flavor |
Object |
Definition Specifies ECS flavor information. For details, see Table 2. Range N/A |
availability_zone |
String |
Definition Specifies the name of the AZ where the ECS is located. Range N/A |
user_id |
String |
Definition Specifies the ID of the user for creating an ECS, in UUID format. 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 |
name |
String |
Definition Specifies the ECS name. Range N/A |
task_state |
String |
Definition Specifies the task status of the ECS. Range N/A |
id |
String |
Definition Specifies the ECS ID in UUID format. Range N/A |
status |
String |
Definition Specifies the ECS status. Range N/A |
market_info |
Object |
Definition Specifies ECS billing information. For details, see Table 6. Range N/A |
availability_zone |
String |
Definition Specifies the AZ where the ECS is located. Range N/A |
power_state |
Integer |
Definition Specifies the ECS power status. Range
|
in_recycle_bin |
Boolean |
Definition Specifies whether the ECS is in the recycle bin. Range N/A |
spod_id |
String |
Definition Specifies the ID of the batch of ECSs provisioned by rack in the same resource pool. Range N/A |
created |
String |
Definition Specifies the time when the ECS was created. The time is in the format of "2020-05-22T07:48:53Z". Range N/A |
updated |
String |
Definition Specifies the time when the ECS was updated last time. The time is in the format of "2020-05-22T07:48:53Z". Range N/A |
launched_at |
String |
Definition Specifies the time when the ECS was started. The time is in the format of "2020-05-22T07:48:53.000000". Range N/A |
description |
String |
Definition Specifies the description of the ECS. Range N/A |
key_name |
String |
Definition Specifies the key pair that is used to authenticate an ECS. Range N/A |
locked |
Boolean |
Definition Specifies whether an ECS is locked. Range
|
root_device_name |
String |
Definition Specifies the device name of the ECS system disk. For example, if the system disk device type is VBD, the device name is /dev/vda. Range N/A |
tenancy |
String |
Definition Specifies whether to create ECSs on a DeH or in a shared pool. By default, ECSs are created in a shared pool. Range
|
dedicated_host_id |
String |
Definition Specifies the DeH ID. This parameter is valid only when tenancy is dedicated. If this parameter is not specified, the system automatically allocates a DeH for the tenant to deploy ECSs. Range N/A |
enterprise_project_id |
String |
Definition Queries the ECSs that are associated with an enterprise project. To obtain the ECSs associated with all enterprise projects of the user, set all_granted_eps. Range N/A |
metadata |
Object |
Definition Specifies the ECS metadata. Range N/A |
tags |
Array of strings |
Definition Specifies the list of ECS tags. Range N/A |
addresses |
Object |
Definition Specifies the network addresses of an ECS. The structure is Map<String, Object>. Range
|
security_groups |
Array of objects |
Definition Specifies the security group associated with the ECS. For details, see Table 3. Range N/A |
volumes_attached |
Array of objects |
Definition Specifies information about the disks attached to the ECS. For details, see Table 10. Range N/A |
image |
Object |
Definition Specifies the ECS image. For details, see Table 7. Range N/A |
fault |
Object |
Definition Specifies the ECS failure cause. Range
|
cpu_options |
Object |
Definition Specifies the CPU options. For details, see Table 11. Range N/A |
Parameter |
Type |
Description |
---|---|---|
charge_mode |
String |
Definition Specifies the ECS billing mode. Range
|
prepaid_info |
Object |
Definition Specifies the information about the yearly/monthly ECS. For details, see Table 8. Range N/A |
Parameter |
Type |
Description |
---|---|---|
version |
Integer |
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 |
---|---|---|
expired_time |
String |
Definition Specifies the expiration time of the yearly/monthly ECS. The time is in the format of "2020-05-22T07:48:53Z". Range N/A |
Parameter |
Type |
Description |
---|---|---|
code |
Integer |
Definition Specifies an error code. The format is int32. Range N/A |
created |
String |
Definition Specifies the time when an exception occurred. The time is in ISO 8601 format. Range N/A |
message |
String |
Definition Describes an error. Range N/A |
details |
String |
Definition Specifies details about an error. Range N/A |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Definition Specifies the disk ID in UUID format. Range N/A |
delete_on_termination |
Boolean |
Definition Specifies whether to delete the attached disks when deleting the ECS. This parameter is supported in microversion 2.3 and later. Range
|
bootIndex |
String |
Definition Specifies the EVS disk boot sequence. Range
|
device |
String |
Definition Specifies the drive letter of the EVS disk, which is the device name of the EVS disk. Range N/A |
size |
Integer |
Definition Specifies the disk size in GiB. 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
|
Example Request
GET https://{endpoint}/v1.1/{project_id}/cloudservers/detail
Example Response
{ "servers": [ { "tenant_id": "edcb94a885a84ed3a3fdf8ea4d2741da", "vm_state": "active", "flavor": { "disk": 0, "name": "s2.medium.2", "id": "s2.medium.2", "vcpus": 1, "ram": 2048, "gpus":[], "asic_accelerators":[] }, "availability_zone": "az1-dc1", "user_id": "bb7f23e27e7e46f3aaceb5f53a158bdc", "created": "2023-03-18T09:02:36Z", "name": "ecs-5e70", "task_state": null, "in_recycle_bin": false, "id": "b37fd80e-ac67-4d02-b9f1-9891c9c0fabf", "updated": "2023-03-18T09:08:54Z", "spod_id": null, "status": "ACTIVE" }, { "tenant_id": "edcb94a885a84ed3a3fdf8ea4d2741da", "vm_state": "active", "flavor": { "disk": 0, "name": "s3.small.1", "id": "s3.small.1", "vcpus": 1, "ram": 1024, "gpus":[], "asic_accelerators":[] }, "availability_zone": "az1-dc1", "user_id": "bb7f23e27e7e46f3aaceb5f53a158bdc", "created": "2023-03-18T04:29:44Z", "name": "ecs-f680", "task_state": null, "in_recycle_bin": false, "id": "8380dcc9-0eac-4407-9f9e-df8c9eddeacd", "updated": "2023-03-18T04:40:25Z", "spod_id": null, "status": "ACTIVE" } ], "servers_links": [ { "rel": "next", "href": "" } ], "request_id": "2da856f5-95e6-437f-9f8b-ae7dc00a9ace" }
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