• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Nova
  5. ECSs
  6. Querying Details About ECSs

Querying Details About ECSs

Function Description

This interface is used to query details about ECSs.

URI

  • URI format

    GET /v2/{tenant_id}/servers/detail{?changes-since,image,flavor,name,status,limit,marker,not-tags,reservation_id}

    GET /v2.1/{tenant_id}/servers/detail{?changes-since,image,flavor,name,status,limit,marker,not-tags,reservation_id}

  • Parameter description

    Parameter

    Mandatory

    Description

    tenant_id

    Yes

    Specifies the tenant or project ID.

Request

Parameter

Mandatory

Type

Description

changes-since

No

String:DateTime

Specifies the timestamp when the ECS status was updated last time. The timestamp format is UTC.

image

No

String

Specifies the image ID.

When image is used as a filter criterion, other filter criteria and paging criteria are not supported. If both the image and other filter criteria are specified, the image filter criterion prevails. If the query criteria do not contain the image filter criterion, interface functions are not restricted.

flavor

No

String

Specifies the ECS flavor ID.

name

No

String

Specifies the ECS name.

status

No

String

Specifies the ECS status.

Options:

ACTIVE, BUILD, ERROR, HARD_REBOOT, MIGRATING, REBOOT, RESIZE, REVERT_RESIZE, SHELVED, SHELVED_OFFLOADED, SHUTOFF, and VERIFY_RESIZE

limit

No

Integer

Specifies the upper limit on the number of returned results.

marker

No

String

Specifies the marker that points the ECS ID. The query will start from its next ID.

not-tags

No

String

Queries ECSs whose tag field does not contain the specified value.

reservation_id

No

String

Specifies the ID returned when ECSs are created in a batch. This parameter is used to query ECSs created in a batch.

Response

Parameter

Type

Description

servers

List data structure

Specifies the ECSs to be queried. For details, see Table 1.

servers_links

List data structure

Specifies the link of the next page in pagination query. For details, see Table 4.

Table 1 servers field description

Parameter

Type

Description

name

String

Specifies the ECS name.

id

String

Specifies an ECS uniquely.

status

String

Specifies the ECS status.

Options:

ACTIVE, BUILD, DELETED, ERROR, HARD_REBOOT, MIGRATING, REBOOT, RESIZE, REVERT_RESIZE, SHELVED, SHELVED_OFFLOADED, SHUTOFF, UNKNOWN, and VERIFY_RESIZE

created

String:DateTime

Specifies the time when the ECS was created.

updated

String:DateTime

Specifies the time when the ECS was updated last time.

flavor

Dictionary data structure

Specifies the ECS flavor.

For details, see Table 2.

image

String

Specifies the ECS image.

If an ECS is created using an image, this field is an image ID and link. If an ECS is created using a volume, this field is empty.

You can use the attribute in metadata to obtain the image information.

tenant_id

String

Specifies the ID of the tenant to which the ECS belongs.

key_name

String

Specifies the SSH key name.

user_id

String

Specifies the ID of the user to which the ECS belongs.

metadata

Dictionary data structure

Specifies ECS metadata.

hostId

String

Specifies the host ID of the ECS.

addresses

Dictionary data structure

Specifies the network addresses of the ECS.

For details, see Table 3.

security_groups

List data structure

Specifies the security groups to which the ECS belongs.

For details, see Table 7.

links

List data structure

Specifies ECS shortcut links.

For details, see Table 4.

OS-DCF:diskConfig

String

Specifies the disk configuration mode. This is an extended attribute. This field is valid for the ECS started using an image.

Options:

  • AUTO: This API uses a single partition to build an ECS with the target disk size. The API automatically adjusts the file system to adapt to the entire partition.
  • MANUAL: This API uses the partitioning scheme in the source image and the file system to build the ECS. If the target disk size is large, the API does not partition the remaining disk space.

OS-EXT-AZ:availability_zone

String

Specifies the AZ ID. This is an extended attribute.

OS-EXT-SRV-ATTR:host

String

Specifies the name of the host on which the ECS is deployed. This is an extended attribute.

OS-EXT-SRV-ATTR:hypervisor_hostname

String

Specifies the hostname of the hypervisor. This is an extended attribute.

OS-EXT-SRV-ATTR:instance_name

String

Specifies the ECS ID. This is an extended attribute.

OS-EXT-STS:power_state

