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 "X-Openstack-Request-Id", "Content-Length", "Date"

Response Code

Response Codes
response code condition
200 normal end
400 computeFault
- badRequest
401 unauthorized
403 forbidden
404 itemNotFound
405 badMethod
413 overLimit
500 badRequest
503 serviceUnavailable

HTTP Response Body

Format

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

Response Parameter

Response Parameters
name format description
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 "X-Openstack-Request-Id", "Content-Length", "Date"

Response Body

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

Execution Example

HTTP Request

GET /v2/cb8aa2a2c7244af5aab1fa7881ba7f4c/os-availability-zone HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8776
X-Auth-Token: 517486dbd39a44088fdc5b3dfcfdb831
Content-type: application/json
Accept: application/json

HTTP Response

HTTP/1.1 200 OK
X-Compute-Request-Id: req-47fdee6d-a694-4b1c-9e6e-f0ace09d516d
Content-Type: application/json
Content-Length: 82
X-Openstack-Request-Id: req-47fdee6d-a694-4b1c-9e6e-f0ace09d516d
Date: Thu, 15 Oct 2015 12:46:09 GMT

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

Error Execution Example

HTTP Request

GET /v2/cb8aa2a2c7244af5aab1fa7881ba7f4/os-availability-zone HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8776
X-Auth-Token: 517486dbd39a44088fdc5b3dfcfdb831
Content-type: application/json
Accept: application/json

HTTP Response

HTTP/1.1 400 Bad Request
Content-Length: 65
Content-Type: application/json; charset=UTF-8
X-Compute-Request-Id: req-a5d41b9c-afaa-452d-b027-0b4a82cab648
X-Openstack-Request-Id: req-a5d41b9c-afaa-452d-b027-0b4a82cab648
Date: Thu, 15 Oct 2015 12:57:34 GMT

{"badRequest": {"message": "Malformed request url", "code": 400}}