List details for servers

Overview

Lists details for all servers.

Classification

  • List

API Operation Object

  • servers

Synchronous / Asynchronous

  • synchronous

Request

HTTP Request Method

  • GET

HTTP Request Path

{api_endpoint}/v2/{project_id}/servers/detail

HTTP Request Header

Format

Accept-Encoding: gzip, deflate, compress (optional)
Accept: application/json
X-Auth-Token: <token_id>

HTTP Request Body

Format

  • none

Request Parameter

Request Parameters
name style format description required/optional default value action for invalid parameter response code for invalid parameter
project_id URL UUID(3) Project id required - Terminate 400, 404
token_id Header authentication token string keystone authentication token required - Terminate 401
changes-since Query time/date A time/date stamp for when the server last changed status optional - Terminate 400
status Query String(nolimit) Value of the status of the server so that you can filter on “ACTIVE” for example optional - - -
marker Query UUID UUID of the server at which you want to set a marker. optional - Terminate 400
name Query String(nolimit) Name of the server as a string. optional - - -
limit Query int Integer value for the limit of values to return. optional - Terminate 400
flavor Query String(nolimit) Name of the flavor in URL format. optional - - -
image Query UUID String Name of the image in UUID format. optional - - -

Response

HTTP Response Header

Format

HTTP/1.1 <response_code> <message>       (ex. 200 OK)
  • <response_code>: see “HTTP Responses” section

  • <message>: message based on the response code

    • skip auto insert field such as “X-Compute-Request-Id” and “Content-Length”, “Date”

Response Code

Response Codes
response code condition
200 normal end
400 specified non date format for “changes-since” query
- invalid tenant id
- specified invalid instance id for marker query
- specified non integer for limit query
401 unauthorized
403 query “status = deleted” by non-admin
404 not found a specified project

HTTP Response Body

Format

{
    "servers": [
        {
            "OS-DCF:diskConfig": "<diskconfig>",
            "OS-EXT-AZ:availability_zone": "<availabilityzone>",
            "OS-EXT-SRV-ATTR:host": "<hostname>",
            "OS-EXT-SRV-ATTR:hypervisor_hostname": "<hypervisor_hostname>",
            "OS-EXT-SRV-ATTR:instance_name": "<instance_name>",
            "OS-EXT-STS:power_state": <power_status>,
            "OS-EXT-STS:task_state": "<task_status>",
            "OS-EXT-STS:vm_state": "<vm_status>",
            "OS-SRV-USG:launched_at": "<launch_at>",
            "OS-SRV-USG:terminated_at": <terminated_at>,
            "accessIPv4": "<access_ipv4>",
            "accessIPv6": "<access_ipv6>",
            "addresses": {
                "<network_name>": [
                    {
                        "OS-EXT-IPS-MAC:mac_addr": "<MAC_address>",
                        "OS-EXT-IPS:type": "<address_type>",
                        "addr": "<ip_address>",
                        "version": <ip_address_version>
                    },
                    <<repeat>>
                ]
            },
            "config_drive": "<config_drive>",
            "created": "<created_time>",
            "flavor": {
                "id": "<flavor_id>",
                "links": [
                    {
                        "href": "<flavor_bookmark>",
                        "rel": "bookmark"
                    }
                ]
            },
            "hostId": "<host_id>",
            "id": "<instance_id>",
            "image": {
                "id": "<image_id>",
                "links": [
                    {
                        "href": "<image_bookmark>",
                        "rel": "bookmark"
                    }
                ]
            },
            "key_name": "<key_name>",
            "links": [
                {
                    "href": "<self_management_url>",
                    "rel": "self"
                },
                {
                    "href": "<self_bookmark_url>",
                    "rel": "bookmark"
                }
            ],
            "metadata": {
                "<metadata_key>":"<metadata_value>"
             },
            "name": "<name>",
            "os-extended-volumes:volumes_attached": [
                {
                "id": "<volume_id>"
                 }
            ],
            "progress": <progress>,
            "security_groups": [
                {
                    "name": "<security_group>"
                },
                <<repeat>>
            ],
            "status": "<status>",
            "tenant_id": "<tenant_id>",
            "updated": "<updated_time>",
            "user_id": "<user_id>"
        },
       <<repeat>>
    ]
}

