• Native OpenStack API

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

Querying ECS Details

Function Description

This interface is used to query ECS details. The interface reads the ECS information from the database and returns the information.

Interface Format

Method

URI

Description

GET

/v2/{tenant_id}/servers/{server_id}

/v2.1/{tenant_id}/servers/{server_id}

Queries ECS details.

Restrictions

N/A

Expanded Interface

N/A

Request Parameter

N/A

Response Parameter

Parameter

Type

Mandatory

Description

status

String

Yes

Specifies the ECS status, including ACTIVE, REBOOT, HARD_REBOOT, REBUILD, MIGRATING, BUILD, SHUTOFF, RESIZE, VERIFY_RESIZE, ERROR, and DELETED.

updated

String

Yes

Specifies the time when the ECS was updated.

hostId

String

Yes

Specifies the ID of the host on which the ECS is deployed.

OS-EXT-SRV-ATTR:host

String

Yes

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

addresses

Dict(str:list)

Yes

Specifies the network attribute of the ECS.

links

List(Dict)

Yes

Specifies the description of the ECS.

key_name

String

Yes

Specifies the key pair name of the ECS.

image

Dict

Yes

Specifies the ECS image information.

OS-EXT-STS:task_state

String

Yes

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

OS-EXT-STS:vm_state

String

Yes

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

OS-EXT-SRV-ATTR:instance_name

String

Yes

Specifies the ECS alias. This is an extended attribute.

OS-EXT-SRV-ATTR:hypervisor_hostname

String

Yes

Specifies the name of the host accommodating the ECS. This is an extended attribute.

flavor

Dict

Yes

Specifies the ECS flavor.

id

UUID

Yes

Specifies the ECS UUID.

security_groups

List(Dict)

Yes

Specifies the security group of the ECS.

OS-EXT-AZ:availability_zone

String

Yes

Specifies the AZ of the ECS. This is an extended attribute.

user_id

UUID

Yes

Specifies the user UUID of the ECS.

name

String

Yes

Specifies the ECS name.

created

String

Yes

Specifies the time when the ECS was created.

tenant_id

UUID

Yes

Specifies the UUID of the tenant who owns the ECS.

OS-DCF:diskConfig

String

Yes

Extended attribute. Specifies the disk configuration method.

  • MANUAL: The image space of the system disk cannot be expanded.
  • AUTO: The image space of the system disk can be automatically expanded to a value same as that specified in flavor.

accessIPv4

String

Yes

Not used

accessIPv6

String

Yes

Not used

fault

Dict

Yes

Specifies the failure cause of the ECS.

progress

Int

Yes

Specifies the ECS creation progress.

OS-EXT-STS:power_state

Int

No

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

config_drive

String

Yes

Specifies the config-drive disk information

metadata

Dict

Yes

Specifies the ECS metadata.

OS-SRV-USG:launched_at

String

Yes

Specifies the time when the ECS was started.

OS-SRV-USG:terminated_at

String

Yes

Specifies the time when the ECS was deleted.

os-extended-volumes:volumes_attached

List(Dict)

Yes

Specifies the volume attached to the ECS.

os-extended-volumes:volumes_attached.delete_on_termination

Bool

Yes

Specifies the bit indicating whether volumes attached to an ECS will be deleted when the ECS is deleted.

This field is newly added in version 2.3.

host_status

String

Yes

Specifies the host status.

This field is newly added in version 2.16.

OS-EXT-SRV-ATTR:reservation_id

UUID

Yes

Specifies the order ID.

This field is newly added in version 2.3.

OS-EXT-SRV-ATTR:hostname

String

Yes

Specifies the host name of the ECS.

This field is newly added in version 2.3.

OS-EXT-SRV-ATTR:launch_index

Integer

Yes

Specifies the ECS startup sequence in batch startup scenarios.

This field is newly added in version 2.3.

OS-EXT-SRV-ATTR:ramdisk_id

UUID

Yes

Specifies the ramdisk image UUID when AMI is used.

This field is newly added in version 2.3.

OS-EXT-SRV-ATTR:root_device_name

String

Yes

Specifies the device name of the ECS system disk.

This field is newly added in version 2.3.

OS-EXT-SRV-ATTR:user_data

String

Yes

Specifies the user data injected when an ECS is created.

This field is newly added in version 2.3.

locked

Bool

Yes

The value of this parameter is True when the ECS is locked. Otherwise, the value is False.

This field is newly added in version 2.9.

The following tables list parameters involved in the network attribute.

Table 1 addresses parameter

Parameter

Type

Mandatory

Description

Network information of the ECS

Dict(str:list)

Yes

Specifies the network information of the ECS. The key is the network name, such as demo_net. The value indicates the detailed network information. For details about the value, see the following table.

Table 2 address parameters

Parameter

Type

Mandatory

Description

version

Int

Yes

Specifies the IP address version. The value can be 4 or 6. 4 indicates IPv4, and 6 indicates IPv6.

addr

String

Yes

Specifies the IP address.

OS-EXT-IPS:type

