Skip to content

Latest commit

 

History

History
68 lines (56 loc) · 2.56 KB

README.md

File metadata and controls

68 lines (56 loc) · 2.56 KB

shaman logo
Build Status

Shaman

Small, lightweight, api-driven dns server.

Routes:

Route Description Payload Output
POST /records Adds the domain and full record json domain object json domain object
PUT /records Update all domains and records (replaces all) json array of domain objects json array of domain objects
GET /records Returns a list of domains we have records for nil string array of domains
PUT /records/{domain} Update domain's records (replaces all) json domain object json domain object
GET /records/{domain} Returns the records for that domain nil json domain object
DELETE /records/{domain} Delete a domain nil success message

Usage Example:

add domain

$ curl -k -H "X-AUTH-TOKEN: secret" https://localhost:1632/records -d \
       '{"domain":"nanopack.io","records":[{"ttl":60,"class":"IN","type":"A","address":"127.0.0.2"}]}'
# {"domain":"nanopack.io.","records":[{"ttl":60,"class":"IN","type":"A","address":"127.0.0.2"}]}

list domains

$ curl -k -H "X-AUTH-TOKEN: secret" https://localhost:1632/records
# ["nanopack.io"]

or add ?full=true for the full records

$ curl -k -H "X-AUTH-TOKEN: secret" https://localhost:1632/records?full=true
# [{"domain":"nanopack.io.","records":[{"ttl":60,"class":"IN","type":"A","address":"127.0.0.2"}]}]

update domains

$ curl -k -H "X-AUTH-TOKEN: secret" https://localhost:1632/records -d \
       '[{"domain":"nanobox.io","records":[{"address":"127.0.0.1"}]}]' \
       -X PUT
# [{"domain":"nanobox.io.","records":[{"ttl":60,"class":"IN","type":"A","address":"127.0.0.1"}]}]

update domain

$ curl -k -H "X-AUTH-TOKEN: secret" https://localhost:1632/records/nanobox.io -d \
       '{"domain":"nanobox.io","records":[{"address":"127.0.0.2"}]}' \
       -X PUT
# {"domain":"nanobox.io.","records":[{"ttl":60,"class":"IN","type":"A","address":"127.0.0.2"}]}

delete domain

$ curl -k -H "X-AUTH-TOKEN: secret" https://localhost:1632/records/nanobox.io \
       -X DELETE
# {"msg":"success"}

get domain

$ curl -k -H "X-AUTH-TOKEN: secret" https://localhost:1632/records/nanobox.io
# {"err":"failed to find record for domain - 'nanobox.io'"}

oss logo