Response Parameter

Response Parameters
item format description
diskconfig MANUAL or AUTO disk config
availabilityzone String(1-255 characters) availabilityzone
hostname String(1-255 characters) host name
hypervisor_hostname String(1-255 characters) host name hypervisor
instance_name String(1-255 characters) instance name
power_status int power status
task_status String(1-255 characters) task status
vm_status String(1-255 characters) vm state
launch_at time/date launch time for instance
terminated_at time/date terminate time for instance
access_ipv4 IPv4address IPv4 address
access_ipv6 IPv6address IPv6 address
network_name String(1-255 characters) network name
MAC_address MAC Address MAC address for instance
address_type fixed or floating types of IP addresses.
ip_address IPv4 address or IPv6 address ip address for instance
ip_address_version int(4 or 6) ip protocol version
created_time time/date created time of instance
config_drive String(1-255 characters) name of config drive
flavor_id String(1-255 characters) flavor id
flavor_bookmark URL String Bookmark URL for flavor
host_id String(1-255 characters) host id
instance_id UUID instance id
image_id UUID image ID
image_bookmark URL String bookmark URL for image
key_name String(1-255 characters) key name
self_management_url URL String management URL for instance
self_bookmark_url URL String bookmark URL for instance
metadata_key String(1-255 characters) metadata key
metadata_value String(1-255 characters) metadata value
name String(1-255 characters) instance name
progress int boot progress for instance
security_group String(1-255 characters) security group name
status String(1-255 characters) state of instance
tenant_id tenant id(2) tenant id
updated_time time/date update time
user_id String(1-255 characters) owner of instance
volume_id UUID volume ID

Sample API Request and Response

Sample API Request

Request URI

https://example.com/v2/{project_id}/servers/detail

Request Header

Accept-Encoding: gzip, deflate, compress (optional)
Accept: application/json
X-Auth-Token: ajk3adjiown02

Request Body

  • none

Sample API Response

Response Header

HTTP/1.1 200 OK
  • <response_code>: see “HTTP Responses” section

  • <message>: message based on the response code

    • skip auto insert field such as “X-Compute-Request-Id” and “Content-Length”, “Date”

Response Body

{
    "servers": [
        {
            "OS-DCF:diskConfig": "<diskconfig>",
            "OS-EXT-AZ:availability_zone": "<availabilityzone>",
            "OS-EXT-SRV-ATTR:host": "<hostname>",
            "OS-EXT-SRV-ATTR:hypervisor_hostname": "<hypervisor_hostname>",
            "OS-EXT-SRV-ATTR:instance_name": "<instance_name>",
            "OS-EXT-STS:power_state": <power_status>,
            "OS-EXT-STS:task_state": "<task_status>",
            "OS-EXT-STS:vm_state": "<vm_status>",
            "OS-SRV-USG:launched_at": "<launch_at>",
            "OS-SRV-USG:terminated_at": <terminated_at>,
            "accessIPv4": "<access_ipv4>",
            "accessIPv6": "<access_ipv6>",
            "addresses": {
                "<network_name>": [
                    {
                        "OS-EXT-IPS-MAC:mac_addr": "<MAC_address>",
                        "OS-EXT-IPS:type": "<address_type>",
                        "addr": "<ip_address>",
                        "version": <ip_address_version>
                    },
                    <<repeat>>
                ]
            },
            "config_drive": "<config_drive>",
            "created": "<created_time>",
            "flavor": {
                "id": "<flavor_id>",
                "links": [
                    {
                        "href": "<flavor_bookmark>",
                        "rel": "bookmark"
                    }
                ]
            },
            "hostId": "<host_id>",
            "id": "<instance_id>",
            "image": {
                "id": "<image_id>",
                "links": [
                    {
                        "href": "<image_bookmark>",
                        "rel": "bookmark"
                    }
                ]
            },
            "key_name": "<key_name>",
            "links": [
                {
                    "href": "<self_management_url>",
                    "rel": "self"
                },
                {
                    "href": "<self_bookmark_url>",
                    "rel": "bookmark"
                }
            ],
            "metadata": {
                "<metadata_key>":"<metadata_value>"
             },
            "name": "<name>",
            "os-extended-volumes:volumes_attached": [
                {
                "id": "<volume_id>"
                 }
            ],
            "progress": <progress>,
            "security_groups": [
                {
                    "name": "<security_group>"
                },
                <<repeat>>
            ],
            "status": "<status>",
            "tenant_id": "<tenant_id>",
            "updated": "<updated_time>",
            "user_id": "<user_id>"
        },
       <<repeat>>
    ]
}