Integer

Specifies the ECS power status. This is an extended attribute.

Options: 0, 1, 2, 3, and 4

  • 0: pending
  • 1: running
  • 2: paused
  • 3: shutdown
  • 4: crashed

OS-EXT-STS:task_state

String

Specifies the ECS task status. This is an extended attribute.

Options:

SHOUTOFF, RESIZE, REBUILD, VERIFY_RESIZE, REVERT_RESIZE, PAUSED, MIGRATING, SUSPENDED, RESCUE, ERROR, DELETED, SHELVED, and SHELVED_OFFLOADED

OS-EXT-STS:vm_state

String

Specifies the ECS status. This is an extended attribute.

Options:

ACTIVE, BUILDING, STOPPED, PAUSED, SUSPENDED, RESCUED, ERROR, DELETED, SOFT_DELETED, SHELVED, and SHELVED_OFFLOADED

OS-SRV-USG:launched_at

String:DateTime

Specifies the time when the ECS was started. This is an extended attribute.

OS-SRV-USG:terminated_at

String:DateTime

Specifies the time when the ECS was stopped. This is an extended attribute.

os-extended-volumes:volumes_attached

List data structure

Specifies information about the EVS disks attached to the ECS.

For details, see Table 6.

tags

String list

Specifies ECS tags.

accessIPv4

String

Reserved

accessIPv6

String

Reserved

config_drive

String

Reserved

evsOpts

Integer

Reserved

hyperThreadAffinity

String

Reserved

numaOpts

Integer

Reserved

progress

Integer

Reserved

vcpuAffinity

Integer list

Reserved

Table 2 flavor field description

Parameter

Type

Description

id

String

Specifies the ECS type ID.

links

List data structure

Specifies shortcut links for ECS types. For details, see Table 4.

Table 3 addresses field description

Parameter

Type

Description

Name of the network where the ECS accesses

List data structure

Specifies the network information of the ECS.

  • key indicates the network name, for example, demo_net.
  • value indicates the detailed network information.

For details, see Table 5.

Table 4 servers_links and links field description

Parameter

Type

Description

rel

String

Specifies the shortcut link marker name.

href

String

Specifies the shortcut link.

Table 5 Data structure of the network which an ECS accesses

Parameter

Type

Description

addr

String

Specifies the IP address.

version

Integer

Specifies the type of the IP address. The value of this parameter can be 4 or 6.

  • 4: The type of the IP address is IPv4.
  • 6: The type of the IP address is IPv6.

OS-EXT-IPS-MAC:mac_addr

String

Specifies the MAC address. This is an extended attribute.

OS-EXT-IPS:type

String

Specifies the IP address assignment mode. This is an extended attribute.

Table 6 os-extended-volumes:volumes_attached field description

Parameter

Type

Description

id

String

Specifies the EVS disk ID.

Table 7 security_groups field description

Parameter

Type

Description

name

String

Specifies the security group name or UUID.

Example response

{
    "servers": [
        {
            "addresses": {
                "68269e6e-4a27-441b-8029-35373ad50bd9": [
                    {
                        "addr": "192.168.0.3", 
                        "version": 4
                    }
                ]
            }, 
            "created": "2012-09-07T16:56:37Z", 
            "flavor": {
                "id": "1", 
                "links": [
                    {
                        "href": "http://openstack.example.com/openstack/flavors/1", 
                        "rel": "bookmark"
                    }
                ]
            }, 
            "hostId": "16d193736a5cfdb60c697ca27ad071d6126fa13baeb670fc9d10645e", 
            "id": "05184ba3-00ba-4fbc-b7a2-03b62b884931", 
            "image": "", 
            "links": [
                {
                    "href": "http://openstack.example.com/v2/openstack/servers/05184ba3-00ba-4fbc-b7a2-03b62b884931", 
                    "rel": "self"
                }, 
                {
                    "href": "http://openstack.example.com/openstack/servers/05184ba3-00ba-4fbc-b7a2-03b62b884931", 
                    "rel": "bookmark"
                }
            ], 
            "metadata": {},                         
            "name": "new-server-test", 
            "progress": 0, 
            "status": "ACTIVE", 
            "tenant_id": "openstack", 
            "updated": "2012-09-07T16:56:37Z", 
            "user_id": "fake"
        }
    ]
}

Returned Value

See General Request Returned Values.