List Recordsets in a Zone

Overview

  • This lists all recordsets in a zone

Classification

  • List

API Operation Object

  • Recordset

Synchronous / Asynchronous

  • Synchronous

Request

HTTP Request Method

  • GET

HTTP Request Path

{api_endpoint}/v2/zones/{zone_id}/recordsets

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
zone_id path uuid ID for the zone. required - Terminate 400,404
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 - 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 E2046 Domain name is required.
  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.
404 Not Found not exists E2007 Specified zone is not found.
401 Unauthorized authentication failure E2001 Invalid token.
500 Internal Server Error internal server error E9001 Internal Server Error. Request failed.

Response Body

Format

{
 "recordsets": [
    {
      "id": <id>,
      "action": <action>,
      "name": <name>,
      "ttl": <ttl>,
      "description": <description>,
      "records": [
        <records>
      ],
      "type": <type>,
      "version": <version>,
      "status": <status>,
      "created_at": <created_at>,
      "updated_at": <updated_at>,
      "zone_id": <zone_id>,
      "links": {
          <links>
      }
    },
    <<repeat>>
    ],
    "links": {
        <links>
    },
    "metadata": {
        <metadata>
    }
}

Response Parameter

item format Description
id uuid ID for the resource.
action enum current action in progress on the resource. This parameter is not currently supported. it always return an empty.
name hostname DNS Name for the recordset.
ttl integer TTL (Time to Live) for the recordset.
description String Description for this recordset.
records string list A list of data for this recordset. Each item will be a separate record in SDPF DNS. These items should conform to the DNS spec for the record type - e.g. A records must be IPv4 addresses, CNAME records must be a hostname.
type String They RRTYPE of the recordset.
version integer Version of the resource. This parameter is not currently supported. it always return 1.
status enum status of the resource
created_at datestamp Date / Time when resource was created.
updated_at datestamp Date / Time when resource last updated.
zone_id uuid ID for the zone that contains this recordset.
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.
metadata metadata Returns the total_count of resources matching this filter.

Sample Request and Response

Sample API Request

Request URL

GET /v2/zones/fbe8562b-66a5-4071-b4c2-250487d15a81/recordsets

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 04:38:52 GMT
Content-Type: application/json
Content-Length: 2453
Connection: keep-alive
Set-Cookie: TS0183560f=01cce65ce1cc3b6c555699f783ad8b643b09cf6d59836ce3a25e598fffc37fb55e01ddb326; Path=/

Response Body

{
  "recordsets": [
    {
      "id": "95929ba7-f495-4d0b-8b88-09b58cd3e358",
      "action": "",
      "name": "example.uk.",
      "ttl": 60,
      "description": null,
      "records": [
        "dns301-1.example.jp."
      ],
      "type": "NS",
      "version": 1,
      "status": "ACTIVE",
      "created_at": "2016-10-24T03:36:05",
      "updated_at": "",
      "zone_id": "fbe8562b-66a5-4071-b4c2-250487d15a81",
      "links": {
        "self": "https://endpoint.api.example.com/v2/zones/fbe8562b-66a5-4071-b4c2-250487d15a81/recordsets/95929ba7-f495-4d0b-8b88-09b58cd3e358"
      }
    },
    {
      "id": "e4425b7b-b370-4be6-a3c9-778f2ba923cb",
      "action": "",
      "name": "example.uk.",
      "ttl": 60,
      "description": null,
      "records": [
        "dns301-1.example.jp. ecl.example.jp. ( 1 7200 900 1209600 86400 )"
      ],
      "type": "SOA",
      "version": 1,
      "status": "ACTIVE",
      "created_at": "2016-10-24T03:36:05",
      "updated_at": "",
      "zone_id": "fbe8562b-66a5-4071-b4c2-250487d15a81",
      "links": {
        "self": "https://endpoint.api.example.com/v2/zones/fbe8562b-66a5-4071-b4c2-250487d15a81/recordsets/e4425b7b-b370-4be6-a3c9-778f2ba923cb"
      }
    },
    {
      "id": "64bcb69f-40ca-4787-970d-c6349f9d871a",
      "action": "",
      "name": "example.uk.",
      "ttl": 60,
      "description": null,
      "records": [
        "dns301-2.example.jp."
      ],
      "type": "NS",
      "version": 1,
      "status": "ACTIVE",
      "created_at": "2016-10-24T03:36:05",
      "updated_at": "",
      "zone_id": "fbe8562b-66a5-4071-b4c2-250487d15a81",
      "links": {
        "self": "https://endpoint.api.example.com/v2/zones/fbe8562b-66a5-4071-b4c2-250487d15a81/recordsets/64bcb69f-40ca-4787-970d-c6349f9d871a"
      }
    },
    {
      "id": "2514d0c1-d41e-4fd0-b736-acf3fbd1e03a",
      "action": "",
      "name": "ex1.example.uk.",
      "ttl": 3600,
      "description": "This is an example recordset.",
      "records": [
        "203.0.113.2"
      ],
      "type": "A",
      "version": 1,
      "status": "ACTIVE",
      "created_at": "2016-10-24T04:30:46",
      "updated_at": "",
      "zone_id": "fbe8562b-66a5-4071-b4c2-250487d15a81",
      "links": {
        "self": "https://endpoint.api.example.com/v2/zones/fbe8562b-66a5-4071-b4c2-250487d15a81/recordsets/2514d0c1-d41e-4fd0-b736-acf3fbd1e03a"
      }
    },
    {
      "id": "0af8f6a2-e7c8-4243-a7f6-c505725973e4",
      "action": "",
      "name": "ex1.example.uk.",
      "ttl": 3600,
      "description": "This is an example recordset.",
      "records": [
        "203.0.113.3"
      ],
      "type": "A",
      "version": 1,
      "status": "ACTIVE",
      "created_at": "2016-10-24T04:30:46",
      "updated_at": "",
      "zone_id": "fbe8562b-66a5-4071-b4c2-250487d15a81",
      "links": {
        "self": "https://endpoint.api.example.com/v2/zones/fbe8562b-66a5-4071-b4c2-250487d15a81/recordsets/0af8f6a2-e7c8-4243-a7f6-c505725973e4"
      }
    }
  ],
  "links": {
    "self": "https://endpoint.api.example.com/v2/zones/fbe8562b-66a5-4071-b4c2-250487d15a81/recordsets"
  },
  "metadata": {
    "total_count": 5
  }
}

Sample Error Response

Response

HTTP/1.1 404
Date: Mon, 24 Oct 2016 04:41:30 GMT
Content-Type: application/json
Content-Length: 89
Connection: keep-alive
Set-Cookie: TS0183560f=01cce65ce103f1293b3ea4092556e444760059a7b9cda41b6ecc2c888f31c759f10b3da1bc; Path=/

{"error":{"code":404,"title":"Not Found","message":"E2007 Specified zone is not found."}}