List Zones

Overview

  • List the zones.

Classification

  • List

API Operation Object

  • Zone

Synchronous / Asynchronous

  • Synchronous

Request

HTTP Request Method

  • GET

HTTP Request Path

{api_endpoint}/v2/zones

HTTP Request Header

Format

Content-Type: application/json
Accept: application/json
X-Auth-Token: <token_id>

HTTP Request Body

  • none

Request Parameter

name style format description required/optional default value action for invalid parameter response code for invalid parameter
token_id Header authentication token string authentication token. required - Terminate 401
domain_name query string Domain name of zone for partial-match search. optional - Terminate 400
sort_key query string(domain_name) Sorts the response by the attribute value. A valid value is only domain_name. optional domain_name Terminate 400
sort_dir query string(asc,desc) Sorts the response by the requested sort direction. A valid value is asc (ascending) or desc (descending). Default is asc. optional asc Terminate 400
marker query string(uuid) The ID of the last-seen item. Use the limit parameter to make an initial limited request and use the ID of the last-seen item from the response as the marker parameter value in a subsequent limited request. optional - Terminate 400
limit query integer(1-500) Requests a page size of items. Returns a number of items up to a limit value. Use the limit parameter to make an initial limited request and use the ID of the last-seen item from the response as the marker parameter value in a subsequent limited request. optional 100 Terminate 400

Response

HTTP Response Header

Format

HTTP/1.1 <response_code>       (ex. 200)
  • <response_code>: see "Response Code" section

Response Code

response code status condition message
200 OK normal end  
400 Bad Request invalid value E2042 Zone id is required.
  Bad Request invalid value E2005 Limit must less than
  Bad Request invalid value E2033 Sort key must be 'domain_name
  Bad Request invalid value E2034 Sort direction must be 'asc' or 'desc
  Bad Request invalid value E2035 Marker must be resource's UUID
  Bad Request invalid value E2030 Limit must be positive integer.
401 Unauthorized authentication failure E2001 Invalid token.
500 Internal Server Error internal server error E9001 Internal Server Error. Request failed.

Response Body

Format

{
  "zones": [
  {
    "id": <id>,
    "pool_id": <pool_id>,
    "project_id": <project_id>,
    "name": <name>,
    "email": <email>,
    "ttl": <ttl>,
    "serial": <serial>,
    "status": <status>,
    "description": <description>,
    "masters": <masters>,
    "type": <type>,
    "transferred_at": <transferred_at>,
    "version": <version>,
    "action": <action>,
    "attributes": [],
    "created_at": <created_at>,
    "updated_at": <updated_at>,
    "links": {
      <links>
    },
  }
  <<repeat>>>
  ],
  "links": {
      <links>
  },
  "metadata": {
    <metadata>
  }
 }

Response Parameter

item format description
action string current action in progress on the resource. This parameter is not currently supported. It always returns an empty string.
created_at datestamp Date / Time when resource was created.
description string Description for this zone.
email string e-mail for the zone. Used in SOA records for the zone. This parameter is not currently supported. It always returns an empty string.
id uuid ID for the resource.
links links Links to the resource, and other related resources. When a response has been broken into pages, we will include a next link that should be followed to retrieve all results.
masters enum list For secondary zones. The servers to slave from to get DNS information. This parameter is not currently supported. It always returns an empty string.
name zonename DNS Name for the zone.
pool_id uuid ID for the pool hosting this zone. This parameter is not currently supported. It always returns an empty string.
project_id uuid ID for the project(tenant) that owns the resource.
serial integer current serial number for the zone. This parameter is not currently supported. it always return zero.
status enum status of the resource.
transferred_at enum For secondary zones. The last time an update was retrieved from the master servers. This parameter is not currently supported. it always return null.
ttl integer TTL (Time to Live) for the zone. This parameter is not currently supported. it always return zero.
type enum Type of zone. PRIMARY is controlled by SDPF DNS, SECONDARY zones are slaved from another DNS Server. Defaults to PRIMARY. This parameter is not currently supported. It always returns an empty string.
updated_at datestamp Date / Time when resource last updated.
version integer Version of the resource. This parameter is not currently supported. it always return 1.
attributes string list This parameter is not currently supported. It always return an empty string.
metadata metadata Returns the total_count of resources matching this filter.

Sample Request and Response

Sample API Request

Request URL

GET /v2/zones?sort_key=domain_name&sort_dir=desc

Request Header

Content-Type: application/json
Accept: application/json
X-Auth-Token: e8c788fbaeb14964ae19759eb1df4ff1

Request Body

  • none

Sample API Response

Response Header

HTTP/1.1 200
Date: Mon, 24 Oct 2016 03:44:55 GMT
Content-Type: application/json
Content-Length: 614
Connection: keep-alive
Set-Cookie: TS0183560f=01cce65ce1b91406d7975b6e8f0f7749226781197694d6b3bd86f13e063fe224d2b1956f2e; Path=/

Response Body

{
  "zones":[
    {
      "id":"fbe8562b-66a5-4071-b4c2-250487d15a81",
      "pool_id":"",
      "project_id":"9348360ee0984a85a54e188a34c94851",
      "name":"example.uk.",
      "email":"",
      "ttl":0,
      "serial":0,
      "status":"ACTIVE",
      "description":"This is a test zone.",
      "masters":[],
      "type":"",
      "transferred_at":null,
      "version":1,
      "created_at":"2016-10-24T03:36:01",
      "updated_at":"2016-10-24T03:36:05",
      "links":{
        "self":"https://endpoint.api.example.com/v2/zones/fbe8562b-66a5-4071-b4c2-250487d15a81"
      },
      "action":"",
      "attributes":[]
    },
    {
      "id":"d14b8737-afb1-4ef6-b7c2-17e7c7a6f3ef",
      "pool_id":"",
      "project_id":"9348360ee0984a85a54e188a34c94851",
      "name":"example.jp.",
      "email":"",
      "ttl":0,
      "serial":0,
      "status":"ACTIVE",
      "description":"This is a test zone.",
      "masters":[],
      "type":"",
      "transferred_at":null,
      "version":1,
      "created_at":"2016-10-24T03:46:01",
      "updated_at":"2016-10-24T03:46:05",
      "links":{
        "self":"https://endpoint.api.example.com/v2/zones/d14b8737-afb1-4ef6-b7c2-17e7c7a6f3ef"
      },
      "action":"",
      "attributes":[]
    }

  ],
  "links":{
    "self":"https://endpoint.api.example.com/v2/zones?sort_key=domain_name&sort_dir=desc"
  },
  "metadata":{
    "total_count":2
  }
}

Sample Error Response

Response

HTTP/1.1 400
Date: Mon, 24 Oct 2016 03:53:03 GMT
Content-Type: application/json
Content-Length: 93
Connection: keep-alive
Set-Cookie: TS0183560f=01cce65ce1525543f6f5de9cc6caacf7f2bbdd78f368942e8f3865b77fb8568c97cb503140; Path=/

{"error":{"code":400,"title":"Bad Request","message":"E2033 Sort key must be 'domain_name'"}}