From: Anhad Jai Singh Date: Wed, 25 Oct 2017 17:28:32 +0000 (+0530) Subject: Add missing config option in API docs X-Git-Tag: rec-4.1.0-rc2~17^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4e0d7cd567e056a354c8e72a7aa5f990d43b0258;p=pdns Add missing config option in API docs - Add `api=yes` required to enable API - Change ports in examples from 8082 to 8081 to reflect default port in configs for Authoritative DNS --- diff --git a/docs/common/api/configsetting.rst b/docs/common/api/configsetting.rst index 2211dd089..68aaad057 100644 --- a/docs/common/api/configsetting.rst +++ b/docs/common/api/configsetting.rst @@ -16,5 +16,5 @@ ConfigSetting { "name": "webserver-port", "type": "ConfigSetting", - "value": "8082" + "value": "8081" } diff --git a/docs/http-api/index.rst b/docs/http-api/index.rst index 8127c5b04..5bac7b6fa 100644 --- a/docs/http-api/index.rst +++ b/docs/http-api/index.rst @@ -26,14 +26,17 @@ Enabling the API To enable the API, the webserver and the HTTP API need to be enbaled. Add these lines to the ``pdns.conf``:: - webserver=yes - webserver-port=8082 + api=yes api-key=changeme + webserver=yes + webserver-port=8081 + +The API endpoints run off of the same webserver, but the :ref:`setting-api` is required to enable API access. Setting :ref:`setting-api` also implicitly enables the webserver v4.1.x onwards. And restart, the following examples should start working:: - curl -v -H 'X-API-Key: changeme' http://127.0.0.1:8082/api/v1/servers/localhost | jq . - curl -v -H 'X-API-Key: changeme' http://127.0.0.1:8082/api/v1/servers/localhost/zones | jq . + curl -v -H 'X-API-Key: changeme' http://127.0.0.1:8081/api/v1/servers/localhost | jq . + curl -v -H 'X-API-Key: changeme' http://127.0.0.1:8081/api/v1/servers/localhost/zones | jq . JSON Objects ------------