• 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 details about an ECS based on the ECS ID.

URI

  • URI format

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

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

  • Parameter description

    Parameter

    Mandatory

    Description

    tenant_id

    Yes

    Specifies the tenant or project ID.

    server_id

    Yes

    Specifies the ECS ID.

Request

N/A

Response

  • Parameter description

    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_REBOOTMIGRATINGREBOOTRESIZEREVERT_RESIZESHELVEDSHELVED_OFFLOADEDSHUTOFFUNKNOWN, 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 1.

    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 2.

    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 ECSs belong. For details, see Table 7.

    links

    List data structure

    Specifies shortcut links for ECS markers. 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 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

    Integero

    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 6.

    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 1 flavor field description

    Parameter

    Type

    Description

    id

    String

    Specifies the type ID of the ECS.

    links

    List data structure

    Specifies the shortcut links of the ECS specifications markers.

    For details, see Table 4.

    Table 2 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 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 links field description

    Parameter

    Type

    Description

    rel

    String

    Specifies the shortcut link marker name.

    href

    String

    Provides the corresponding 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
    {
        "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.