• Elastic Cloud Server

ecs
  1. Help Center
  2. Elastic Cloud Server
  3. API Reference
  4. OpenStack Nova APIs
  5. Lifecycle Management
  6. Querying Details About an ECS

Querying Details About an ECS

Function Description

This interface is used to query details about an ECS based on the ECS ID.

URI

GET /v2/{project_id}/servers/{server_id}

GET /v2.1/{project_id}/servers/{server_id}

Table 1 describes the parameters in the URI.
Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

server_id

Yes

Specifies the ECS ID.

Request

N/A

Response

Response parameters

Table 2 describes the response parameters.
Table 2 Response parameters

Parameter

Type

Description

name

String

Specifies the ECS name.

id

String

Specifies the unique identifier of the ECS.

status

String

Specifies the status of the ECS.

Options:

ACTIVEBUILDDELETEDERRORHARD_REBOOTMIGRATINGPASSWORDPAUSEDREBOOTREBUILDRESIZEREVERT_RESIZESHUTOFFSHELVEDSHELVED_OFFLOADEDSOFT_DELETEDSUSPENDED, 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 ECS flavors. For details, see Table 3.

image

Dictionary data structure

Specifies the ECS image information. If an ECS created using an image, the image ID and link are returned. If an ECS created using a volume, this attribute is empty. You can use the attribute in metadata to obtain the image information.

For details, see Table 4.

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 an 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 an ECS. For details, see Table 5.

security_groups

List data structure

Specifies the security groups to which ECSs belong. For details, see Table 9.

links

List data structure

Specifies shortcut links for ECS markers. For details, see Table 6.

tags

String list

Specifies ECS tags.

In microversion 2.26, if the microversion is not used for query, the response does not contain the tags field.

Tag functions have been upgraded on the public cloud. After the upgrade, the tag values returned by the system comply with the following rules:
  • The key and value of a tag are connected using an equal sign (=), for example, key=value.
  • If the value is empty, only the key is returned.
  • The key and value of a tag are connected using an equal sign (=), for example, key=value.
  • If the value is empty, only the key is returned.

For more details about upgraded tag functions, see section Tag Types.

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 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 alias. 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:

SHOUTOFFRESIZEREBUILDVERIFY_RESIZEREVERT_RESIZEPAUSEDMIGRATINGSUSPENDEDRESCUEERRORDELETEDSOFT_DELETEDSHELVED, and SHELVED_OFFLOADED

OS-EXT-STS:vm_state

String

Specifies the ECS status. This is an extended attribute.

Options:

ACTIVEBUILDINGSTOPPEDRESIZEDPAUSEDSUSPENDEDRESCUEDERRORDELETEDSOFT_DELETEDSHELVEDSHELVED_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 the EVS disks attached to an ECS. For details, see Table 8.

locked

Boolean

Specifies the ECS lock status, which is True when the ECS is locked and False when the ECS is unlocked.

This field is supported in microversions later than 2.9.

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 structure

Reserved

Table 3 flavor field description

Parameter

Type

Description

id

String

Specifies the type ID of an ECS.

This field is not supported in microversions later than 2.47.

links

List data structure

Specifies the shortcut links of the ECS specifications markers.

For details, see Table 6.

This field is not supported in microversions later than 2.47.

vcpus

Integer

Specifies the number of vCPUs in the ECS flavor.

This field is supported in microversions later than 2.47.

ram

Integer

Specifies the memory size (MB) in the ECS flavor.

This field is supported in microversions later than 2.47.

disk

Integer

Specifies the system disk size in the ECS flavor. The value 0 indicates that the disk size is not limited.

This field is supported in microversions later than 2.47.

ephemeral

Integer

Reserved

This field is supported in microversions later than 2.47.

swap

Integer

Reserved

This field is supported in microversions later than 2.47.

original_name

String

Reserved

This field is supported in microversions later than 2.47.

extra_specs

dict

Extended flavor field

This field is supported in microversions later than 2.47.

Table 4 image field description

Parameter

Type

Description

id

String

Specifies the image ID.

links

List data structure

Specifies shortcut links for ECS images. For details, see Table 6.

Table 5 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 7.

Table 6 links field description

Parameter

Type

Description

rel

String

Specifies the shortcut link marker name.

href

String

Provides the corresponding shortcut link.

Table 7 Data structure of the network which an ECS accesses

Parameter

Type

Description

addr

String

Specifies the IP address.

version

Integer

Specifies the type of an 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 8 os-extended-volumes:volumes_attached field description

Parameter

Type

Description

id

String

Specifies the EVS disk ID.

Table 9 security_groups field description

Parameter

Type

Description

name

String

Specifies the security group name or UUID.

Examples

  • Example response
    {
        "server": {
            "addresses": {
                "68269e6e-4a27-441b-8029-35373ad50bd9": [
    {
                        "addr": "192.168.0.3", 
                        "version": 4
                    }
                ]
            }, 
            "created": "2012-08-20T21:11:09Z", 
            "flavor": {
                "id": "1", 
                "links": [
                    {
                        "href": "http://openstack.example.com/openstack/flavors/1", 
                        "rel": "bookmark"
                    }
                ]
            }, 
            "hostId": "65201c14a29663e06d0748e561207d998b343e1d164bfa0aafa9c45d", 
            "id": "893c7791-f1df-4c3d-8383-3caae9656c62", 
            "image": "", 
                "links": [
                {
                    "href": "http://openstack.example.com/v2/openstack/servers/893c7791-f1df-4c3d-8383-3caae9656c62", 
                    "rel": "self"
                }, 
                {
                    "href": "http://openstack.example.com/openstack/servers/893c7791-f1df-4c3d-8383-3caae9656c62", 
                    "rel": "bookmark"
                }
            ], 
            "metadata": {},
            "name": "new-server-test", 
            "progress": 0, 
            "status": "ACTIVE", 
            "tenant_id": "openstack", 
            "updated": "2012-08-20T21:11:09Z", 
            "user_id": "fake"
        }
    }

Returned Values

See General Request Returned Values.