• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Nova
  5. Lifecycle Management
  6. Querying Details About an ECS

Querying Details About an ECS

Function

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

URI

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 an ECS uniquely.

status

String

Specifies the ECS status.

Options:

ACTIVE, BUILD, DELETED, ERROR, HARD_REBOOT, MIGRATING, PAUSED, REBOOT, REBUILD, RESIZE, REVERT_RESIZE, SHUTOFF, SHELVED, SHELVED_OFFLOADED, SOFT_DELETED, SUSPENDED, and VERIFY_RESIZE

created

String:DateTime

Specifies the time when the ECS was created. The time is in the format of "2019-05-22T07:48:19.000000".

updated

String:DateTime

Specifies the time when the ECS was updated last time. The time is in the format of "2019-05-22T07:48:19.000000".

flavor

Dictionary data structure

Specifies ECS flavors. For details, see Table 3.

image

Dictionary data structure

Specifies the ECS image information. If an ECS was created using an image, the image ID and link are returned. If an ECS was created using a disk, 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. The parameter value is the same as the project ID specified by project_id.

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 the 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 the ECS belongs. 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 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:

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

OS-EXT-STS:vm_state

String

Specifies the ECS status. This is an extended attribute.

Options:

ACTIVE, BUILDING, STOPPED, RESIZED, PAUSED, SUSPENDED, RESCUED, ERROR, DELETED, SOFT_DELETED, SHELVED, 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 the EVS disks attached to an ECS. For details, see Table 8.

description

String

Specifies the description of the ECS.

host_status

String

Specifies the nova-compute status.

  • UP: The nova-compute status is normal.
  • UNKNOWN: The nova-compute status is unknown.
  • DOWN: the nova-compute status is abnormal.
  • MAINTENANCE: The nova-compute is in maintenance state.
  • Null: The ECS does not have host information.

OS-EXT-SRV-ATTR:hostname

String

Specifies the ECS hostname.

This field is supported in microversions later than 2.3.

OS-EXT-SRV-ATTR:reservation_id

String

Specifies reserved ECS IDs if ECSs are created in a batch.

This field is supported in microversions later than 2.3.

OS-EXT-SRV-ATTR:launch_index

Int

Specifies the sequence in which ECSs start if the ECSs are created in a batch.

This field is supported in microversions later than 2.3.

OS-EXT-SRV-ATTR:kernel_id

String

Specifies the UUID of the kernel image if an AMI image is used. In other scenarios, leave this parameter blank.

This field is supported in microversions later than 2.3.

OS-EXT-SRV-ATTR:ramdisk_id

String

Specifies the UUID of the Ramdisk image if an AMI image is used. In other scenarios, leave this parameter blank.

This field is supported in microversions later than 2.3.

OS-EXT-SRV-ATTR:root_device_name

String

Specifies the device name of the ECS system disk.

This field is supported in microversions later than 2.3.

OS-EXT-SRV-ATTR:user_data

String

Specifies the user data configured during ECS creation.

This field is supported in microversions later than 2.3.

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 ECS ID.

This field is not supported in microversions later than 2.47.

links

List data structure

Specifies the shortcut links of the ECS type 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

Specifies the name of the ECS flavor.

This field is supported in microversions later than 2.47.

extra_specs

dict

Indicates an 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.

delete_on_termination

boolean

Specifies whether to delete additional disks when deleting the ECS .

By default, this parameter is set to False.

This field is supported in microversions later than 2.3.

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,
                        "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:1b:35:78",
                        "OS-EXT-IPS:type": "fixed"
                    }
                ]
            }, 
            "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.