Updated on 2024-04-15 GMT+08:00

Querying All AZs

Function

This API is used to query all AZs.

URI

  • URI format

    GET /v2/{project_id}/os-availability-zone

  • Parameter description

    Parameter

    Mandatory

    Description

    project_id

    Yes

    The project ID.

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

Request

  • Example request
    GET https://{endpoint}/v2/{project_id}/os-availability-zone

Response

  • Response parameters

    Parameter

    Type

    Description

    availabilityZoneInfo

    list

    The list of queried AZs. For details, see Parameters in the availabilityZoneInfo field.

    error

    Object

    The error message returned if an error occurs. For details, see Parameters in the error field.

  • Parameters in the availabilityZoneInfo field

    Parameter

    Type

    Description

    zoneState

    Object

    The AZ status. For details, see Parameter in the zoneState field.

    zoneName

    String

    The AZ name.

  • Parameter in the zoneState field

    Parameter

    Type

    Description

    available

    Boolean

    Whether the AZ is available.
    • true: available
    • false: unavailable
  • Parameters in the error field

    Parameter

    Type

    Description

    message

    String

    The error message returned if an error occurs.

    code

    String

    The error code returned if an error occurs.

    For details about the error code, see Error Codes.

  • Example response
    {
        "availabilityZoneInfo": [
            {
                "zoneState": {
                    "available": true
                }, 
                "zoneName": "az-dc-1"
            }
        ]
    }

    or

    {
        "error": {
            "message": "XXXX", 
            "code": "XXX"
        }
    }

Status Codes

  • Normal

    200

Error Codes

For details, see Error Codes.