• Domain Name Service

dns
  1. Help Center
  2. Domain Name Service
  3. API Reference
  4. API Description
  5. Public Zone Management
  6. Querying Public Zones

Querying Public Zones

Function

Query public zones in list.

URI

GET /v2/zones?type={type}&limit={limit}&marker={marker}&offset={offset}&tags={tags}

For details, see Table 1.
Table 1 Parameters in the URI

Parameter

Mandatory

Type

Description

type

No

string

Zone type, which can be public or private

  • public: Public zones are queried.
  • private: Private zones are queried.

    If the value is left blank, public zones are queried by default.

marker

No

string

Start resource ID of pagination query

If the parameter is left blank, only resources on the first page are queried.

limit

No

string

  • Number of resources returned on each page
  • Value range: 0–500

    Commonly used values are 10, 20, and 50.

offset

No

int

  • Start page of the list, which ranges from 0 to 2147483647.
  • When the value of marker is not blank, it determines the start of a page.

tags

No

string

Resource tag

The format is as follows: key1,value1|key2,value2.

Multiple tags are separated by vertical bar (|). The key and value of each tag are separated by comma (,).

All tags listed will be queried.

For details, see section Adding Resource Tags.

Request

None

Response

  • Parameter description
    Table 2 Parameters in the response

    Parameter

    Type

    Description

    zones

    List data structure

    Zone list object

    metadata

    object

    Number of resources that meet the filter condition

    Table 3 describes parameters under the zones field, and Table 4 describes the parameter under the metadata field.
    Table 3 Description of the zones field

    Parameter

    Type

    Description

    id

    string

    Zone ID, which is a UUID used to identify the zone

    name

    string

    Zone name

    description

    string

    Zone description

    email

    string

    Email address of the administrator managing the zone

    zone_type

    string

    Zone type, which can be public or private

    ttl

    int

    TTL value of the SOA record set in the zone

    serial

    int

    Serial number in the SOA record set in the zone, which identifies the change on the primary DNS server

    status

    enum

    Resource status

    The value can be PENDING_CREATE, ACTIVE, PENDING_DELETE, or ERROR.

    record_num

    int

    Number of record sets in the zone

    pool_id

    string

    Pool ID of the zone, which is assigned by the system

    project_id

    string

    Project ID of the zone

    created_at

    string

    Time when the zone was created

    updated_at

    string

    Time when the zone was updated

    links

    object

    Link of the current resource or other related resources

    When a response is broken into pages, a next link is provided to retrieve all results.

    masters

    enum

    Master DNS servers, from which the slave servers get DNS information

    Table 4 Description of the metadata field

    Parameter

    Type

    Description

    total_count

    int

    Total number of resources

  • Example response
    {
        "links": {
            "self": "https://Endpoint/v2/zones?type=public&limit=11&marker=&name=&status="
        },
        "zones": [
            {
                "id": "2c9eb155587194ec01587224c9f90149",
                "name": "example.com.",
                "description": "This is an example zone.",
                "email": "xx@example.com",
                "ttl": 300,
                "serial": 0,
                "masters": [],
                "status": "ACTIVE",
                "links": {
                    "self": "https://Endpoint/v2/zones/2c9eb155587194ec01587224c9f90149"
                },
                "pool_id": "00000000570e54ee01570e9939b20019",
                "project_id": "e55c6f3dc4e34c9f86353b664ae0e70c",
                "zone_type": "public",
                "created_at": "2016-11-17T11:56:03.439",
                "updated_at": "2016-11-17T11:56:05.528",
                "record_num": 2
            },
            {
                "id": "2c9eb155587228570158722996c50001",
                "name": "example.org.",
                "description": "This is an example zone.",
                "email": "xx@example.org",
                "ttl": 300,
                "serial": 0,
                "masters": [],
                "status": "PENDING_CREATE",
                "links": {
                    "self": "https://Endpoint/v2/zones/2c9eb155587228570158722996c50001"
                },
                "pool_id": "00000000570e54ee01570e9939b20019",
                "project_id": "e55c6f3dc4e34c9f86353b664ae0e70c",
                "zone_type": "public",
                "created_at": "2016-11-17T12:01:17.996",
                "updated_at": "2016-11-17T12:01:18.528",
                "record_num": 2
            }
        ],
        "metadata": {
            "total_count": 2
        }
    }
    

Returned Value

See General Request Return Code.