@hackage powerdns0.2.1

PowerDNS API bindings for api/v1

PowerDNS API allows programmatic manipulation of zones and other metadata. This library is a thin wrapper, exposing most of the idiosyncracies directly.

Users are advised to refer to the PowerDNS documentation and its source code for the exact semantics.

All exposed API endpoints are provided.

import qualified PowerDNS.Client as P
import           Network.HTTP.Client (newManager, defaultManagerSettings)
import           Servant.Client (runClientM, mkClientEnv, parseBarseUrl)

main :: IO
main = do
  uri <- parseBaseUrl "http://localhost:8081"
  mgr <- newManager defaultManagerSettings
  env <- P.applyXApiKey "secret" <$> mkClientEnv

  Right r <- runClientM (P.statistics "localhost" Nothing Nothing) env)
  traverse_ print r