]> granicus.if.org Git - pdns/commitdiff
document our JSON/RESTful stuff!
authorbert hubert <bert.hubert@netherlabs.nl>
Thu, 20 Jun 2013 11:23:05 +0000 (13:23 +0200)
committerbert hubert <bert.hubert@netherlabs.nl>
Thu, 20 Jun 2013 11:23:05 +0000 (13:23 +0200)
pdns/docs/web-api.md [new file with mode: 0644]

diff --git a/pdns/docs/web-api.md b/pdns/docs/web-api.md
new file mode 100644 (file)
index 0000000..2e2069c
--- /dev/null
@@ -0,0 +1,47 @@
+## The PowerDNS Web/JSON/RESTful APIs
+In order to remotely control PowerDNS, both Authoritative Server and Recursor, various non-web means are available, like pdns_control 
+and rec_control.
+
+In addition, recent versions of PowerDNS can be controlled via a JSON API that is available over the web.
+
+To make use of this API, there is a Python, flask, based web application called 'pdnscontrol', which is hosted on https://github.com/PowerDNS/pdnscontrol . pdnscontrol also contains pdns2graphite which sets up a bridge between our statistics and graphite.
+
+Finally, there is a program called 'pdnsmgrd' that also provides an API for stopping PowerDNS, starting it, installing new versions etc. 
+
+The JSON API suports JSON and JSONp.
+
+Common API calls
+----------------
+ * config  
+   Returns the currently running configuration, minus passwords
+ * log-grep  
+   Searches the logfile configured with 'experimental-logfile' for the terms specified in 'needle'
+ * domains  
+   Returns a list of all domains, including type, master details, last_check etc
+
+API calls in PowerDNS Authoritative Server
+------------------------------------------
+Available from the built-in webserver as http://servername/jsonstat?command=...
+
+For now, only enabled if the 'experimental-json-interface' parameter is configured, as this API is not yet fully stable.
+
+ * get  
+   Returns all variables found on the rest of the URL request
+ * get-zone  
+   Returns the zone from the 'zone' parameter of the request
+ * pdns-control  
+   Allows you to issue pdns_control commands, as found in a JSON post, in the field 'parameters'
+ * zone-rest  
+   RESTful querying and modifying of a zone, for example, request:  http://jsonstat?command=zone-rest&rest=/powerdns.nl/www.powerdns.nl/a
+   Supports POST, DELETE, and GET
+
+API calls for the PowerDNS Recursor
+-----------------------------------
+
+For now, only enabled if the 'experimental-json-interface' parameter is configured, as this API is not yet fully stable.
+
+ * flush-cache  
+   Flush from the cache the domain specified in the parameter 'domain'
+ * stats  
+   Returns the rec_control statistics
+