String

Yes

Specifies the IP address type. The value can be fixed or floating. fixed indicates a private IP address, and floating indicates a floating IP address.

OS-EXT-IPS-MAC:mac_addr

String

Yes

Specifies the MAC address.

The following table lists parameters involved in the image attribute.

Table 3 image parameters

Parameter

Type

Mandatory

Description

id

UUID

Yes

Specifies the image UUID.

links

List(Dict)

Yes

Specifies the shortcut link of the image.

The following table lists parameters involved in the flavor attribute.

Table 4 flavor parameters

Parameter

Type

Mandatory

Description

id

String

Yes

Specifies the ECS flavor ID.

links

List(Dict)

Yes

Provides the shortcut link to the ECS flavors.

The following table lists parameters involved in the security group attribute.

Table 5 security_groups parameters

Parameter

Type

Mandatory

Description

name

String

Yes

Specifies the security group name or UUID.

The following table lists parameters involved in the fault information attribute.

Table 6 fault parameters

Parameter

Type

Mandatory

Description

message

String

Yes

Specifies the fault information.

code

Int

Yes

Specifies the fault code.

details

String

No

Specifies the fault details.

created

String

Yes

Specifies the time when the fault occurred in ISO 8601 format.

The following table lists the parameter involved in the volume attribute.

Table 7 os-extended-volumes:volumes_attached parameter

Parameter

Type

Mandatory

Description

id

UUID

Yes

Specifies the UUID of the volume.

Table 8 links parameters

Parameter

Type

Mandatory

Description

href

String

Yes

Specifies the URL.

ref

String

Yes

The value can be:

  • self: A self link contains the versioned link to the resource. Use these links when the link is followed immediately.
  • bookmark: A bookmark link provides a permanent link to a resource, which is suitable for long-term storage.

Request Example

GET /v2/9c53a566cb3443ab910cf0daebca90c4/servers/998af54b-5762-4041-abc1-f98a2c27b3a2

GET /v2.1/9c53a566cb3443ab910cf0daebca90c4/servers/998af54b-5762-4041-abc1-f98a2c27b3a2

Response Example

{
    "server": {
        "OS-EXT-STS:task_state": null,
        "addresses": {
            "testnet": [{
                "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:00:04:bb",
                "version": 4,
                "addr": "10.10.0.15",
                "OS-EXT-IPS:type": "fixed"
            }]
        },
        "links": [{
            "href": "http://172.25.150.139:8774/v2/474eff20eee84b2e87b5717cc7f34dd8/servers/998af54b-5762-4041-abc1-f98a2c27b3a2",
            "rel": "self"
        },
        {
            "href": "http://172.25.150.139:8774/474eff20eee84b2e87b5717cc7f34dd8/servers/998af54b-5762-4041-abc1-f98a2c27b3a2",
            "rel": "bookmark"
        }],
        "image": {
            "id": "5ff5f101-67dc-42c7-9cd6-f4ebac86e8df",
            "links": [{
                "href": "http://172.25.150.139:8774/474eff20eee84b2e87b5717cc7f34dd8/images/5ff5f101-67dc-42c7-9cd6-f4ebac86e8df",
                "rel": "bookmark"
            }]
        },
        "OS-EXT-STS:vm_state": "stopped",
        "OS-EXT-SRV-ATTR:instance_name": "instance-0000001b",
        "OS-SRV-USG:launched_at": "2014-12-16T03:57:12.000000",
        "flavor": {
            "id": "1",
            "links": [{
                "href": "http://172.25.150.139:8774/474eff20eee84b2e87b5717cc7f34dd8/flavors/1",
                "rel": "bookmark"
            }]
        },
        "id": "998af54b-5762-4041-abc1-f98a2c27b3a2",
        "security_groups": [{
            "name": "default"
        }],
        "progress": 0,
        "group": "",
        "user_id": "dad0fb6cb2b04ca89ffdfd1c1c471d30",
        "OS-DCF:diskConfig": "MANUAL",
        "accessIPv4": "",
        "accessIPv6": "",
        "OS-EXT-STS:power_state": 4,
        "OS-EXT-AZ:availability_zone": "nova",
        "config_drive": "",
        "status": "SHUTOFF",
        "updated": "2014-12-16T04:05:35Z",
        "hostId": "e8316daf354c1631140bdaac8a4ed2cd28f879108fad818a0ad99187",
        "OS-EXT-SRV-ATTR:host": "openstack",
        "OS-SRV-USG:terminated_at": null,
        "key_name": null,
        "OS-EXT-SRV-ATTR:hypervisor_hostname": "openstack.example.com",
        "name": "name_xx2_vm",
        "created": "2014-12-16T03:57:08Z",
        "tenant_id": "474eff20eee84b2e87b5717cc7f34dd8",
        "os-extended-volumes:volumes_attached": [],
        "metadata": {
        }
    }
}

Returned Values

See section General Request Returned Values.

Error Code

Table 9 Task error code

Error Code

Description

404

Instance could not be found

The requested ECS does not exist.