• Domain Name Service

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

Querying Private Zones

Function

Query private 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

Yes

string

Zone type

The value is private, indicating that private zones are queried.

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 1020, 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_CREATEACTIVEPENDING_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

    routers

    List<Router>

    Routers (VPCs associated with the zone)

    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=private&limit=11&marker=&name=&status="
        },
        "zones": [
            {
                "id": "ff8080825b8fc86c015b94bc6f8712c3",
                "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/ff8080825b8fc86c015b94bc6f8712c3"
                },
                "pool_id": "ff8080825ab738f4015ab7513298010e",
                "project_id": "e55c6f3dc4e34c9f86353b664ae0e70c",
                "zone_type": "private",
                "created_at": "2017-04-22T08:17:08.997",
                "updated_at": "2017-04-22T08:17:09.997",
                "record_num": 2,
                "routers": [
                    {
                        "status": "ACTIVE",
                        "router_id": "19664294-0bf6-4271-ad3a-94b8c79c6558",
                        "router_region": "xx"
                    },
                    {
                        "status": "ACTIVE",
                        "router_id": "f0791650-db8c-4a20-8a44-a06c6e24b15b",
                        "router_region": "xx"
                    }
                ]
            },
            {
                "id": "ff8080825b95142f015b951f87280029",
                "name": "example.org.",
                "description": "This is an example zone.",
                "email": "xx@example.org",
                "ttl": 300,
                "serial": 0,
                "masters": [],
                "status": "ACTIVE",
                "links": {
                    "self": "https://Endpoint/v2/zones/ff8080825b95142f015b951f87280029"
                },
                "pool_id": "ff8080825ab738f4015ab7513298010e",
                "project_id": "e55c6f3dc4e34c9f86353b664ae0e70c",
                "zone_type": "private",
                "created_at": "2017-04-22T08:17:08.997",
                "updated_at": "2017-04-22T08:17:09.997",
                "record_num": 2,
                "routers": [
                    {
                        "status": "ACTIVE",
                        "router_id": "19664294-0bf6-4271-ad3a-94b8c79c6558",
                        "router_region": "xx"
                    },
                    {
                        "status": "ACTIVE",
                        "router_id": "f0791650-db8c-4a20-8a44-a06c6e24b15b",
                        "router_region": "xx"
                    }
                ]
    
            }
        ],
        "metadata": {
            "total_count": 2
        }
    }
    

Returned Value

See General Request Return Code.