Querying AZ Information (V2)

Function

This API is used to query the ID of the AZ where a DCS instance resides. For example, to create a DCS instance in an AZ with available resources in the CN North-Beijing1 region, locate the record in the response message in which the value of resource_availability is true. Then, the value of id in the same record indicates the ID of the AZ where the instance resides.

URI

GET /v2/available-zones

Request

Request parameters

None

Example request

GET https://{dcs_endpoint}/v2/available-zones

Response

Response parameters

Table 1 describes the response parameters.
Table 1 Parameter description

Parameter

Type

Description

region_id

String

Region ID.

available_zones

Array

Array of AZs. For details, see Table 2.

Table 2 available_zones array parameter description

Parameter

Type

Description

id

String

AZ ID.

code

String

AZ code.

name

String

AZ name.

port

String

Port number of the AZ.

resource_availability

String

An indicator of whether there are available resources in the AZ.

  • true: There are available resources in the AZ.
  • false: All resources have been used up in the AZ.

Example response

{ 
  "region_id" : "XXXXXX", 
  "available_zones" : [ { 
    "code" : "XXXXXX", 
    "port" : "8003", 
    "name" : "XXXXXX", 
    "id" : "f84448fd537f46078dd8bd776747f573", 
    "resource_availability" : "true" 
  }, { 
    "code" : "XXXXXX", 
    "port" : "8002", 
    "name" : "XXXXXX", 
    "id" : "12c47a78666b4e438cd0c692b9860387", 
    "resource_availability" : "true" 
  }, { 
    "code" : "XXXXXX", 
    "port" : "8009", 
    "name" : "XXXXXX", 
    "id" : "0725858e0d26434f9aa3dc5fc40d5697", 
    "resource_availability" : "true" 
  } ] 
}

Status Code

Table 3 Status codes

Status Code

Description

200

AZ information queried successfully.

Error Code

For details, see Error Codes.