Updated on 2024-03-05 GMT+08:00

Querying Availability Zones

Function

This API is used to list availability zones (AZs).

Query the API version. For details, see Querying All API Versions. If the value of version is less than or equal to 2.6, add the request header X-Openstack-Manila-Api-Version: Micro version number, for example, X-Openstack-Manila-Api-Version: 2.4.

URI

  • GET /v2/{project_id}/availability-zones?share_az={share_az}
  • Parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Specifies the project ID of the operator. For details about how to obtain the project ID, see Obtaining a Project ID.

    share_az

    No (query parameter)

    Boolean

    If this parameter is set to true, the current tenant can query AZs where shared file systems can be created. If this parameter is set to false, all AZs can be queried, regardless of whether shared file systems can be created there.

Request Header

The operation message header is the same as that of a common request. For details, see Table 3.

Request

  • Parameter description

    None

  • Example request

    None

Response

  • Parameter description

    Parameter

    Type

    Description

    availability_zones

    Array of objects

    List of availability zones

  • Description of field availability_zone

    Parameter

    Type

    Description

    id

    String

    Specifies the ID of the AZ.

    name

    String

    Specifies the AZ name.

    created_at

    String

    Specifies the creation time of an AZ.

    updated_at

    String

    Specifies the modification time of an AZ.

  • Example response
    {
      "availability_zones": [
        {
          "updated_at": null,
          "created_at": "2018-07-10T19:11:49.831107",
          "id": "ddafcb71-face-4526-a637-9768d19b20f3",
          "name": "az1.dc1"
        }
      ]
    }

Status Codes

  • Normal

    200

  • Abnormal

    Status Code

    Description

    400 Bad Request

    The server failed to process the request.

    401 Unauthorized

    You must enter a username and the password to access the requested page.

    403 Forbidden

    Access to the requested page is forbidden.

    404 Not Found

    The requested page was not found.

    405 Method Not Allowed

    You are not allowed to use the method specified in the request.

    406 Not Acceptable

    The response generated by the server could not be accepted by the client.

    407 Proxy Authentication Required

    You must use the proxy server for authentication. Then the request can be processed.

    408 Request Timeout

    The request timed out.

    409 Conflict

    The request could not be processed due to a conflict.

    500 Internal Server Error

    The request is not completed because of a service error.

    501 Not Implemented

    The request is not completed because the server does not support the requested function.

    502 Bad Gateway

    The request is not completed because the request is invalid.

    503 Service Unavailable

    The request is not completed because the service is unavailable.

    504 Gateway Timeout

    A gateway timeout error occurred.