Execution Example

HTTP Request

GET /v2/b322a85578de48beba0f92acce57869b/servers/detail HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.150.51:8774
Accept-Encoding: gzip, deflate, compress
Accept: application/json
X-Auth-Token: 62d528dc0cca4827b0ed465efe1c2588

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1687
X-Compute-Request-Id: req-eab0857b-d274-4b79-9f20-0dda578970c8
Date: Thu, 17 Jul 2014 04:47:23 GMT

{"servers": [{"status": "ACTIVE", "updated": "2014-07-17T01:15:24Z", "hostId": "4429ce15e55a0f84998af45043fdc222f2c7a590d83cf7d36747e64b", "OS-EXT-SRV-ATTR:host": "stack-dev", "addresses": {"private": [{"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:62:8a:5d", "version": 4, "addr": "10.0.0.2", "OS-EXT-IPS:type": "fixed"}]}, "links": [{"href": "http://192.168.150.51:8774/v2/b322a85578de48beba0f92acce57869b/servers/523a0a98-01b8-4c18-acfe-3c4ceb85c0ea", "rel": "self"}, {"href": "http://192.168.150.51:8774/b322a85578de48beba0f92acce57869b/servers/523a0a98-01b8-4c18-acfe-3c4ceb85c0ea", "rel": "bookmark"}], "key_name": null, "image": {"id": "a1f4e8e5-6178-4ea6-924d-61388b642d06", "links": [{"href": "http://192.168.150.51:8774/b322a85578de48beba0f92acce57869b/images/a1f4e8e5-6178-4ea6-924d-61388b642d06", "rel": "bookmark"}]}, "OS-EXT-STS:task_state": null, "OS-EXT-STS:vm_state": "active", "OS-EXT-SRV-ATTR:instance_name": "instance-00000001", "OS-SRV-USG:launched_at": "2014-07-17T01:15:24.000000", "OS-EXT-SRV-ATTR:hypervisor_hostname": "stack-dev", "flavor": {"id": "2", "links": [{"href": "http://192.168.150.51:8774/b322a85578de48beba0f92acce57869b/flavors/2", "rel": "bookmark"}]}, "id": "523a0a98-01b8-4c18-acfe-3c4ceb85c0ea", "security_groups": [{"name": "default"}], "OS-SRV-USG:terminated_at": null, "OS-EXT-AZ:availability_zone": "nova", "user_id": "1a2661f7914c45bcb41f97fa1edfaaec", "name": "Testvm1", "created": "2014-07-17T01:15:19Z", "tenant_id": "b322a85578de48beba0f92acce57869b", "OS-DCF:diskConfig": "MANUAL", "os-extended-volumes:volumes_attached": [], "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 1, "config_drive": "", "metadata": {}}]}

Error Execution Example

HTTP Request

GET /v2/b17a6492bfa54441910e15f07c98384/servers/detail HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8774
X-Auth-Token: 23624b4b115d45c8bef88037c1a6a7b2
Content-type: application/json
Accept: application/json

HTTP Response

HTTP/1.1 400 Bad Request
Content-Length: 187
Content-Type: application/json; charset=UTF-8
X-Compute-Request-Id: req-227b45f3-44f6-43bc-a2e1-a44d4b963161
Date: Tue, 06 Oct 2015 08:27:24 GMT

{"badRequest": {"message": "Malformed request URL: URL's project_id 'b17a6492bfa54441910e15f07c98384' doesn't match Context's project_id 'b17a6492bfa54441910e15f07c983384'", "code": 400}}