Views

These endpoints allow configuration of per-zone Views.

Views Endpoints

GET /servers/{server_id}/views

List all views in a server

Parameters:
  • server_id (string) – The id of the server to retrieve
Status Codes:
GET /servers/{server_id}/views/{view}

List the contents of a given view

Parameters:
  • server_id (string) – The id of the server to retrieve
  • view (string) – The name of the view to retrieve
Status Codes:
POST /servers/{server_id}/views/{view}

Adds a zone to a given view, creating it if needed

Parameters:
  • server_id (string) – The id of the server to retrieve
  • view (string) – The name of the view to update
Status Codes:
DELETE /servers/{server_id}/views/{view}/{id}

Removes the given zone from the given view

Parameters:
  • server_id (string) – The id of the server to retrieve
  • view (string) – The name of the view to update
  • id (string) – The zone to remove from the view
Status Codes:

Examples

Listing all views

GET /api/v1/servers/localhost/views HTTP/1.1
X-API-Key: secret

Will yield a response similar to this (several headers omitted):

HTTP/1.1 200 OK
Content-Type: application/json

{"views":["trusted","untrusted"]}

Listing the zones of a view

GET /api/v1/servers/localhost/views/trusted HTTP/1.1
X-API-Key: secret

Will yield a response similar to this (several headers omitted):

HTTP/1.1 200 OK
Content-Type: application/json

{"zones":["example.com..trusted","otherdomain.com..untrusted"]}

Creating or adding to a view

POST /api/v1/servers/localhost/views/trusted HTTP/1.1
X-API-Key: secret
Content-Type: application/json

{"name":"example.org..trusted"}

Will yield a response similar to this (several headers omitted):

HTTP/1.1 204 No Content

Deleting a view

DELETE /api/v1/servers/localhost/views/trusted HTTP/1.1
X-API-Key: secret

Will yield a response similar to this (several headers omitted):

HTTP/1.1 204 No Content