-
Notifications
You must be signed in to change notification settings - Fork 7
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.
See the Authentication page for information on how to authenticate to the API.
PUT /api/domain/example.com
Parameters:
- type - MASTER or SLAVE
- master - IP address of master server (if type is SLAVE)
Also the following parameters will be set in the SOA record if set, otherwise some reasonable default will be used: primary, hostmaster, serial, refresh, retry, expire, default_ttl
.
GET /api/domain/
GET /api/domain/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/domain/example.com?type=SOA
Only get A records: GET /api/domain/example.com?type=A
Only get records with the name 'foo': GET /api/domain/example.com?name=foo
Settings:
- type (master or slave)
- master (IP of master if type is slave)
TODO:
- soa parameters
POST /api/domain/example.com?some=parameter
Will fail if example.com doesn't exist. Parameters taken are the same as for PUT domain.
POST /api/record/example.com?type=A&name=www&content=10.0.0.2
Will always create a new record, even if there already is a 'www.example.com' A record.
PUT /api/record/example.com/123?name=www&type=A&data=10.0.0.1&ttl=86400
This will update the parameters specified and leave others as they were. (Probably this should really be POST
, too...)
DELETE /api/record/example.com/123
-
Support JSONP
-
Should the parameters be sent via a JSON object instead of plain HTTP query parameters? Other than maybe future bulk edits, I can't think of any data where this would make things simpler.