List availability zones

Overview

Lists all availability zones.

Classification

  • List

API Operation Object

  • os-availability-zone

Synchronous / Asynchronous

  • -

Request

HTTP Request Method

  • GET

HTTP Request Path

{api_endpoint}/v2/{tenant_id}/os-availability-zone

HTTP Request Header

Format

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

HTTP Request Body

Format

  • none

Request Parameter

Request Parameters
name style format description required/optional
tenant_id URI String The ID for the tenant or account in a multi-tenancy cloud. required

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 badRequest
401 unauthorized
403 forbidden
405 badMethod
413 overLimit
503 serviceUnavailable

HTTP Response Body

Format

{
    "availabilityZoneInfo": [
        {
            "hosts": <hosts>,
            "zoneName": "<zoneName>",
            "zoneState": {
                "available": <available>
            }
        }
    ]
}

Response Parameter

Response Parameters
item format description
hosts String host name of the availability zone
zoneName String availability zone name
available boolean State of availability zone

Sample API Request and Response

Sample API Request

Request URI

https://example.com/v2/{tenant_id}/os-availability-zone

Request Header

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

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

{
    "availabilityZoneInfo": [
        {
            "hosts": null,
            "zoneName": "nova",
            "zoneState": {
                "available": true
            }
        }
    ]
}

Execution Example

HTTP Request

GET /v2/ad355aa6ed3e4cf5ae0fa0df652bc291/os-availability-zone HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8774
X-Auth-Token: 9d98bc82b5fb43dbaa7792177ad43c6f
Content-type: application/json
Accept: application/json

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 97
X-Compute-Request-Id: req-d724cf3a-b34e-4188-a6f1-aaa8b5c83ceb
Date: Thu, 15 Oct 2015 03:23:27 GMT

{"availabilityZoneInfo": [{"zoneState": {"available": true}, "hosts": null, "zoneName": "nova"}]}

Error Execution Example

HTTP Request

GET /v2/ad355aa6ed3e4cf5ae0fa0df652bc290/os-availability-zone HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8774
X-Auth-Token: 9d98bc82b5fb43dbaa7792177ad43c6f
Content-type: application/json
Accept: application/json

HTTP Response

HTTP/1.1 400 Bad Request
Content-Length: 188
Content-Type: application/json; charset=UTF-8
X-Compute-Request-Id: req-2ba677a5-caf6-467c-b55e-daa20354e773
Date: Thu, 15 Oct 2015 03:24:01 GMT

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