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

Example request:

GET /servers/{server_id}/views HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    An array of view names

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "views": [
            "string"
        ]
    }
    

  • default

    The input to the operation was not valid

    Example response:

    HTTP/1.1 default -
    Content-Type: application/json
    
    {
        "error": "string",
        "errors": [
            "string"
        ]
    }
    

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 update

Example request:

GET /servers/{server_id}/views/{view} HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    An array of zone names

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "zones": [
            "string"
        ]
    }
    

  • default

    The input to the operation was not valid

    Example response:

    HTTP/1.1 default -
    Content-Type: application/json
    
    {
        "error": "string",
        "errors": [
            "string"
        ]
    }
    

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

Example request:

POST /servers/{server_id}/views/{view} HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "name": "string"
}
Status Codes:
  • 204 No Content – Returns 204 No Content on success.

  • default

    The input to the operation was not valid

    Example response:

    HTTP/1.1 default -
    Content-Type: application/json
    
    {
        "error": "string",
        "errors": [
            "string"
        ]
    }
    

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:
  • 204 No Content – Returns 204 No Content on success.

  • default

    The input to the operation was not valid

    Example response:

    HTTP/1.1 default -
    Content-Type: application/json
    
    {
        "error": "string",
        "errors": [
            "string"
        ]
    }
    

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

Removing a zone from a view

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

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

HTTP/1.1 204 No Content