Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

TemplateResource

Nick Douma edited this page Mar 6, 2012 · 2 revisions

TemplateResource

GET

Retrieves an existing DNS template.

Response:

{
     {
           "identifier": <string>,
           "description": <string>,
           "entries": [ {
                 "name": <string>,
                 "type": <string>,
                 "content": <string>,
                 "ttl": <int>,
                 "priority": <int>
           },0..n ]
     },0..n
]

Errors (request without identifier):

  • 500 - Failed to connect to database or query execution error.

Errors (request with identifier):

  • 500 - Failed to connect to database or query execution error.
  • 404 - Could not find template.

PUT

Create a new DNS template.

Request:

{
     "identifier": <string>,
     "description": <string>,
     "entries": [ {
           "name": <string>,
           "type": <string>,
           "content": <string>,
           "ttl": <int>,
           "priority": <int>
     },0..n ]
}

Response:

true

Errors:

  • 508 - Invalid request, missing required parameters or input validation failed.
  • 500 - Failed to connect to database or query execution error.
  • 409 - Template already exists.

POST

Update an existing DNS template. This method will overwrite the entire Template.

Request:

{
    "identifier": <string>,
    "description": <string>,
    "entries": [ {
           "name": <string>,
           "type": <string>,
           "content": <string>,
           "ttl": <int optional>,
           "priority": <int optional>
    },0..n ]
}

Response:

true

Errors:

  • 508 - Invalid request, missing required parameters or input validation failed.
  • 500 - Failed to connect to database or query execution error.
  • 404 - Could not find template.

DELETE

Delete an existing DNS template.

Response:

true

Errors:

  • 508 - Invalid request, missing required parameters or input validation failed.
  • 500 - Failed to connect to database or query execution error.
  • 404 - Could not find template.

VALIDATE

Validates the properties of a template.

To validator Template records, use the RecordResource.

Request:

{
    "identifier": <string>,
    "description": <string>
}

Response:

true

Errors:

  • 508 - Invalid request, missing required parameters or input validation failed.