Skip to content
abh edited this page Jan 14, 2011 · 7 revisions

REST API

The whole point of this is to have an HTTP API for the PowerDNS database, so we'll strive for having it "REST-like". This will also play well with backbone.js if we ever make a HTML/JS UI for it.

Data calls

Create a domain

PUT /api/example.com?some=setting

Will fail if example.com already exists.

Update a domain

POST /api/example.com?some=parameter

Will fail if example.com doesn't exist.

Get information on a domain

GET /api/example.com

This will include the actual records (including a numeric ID from the database), use options to filter, for example:

Only get the SOA record: GET /api/example.com?type=SOA

Only get A records: GET /api/example.com?type=A

Only get records with a name starting with foo: GET /api/example.com?name=foo%

Create a new record

PUT /api/example.com/?name=www&type=A&data=10.0.0.1&ttl=86400

Will always create a new record, even if there already is a 'www.example.com' A record.

Update a record

POST /api/example.com/123?data=10.0.0.2

Deleta a record

DELETE /api/example.com/123

Clone this wiki locally