{-# LANGUAGE OverloadedStrings #-}
module PowerDNS.Client
(
applyXApiKey
, listZones
, createZone
, getZone
, deleteZone
, updateRecords
, updateZone
, triggerAxfr
, notifySlaves
, getZoneAxfr
, rectifyZone
, Zone(..)
, Kind(..)
, RRSets(..)
, RRSet(..)
, Record(..)
, Comment(..)
, ChangeType(..)
, RecordType(..)
, listCryptoKeys
, createCryptokey
, getCryptokey
, updateCryptokey
, deleteCryptokey
, Cryptokey
, listServers
, getServer
, search
, flushCache
, statistics
, Server(..)
, SearchResult(..)
, ObjectType(..)
, CacheFlushResult(..)
, listMetadata
, createMetadata
, getMetadata
, updateMetadata
, deleteMetadata
, Metadata(..)
, listTSIGKeys
, createTSIGKey
, getTSIGKey
, updateTSIGKey
, deleteTSIGKey
, TSIGKey(..)
, TSIGAlgorithm(..)
, empty
)
where
import qualified Data.CaseInsensitive as CI
import Data.Sequence ((|>))
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import Servant.API (NoContent)
import Servant.API.Generic (fromServant)
import Servant.Client (ClientEnv(..), ClientM, client)
import Servant.Client.Core.Request (Request, requestHeaders)
import Servant.Client.Generic (AsClientT)
import PowerDNS.API
import PowerDNS.Internal.Utils (empty)
applyXApiKey :: T.Text
-> ClientEnv
-> ClientEnv
applyXApiKey :: Text -> ClientEnv -> ClientEnv
applyXApiKey Text
key ClientEnv
env = ClientEnv
env { makeClientRequest :: BaseUrl -> Request -> Request
makeClientRequest = BaseUrl -> Request -> Request
modified }
where
modified :: BaseUrl -> Request -> Request
modified BaseUrl
url = ClientEnv -> BaseUrl -> Request -> Request
makeClientRequest ClientEnv
env BaseUrl
url (Request -> Request) -> (Request -> Request) -> Request -> Request
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Request -> Request
applyXApiKeyHeader Text
key
applyXApiKeyHeader :: T.Text -> Request -> Request
Text
key Request
req =
Request
req { requestHeaders :: Seq Header
requestHeaders = Request -> Seq Header
forall body path. RequestF body path -> Seq Header
requestHeaders Request
req Seq Header -> Header -> Seq Header
forall a. Seq a -> a -> Seq a
|> Header
authHeader }
where
authHeader :: Header
authHeader = (ByteString -> CI ByteString
forall s. FoldCase s => s -> CI s
CI.mk ByteString
"X-API-Key", Text -> ByteString
T.encodeUtf8 Text
key)
pdnsClient :: PowerDNS (AsClientT ClientM)
pdnsClient :: PowerDNS (AsClientT ClientM)
pdnsClient = ToServant PowerDNS (AsClientT ClientM)
-> PowerDNS (AsClientT ClientM)
forall (routes :: * -> *) mode.
GenericServant routes mode =>
ToServant routes mode -> routes mode
fromServant (Proxy
("api"
:> ("v1"
:> ((((("servers" :> Get '[JSON] [Server])
:<|> ("servers"
:> (Capture "server_id" Text :> Get '[JSON] Server)))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("search-data"
:> (QueryParamReq "q" Text
:> (QueryParamReq "max" Integer
:> (QueryParam "object_type" ObjectType
:> Get '[JSON] [SearchResult]))))))
:<|> (("servers"
:> (Capture "server_id" Text
:> (QueryParamReq "domain" Text :> Put '[JSON] CacheFlushResult)))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("statistics"
:> (QueryParam "statistic" Text
:> (QueryParam "includerings" Bool
:> Get '[JSON] [AnyStatisticItem]))))))))
:<|> (((("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (QueryParam "zone" Text
:> (QueryParam "dnssec" Bool :> Get '[JSON] [Zone])))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (QueryParam "rrset" Bool
:> (ReqBody '[JSON] Zone :> PostCreated '[JSON] Zone))))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> (QueryParam "rrsets" Bool :> Get '[JSON] Zone)))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones" :> (Capture "zone_id" Text :> DeleteNoContent))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> (ReqBody '[JSON] RRSets
:> PatchNoContent))))))))
:<|> ((("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> (ReqBody '[JSON] Zone :> PutNoContent)))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("axfr-retrieve" :> Put '[JSON] NoContent))))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("notify" :> Put '[JSON] NoContent)))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("export" :> Get '[JSON] Text)))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("rectify" :> Put '[JSON] Text))))))))))
:<|> (((("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys" :> Get '[JSON] [Cryptokey])))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys"
:> (ReqBody '[JSON] Cryptokey
:> PostCreated '[JSON] Cryptokey)))))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys"
:> (Capture "cryptokey_id" Text
:> Get '[JSON] Cryptokey))))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys"
:> (Capture "cryptokey_id" Text
:> (ReqBody '[JSON] Cryptokey
:> PutNoContent)))))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys"
:> (Capture "cryptokey_id" Text
:> DeleteNoContent)))))))))
:<|> (((("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata" :> Get '[JSON] [Metadata])))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata"
:> (ReqBody '[JSON] Metadata :> PostNoContent)))))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata"
:> (Capture "kind" Text :> Get '[JSON] Metadata))))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata"
:> (Capture "kind" Text
:> (ReqBody '[JSON] Metadata
:> Put '[JSON] Metadata)))))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata"
:> (Capture "kind" Text
:> DeleteNoContent)))))))))
:<|> ((("servers"
:> (Capture "server_id" Text
:> ("tsigkeys" :> Get '[JSON] [TSIGKey])))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("tsigkeys"
:> (ReqBody '[JSON] TSIGKey
:> PostCreated '[JSON] TSIGKey)))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("tsigkeys"
:> (Capture "tsigkey_id" Text :> Get '[JSON] TSIGKey))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("tsigkeys"
:> (Capture "tsigkey_id" Text
:> (ReqBody '[JSON] TSIGKey
:> Put '[JSON] TSIGKey)))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("tsigkeys"
:> (Capture "tsigkey_id" Text
:> DeleteNoContent))))))))))))
-> Client
ClientM
("api"
:> ("v1"
:> ((((("servers" :> Get '[JSON] [Server])
:<|> ("servers"
:> (Capture "server_id" Text :> Get '[JSON] Server)))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("search-data"
:> (QueryParamReq "q" Text
:> (QueryParamReq "max" Integer
:> (QueryParam "object_type" ObjectType
:> Get '[JSON] [SearchResult]))))))
:<|> (("servers"
:> (Capture "server_id" Text
:> (QueryParamReq "domain" Text :> Put '[JSON] CacheFlushResult)))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("statistics"
:> (QueryParam "statistic" Text
:> (QueryParam "includerings" Bool
:> Get '[JSON] [AnyStatisticItem]))))))))
:<|> (((("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (QueryParam "zone" Text
:> (QueryParam "dnssec" Bool :> Get '[JSON] [Zone])))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (QueryParam "rrset" Bool
:> (ReqBody '[JSON] Zone :> PostCreated '[JSON] Zone))))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> (QueryParam "rrsets" Bool :> Get '[JSON] Zone)))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones" :> (Capture "zone_id" Text :> DeleteNoContent))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> (ReqBody '[JSON] RRSets
:> PatchNoContent))))))))
:<|> ((("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> (ReqBody '[JSON] Zone :> PutNoContent)))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("axfr-retrieve" :> Put '[JSON] NoContent))))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("notify" :> Put '[JSON] NoContent)))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("export" :> Get '[JSON] Text)))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("rectify" :> Put '[JSON] Text))))))))))
:<|> (((("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys" :> Get '[JSON] [Cryptokey])))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys"
:> (ReqBody '[JSON] Cryptokey
:> PostCreated '[JSON] Cryptokey)))))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys"
:> (Capture "cryptokey_id" Text
:> Get '[JSON] Cryptokey))))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys"
:> (Capture "cryptokey_id" Text
:> (ReqBody '[JSON] Cryptokey
:> PutNoContent)))))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys"
:> (Capture "cryptokey_id" Text
:> DeleteNoContent)))))))))
:<|> (((("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata" :> Get '[JSON] [Metadata])))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata"
:> (ReqBody '[JSON] Metadata
:> PostNoContent)))))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata"
:> (Capture "kind" Text
:> Get '[JSON] Metadata))))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata"
:> (Capture "kind" Text
:> (ReqBody '[JSON] Metadata
:> Put '[JSON] Metadata)))))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata"
:> (Capture "kind" Text
:> DeleteNoContent)))))))))
:<|> ((("servers"
:> (Capture "server_id" Text
:> ("tsigkeys" :> Get '[JSON] [TSIGKey])))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("tsigkeys"
:> (ReqBody '[JSON] TSIGKey
:> PostCreated '[JSON] TSIGKey)))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("tsigkeys"
:> (Capture "tsigkey_id" Text
:> Get '[JSON] TSIGKey))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("tsigkeys"
:> (Capture "tsigkey_id" Text
:> (ReqBody '[JSON] TSIGKey
:> Put '[JSON] TSIGKey)))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("tsigkeys"
:> (Capture "tsigkey_id" Text
:> DeleteNoContent))))))))))))
forall api.
HasClient ClientM api =>
Proxy api -> Client ClientM api
client Proxy
("api"
:> ("v1"
:> ((((("servers" :> Get '[JSON] [Server])
:<|> ("servers"
:> (Capture "server_id" Text :> Get '[JSON] Server)))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("search-data"
:> (QueryParamReq "q" Text
:> (QueryParamReq "max" Integer
:> (QueryParam "object_type" ObjectType
:> Get '[JSON] [SearchResult]))))))
:<|> (("servers"
:> (Capture "server_id" Text
:> (QueryParamReq "domain" Text :> Put '[JSON] CacheFlushResult)))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("statistics"
:> (QueryParam "statistic" Text
:> (QueryParam "includerings" Bool
:> Get '[JSON] [AnyStatisticItem]))))))))
:<|> (((("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (QueryParam "zone" Text
:> (QueryParam "dnssec" Bool :> Get '[JSON] [Zone])))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (QueryParam "rrset" Bool
:> (ReqBody '[JSON] Zone :> PostCreated '[JSON] Zone))))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> (QueryParam "rrsets" Bool :> Get '[JSON] Zone)))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones" :> (Capture "zone_id" Text :> DeleteNoContent))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> (ReqBody '[JSON] RRSets
:> PatchNoContent))))))))
:<|> ((("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> (ReqBody '[JSON] Zone :> PutNoContent)))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("axfr-retrieve" :> Put '[JSON] NoContent))))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("notify" :> Put '[JSON] NoContent)))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("export" :> Get '[JSON] Text)))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("rectify" :> Put '[JSON] Text))))))))))
:<|> (((("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys" :> Get '[JSON] [Cryptokey])))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys"
:> (ReqBody '[JSON] Cryptokey
:> PostCreated '[JSON] Cryptokey)))))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys"
:> (Capture "cryptokey_id" Text
:> Get '[JSON] Cryptokey))))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys"
:> (Capture "cryptokey_id" Text
:> (ReqBody '[JSON] Cryptokey
:> PutNoContent)))))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys"
:> (Capture "cryptokey_id" Text
:> DeleteNoContent)))))))))
:<|> (((("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata" :> Get '[JSON] [Metadata])))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata"
:> (ReqBody '[JSON] Metadata :> PostNoContent)))))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata"
:> (Capture "kind" Text :> Get '[JSON] Metadata))))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata"
:> (Capture "kind" Text
:> (ReqBody '[JSON] Metadata
:> Put '[JSON] Metadata)))))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata"
:> (Capture "kind" Text
:> DeleteNoContent)))))))))
:<|> ((("servers"
:> (Capture "server_id" Text
:> ("tsigkeys" :> Get '[JSON] [TSIGKey])))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("tsigkeys"
:> (ReqBody '[JSON] TSIGKey
:> PostCreated '[JSON] TSIGKey)))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("tsigkeys"
:> (Capture "tsigkey_id" Text :> Get '[JSON] TSIGKey))))
:<|> (("servers"
:> (Capture "server_id" Text
:> ("tsigkeys"
:> (Capture "tsigkey_id" Text
:> (ReqBody '[JSON] TSIGKey
:> Put '[JSON] TSIGKey)))))
:<|> ("servers"
:> (Capture "server_id" Text
:> ("tsigkeys"
:> (Capture "tsigkey_id" Text
:> DeleteNoContent))))))))))))
Proxy API
api)
zonesClient :: ZonesAPI (AsClientT ClientM)
zonesClient :: ZonesAPI (AsClientT ClientM)
zonesClient = ToServant ZonesAPI (AsClientT ClientM)
-> ZonesAPI (AsClientT ClientM)
forall (routes :: * -> *) mode.
GenericServant routes mode =>
ToServant routes mode -> routes mode
fromServant (PowerDNS (AsClientT ClientM)
-> AsClientT ClientM :- ToServantApi ZonesAPI
forall f. PowerDNS f -> f :- ToServantApi ZonesAPI
zones PowerDNS (AsClientT ClientM)
pdnsClient)
listZones :: T.Text
-> Maybe T.Text
-> Maybe Bool
-> ClientM [Zone]
listZones :: Text -> Maybe Text -> Maybe Bool -> ClientM [Zone]
listZones = ZonesAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (QueryParam "zone" Text
:> (QueryParam "dnssec" Bool :> Get '[JSON] [Zone])))))
forall f.
ZonesAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (QueryParam "zone" Text
:> (QueryParam "dnssec" Bool :> Get '[JSON] [Zone])))))
apiListZones ZonesAPI (AsClientT ClientM)
zonesClient
createZone :: T.Text
-> Maybe Bool
-> Zone
-> ClientM Zone
createZone :: Text -> Maybe Bool -> Zone -> ClientM Zone
createZone = ZonesAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (QueryParam "rrset" Bool
:> (ReqBody '[JSON] Zone :> PostCreated '[JSON] Zone)))))
forall f.
ZonesAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (QueryParam "rrset" Bool
:> (ReqBody '[JSON] Zone :> PostCreated '[JSON] Zone)))))
apiCreateZone ZonesAPI (AsClientT ClientM)
zonesClient
getZone :: T.Text
-> T.Text
-> Maybe Bool
-> ClientM Zone
getZone :: Text -> Text -> Maybe Bool -> ClientM Zone
getZone = ZonesAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> (QueryParam "rrsets" Bool :> Get '[JSON] Zone)))))
forall f.
ZonesAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> (QueryParam "rrsets" Bool :> Get '[JSON] Zone)))))
apiGetZone ZonesAPI (AsClientT ClientM)
zonesClient
deleteZone :: T.Text
-> T.Text
-> ClientM NoContent
deleteZone :: Text -> Text -> ClientM NoContent
deleteZone = ZonesAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("zones" :> (Capture "zone_id" Text :> DeleteNoContent))))
forall f.
ZonesAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("zones" :> (Capture "zone_id" Text :> DeleteNoContent))))
apiDeleteZone ZonesAPI (AsClientT ClientM)
zonesClient
updateRecords :: T.Text
-> T.Text
-> RRSets
-> ClientM NoContent
updateRecords :: Text -> Text -> RRSets -> ClientM NoContent
updateRecords = ZonesAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> (ReqBody '[JSON] RRSets :> PatchNoContent)))))
forall f.
ZonesAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> (ReqBody '[JSON] RRSets :> PatchNoContent)))))
apiUpdateRecords ZonesAPI (AsClientT ClientM)
zonesClient
updateZone :: T.Text
-> T.Text
-> Zone
-> ClientM NoContent
updateZone :: Text -> Text -> Zone -> ClientM NoContent
updateZone = ZonesAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> (ReqBody '[JSON] Zone :> PutNoContent)))))
forall f.
ZonesAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> (ReqBody '[JSON] Zone :> PutNoContent)))))
apiUpdateZone ZonesAPI (AsClientT ClientM)
zonesClient
triggerAxfr :: T.Text
-> T.Text
-> ClientM NoContent
triggerAxfr :: Text -> Text -> ClientM NoContent
triggerAxfr = ZonesAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("axfr-retrieve" :> Put '[JSON] NoContent)))))
forall f.
ZonesAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("axfr-retrieve" :> Put '[JSON] NoContent)))))
apiTriggerAxfr ZonesAPI (AsClientT ClientM)
zonesClient
notifySlaves :: T.Text
-> T.Text
-> ClientM NoContent
notifySlaves :: Text -> Text -> ClientM NoContent
notifySlaves = ZonesAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("notify" :> Put '[JSON] NoContent)))))
forall f.
ZonesAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("notify" :> Put '[JSON] NoContent)))))
apiNotifySlaves ZonesAPI (AsClientT ClientM)
zonesClient
getZoneAxfr :: T.Text
-> T.Text
-> ClientM T.Text
getZoneAxfr :: Text -> Text -> ClientM Text
getZoneAxfr = ZonesAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text :> ("export" :> Get '[JSON] Text)))))
forall f.
ZonesAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text :> ("export" :> Get '[JSON] Text)))))
apiGetZoneAxfr ZonesAPI (AsClientT ClientM)
zonesClient
rectifyZone :: T.Text
-> T.Text
-> ClientM T.Text
rectifyZone :: Text -> Text -> ClientM Text
rectifyZone = ZonesAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text :> ("rectify" :> Put '[JSON] Text)))))
forall f.
ZonesAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text :> ("rectify" :> Put '[JSON] Text)))))
apiRectifyZone ZonesAPI (AsClientT ClientM)
zonesClient
cryptokeysClient :: CryptokeysAPI (AsClientT ClientM)
cryptokeysClient :: CryptokeysAPI (AsClientT ClientM)
cryptokeysClient = ToServant CryptokeysAPI (AsClientT ClientM)
-> CryptokeysAPI (AsClientT ClientM)
forall (routes :: * -> *) mode.
GenericServant routes mode =>
ToServant routes mode -> routes mode
fromServant (PowerDNS (AsClientT ClientM)
-> AsClientT ClientM :- ToServantApi CryptokeysAPI
forall f. PowerDNS f -> f :- ToServantApi CryptokeysAPI
cryptokeys PowerDNS (AsClientT ClientM)
pdnsClient)
listCryptoKeys :: T.Text
-> T.Text
-> ClientM [Cryptokey]
listCryptoKeys :: Text -> Text -> ClientM [Cryptokey]
listCryptoKeys = CryptokeysAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys" :> Get '[JSON] [Cryptokey])))))
forall f.
CryptokeysAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys" :> Get '[JSON] [Cryptokey])))))
apiListCryptokeys CryptokeysAPI (AsClientT ClientM)
cryptokeysClient
createCryptokey :: T.Text
-> T.Text
-> Cryptokey
-> ClientM Cryptokey
createCryptokey :: Text -> Text -> Cryptokey -> ClientM Cryptokey
createCryptokey = CryptokeysAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys"
:> (ReqBody '[JSON] Cryptokey
:> PostCreated '[JSON] Cryptokey))))))
forall f.
CryptokeysAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys"
:> (ReqBody '[JSON] Cryptokey
:> PostCreated '[JSON] Cryptokey))))))
apiCreateCryptokey CryptokeysAPI (AsClientT ClientM)
cryptokeysClient
getCryptokey :: T.Text
-> T.Text
-> T.Text
-> ClientM Cryptokey
getCryptokey :: Text -> Text -> Text -> ClientM Cryptokey
getCryptokey = CryptokeysAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys"
:> (Capture "cryptokey_id" Text :> Get '[JSON] Cryptokey))))))
forall f.
CryptokeysAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys"
:> (Capture "cryptokey_id" Text :> Get '[JSON] Cryptokey))))))
apiGetCryptokey CryptokeysAPI (AsClientT ClientM)
cryptokeysClient
updateCryptokey :: T.Text
-> T.Text
-> T.Text
-> Cryptokey
-> ClientM NoContent
updateCryptokey :: Text -> Text -> Text -> Cryptokey -> ClientM NoContent
updateCryptokey = CryptokeysAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys"
:> (Capture "cryptokey_id" Text
:> (ReqBody '[JSON] Cryptokey :> PutNoContent)))))))
forall f.
CryptokeysAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys"
:> (Capture "cryptokey_id" Text
:> (ReqBody '[JSON] Cryptokey :> PutNoContent)))))))
apiUpdateCryptokey CryptokeysAPI (AsClientT ClientM)
cryptokeysClient
deleteCryptokey :: T.Text
-> T.Text
-> T.Text
-> ClientM NoContent
deleteCryptokey :: Text -> Text -> Text -> ClientM NoContent
deleteCryptokey = CryptokeysAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys"
:> (Capture "cryptokey_id" Text :> DeleteNoContent))))))
forall f.
CryptokeysAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("cryptokeys"
:> (Capture "cryptokey_id" Text :> DeleteNoContent))))))
apiDeleteCryptokey CryptokeysAPI (AsClientT ClientM)
cryptokeysClient
serversClient :: ServersAPI (AsClientT ClientM)
serversClient :: ServersAPI (AsClientT ClientM)
serversClient = ToServant ServersAPI (AsClientT ClientM)
-> ServersAPI (AsClientT ClientM)
forall (routes :: * -> *) mode.
GenericServant routes mode =>
ToServant routes mode -> routes mode
fromServant (PowerDNS (AsClientT ClientM)
-> AsClientT ClientM :- ToServantApi ServersAPI
forall f. PowerDNS f -> f :- ToServantApi ServersAPI
servers PowerDNS (AsClientT ClientM)
pdnsClient)
listServers :: ClientM [Server]
listServers :: ClientM [Server]
listServers = ServersAPI (AsClientT ClientM)
-> AsClientT ClientM :- ("servers" :> Get '[JSON] [Server])
forall f. ServersAPI f -> f :- ("servers" :> Get '[JSON] [Server])
apiListServers ServersAPI (AsClientT ClientM)
serversClient
getServer :: T.Text
-> ClientM Server
getServer :: Text -> ClientM Server
getServer = ServersAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers" :> (Capture "server_id" Text :> Get '[JSON] Server))
forall f.
ServersAPI f
-> f
:- ("servers" :> (Capture "server_id" Text :> Get '[JSON] Server))
apiGetServer ServersAPI (AsClientT ClientM)
serversClient
search :: T.Text
-> T.Text
-> Integer
-> Maybe ObjectType
-> ClientM [SearchResult]
search :: Text
-> Text -> Integer -> Maybe ObjectType -> ClientM [SearchResult]
search = ServersAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("search-data"
:> (QueryParamReq "q" Text
:> (QueryParamReq "max" Integer
:> (QueryParam "object_type" ObjectType
:> Get '[JSON] [SearchResult]))))))
forall f.
ServersAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("search-data"
:> (QueryParamReq "q" Text
:> (QueryParamReq "max" Integer
:> (QueryParam "object_type" ObjectType
:> Get '[JSON] [SearchResult]))))))
apiSearch ServersAPI (AsClientT ClientM)
serversClient
flushCache :: T.Text
-> T.Text
-> ClientM CacheFlushResult
flushCache :: Text -> Text -> ClientM CacheFlushResult
flushCache = ServersAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> (QueryParamReq "domain" Text :> Put '[JSON] CacheFlushResult)))
forall f.
ServersAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> (QueryParamReq "domain" Text :> Put '[JSON] CacheFlushResult)))
apiFlushCache ServersAPI (AsClientT ClientM)
serversClient
statistics :: T.Text
-> Maybe T.Text
-> Maybe Bool
-> ClientM [AnyStatisticItem]
statistics :: Text -> Maybe Text -> Maybe Bool -> ClientM [AnyStatisticItem]
statistics = ServersAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("statistics"
:> (QueryParam "statistic" Text
:> (QueryParam "includerings" Bool
:> Get '[JSON] [AnyStatisticItem])))))
forall f.
ServersAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("statistics"
:> (QueryParam "statistic" Text
:> (QueryParam "includerings" Bool
:> Get '[JSON] [AnyStatisticItem])))))
apiStatistics ServersAPI (AsClientT ClientM)
serversClient
metadataClient :: MetadataAPI (AsClientT ClientM)
metadataClient :: MetadataAPI (AsClientT ClientM)
metadataClient = ToServant MetadataAPI (AsClientT ClientM)
-> MetadataAPI (AsClientT ClientM)
forall (routes :: * -> *) mode.
GenericServant routes mode =>
ToServant routes mode -> routes mode
fromServant (PowerDNS (AsClientT ClientM)
-> AsClientT ClientM :- ToServantApi MetadataAPI
forall f. PowerDNS f -> f :- ToServantApi MetadataAPI
metadata PowerDNS (AsClientT ClientM)
pdnsClient)
listMetadata :: T.Text
-> T.Text
-> ClientM [Metadata]
listMetadata :: Text -> Text -> ClientM [Metadata]
listMetadata = MetadataAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata" :> Get '[JSON] [Metadata])))))
forall f.
MetadataAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata" :> Get '[JSON] [Metadata])))))
apiListMetadata MetadataAPI (AsClientT ClientM)
metadataClient
createMetadata :: T.Text
-> T.Text
-> Metadata
-> ClientM NoContent
createMetadata :: Text -> Text -> Metadata -> ClientM NoContent
createMetadata = MetadataAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata" :> (ReqBody '[JSON] Metadata :> PostNoContent))))))
forall f.
MetadataAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata" :> (ReqBody '[JSON] Metadata :> PostNoContent))))))
apiCreateMetadata MetadataAPI (AsClientT ClientM)
metadataClient
getMetadata :: T.Text
-> T.Text
-> T.Text
-> ClientM Metadata
getMetadata :: Text -> Text -> Text -> ClientM Metadata
getMetadata = MetadataAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata"
:> (Capture "kind" Text :> Get '[JSON] Metadata))))))
forall f.
MetadataAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata"
:> (Capture "kind" Text :> Get '[JSON] Metadata))))))
apiGetMetadata MetadataAPI (AsClientT ClientM)
metadataClient
updateMetadata :: T.Text
-> T.Text
-> T.Text
-> Metadata
-> ClientM Metadata
updateMetadata :: Text -> Text -> Text -> Metadata -> ClientM Metadata
updateMetadata = MetadataAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata"
:> (Capture "kind" Text
:> (ReqBody '[JSON] Metadata :> Put '[JSON] Metadata)))))))
forall f.
MetadataAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata"
:> (Capture "kind" Text
:> (ReqBody '[JSON] Metadata :> Put '[JSON] Metadata)))))))
apiUpdateMetadata MetadataAPI (AsClientT ClientM)
metadataClient
deleteMetadata :: T.Text
-> T.Text
-> T.Text
-> ClientM NoContent
deleteMetadata :: Text -> Text -> Text -> ClientM NoContent
deleteMetadata = MetadataAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata" :> (Capture "kind" Text :> DeleteNoContent))))))
forall f.
MetadataAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("zones"
:> (Capture "zone_id" Text
:> ("metadata" :> (Capture "kind" Text :> DeleteNoContent))))))
apiDeleteMetadata MetadataAPI (AsClientT ClientM)
metadataClient
tsigkeysClient :: TSIGKeysAPI (AsClientT ClientM)
tsigkeysClient :: TSIGKeysAPI (AsClientT ClientM)
tsigkeysClient = ToServant TSIGKeysAPI (AsClientT ClientM)
-> TSIGKeysAPI (AsClientT ClientM)
forall (routes :: * -> *) mode.
GenericServant routes mode =>
ToServant routes mode -> routes mode
fromServant (PowerDNS (AsClientT ClientM)
-> AsClientT ClientM :- ToServantApi TSIGKeysAPI
forall f. PowerDNS f -> f :- ToServantApi TSIGKeysAPI
tsigkeys PowerDNS (AsClientT ClientM)
pdnsClient)
listTSIGKeys :: T.Text -> ClientM [TSIGKey]
listTSIGKeys :: Text -> ClientM [TSIGKey]
listTSIGKeys = TSIGKeysAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("tsigkeys" :> Get '[JSON] [TSIGKey])))
forall f.
TSIGKeysAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("tsigkeys" :> Get '[JSON] [TSIGKey])))
apiListTSIGKeys TSIGKeysAPI (AsClientT ClientM)
tsigkeysClient
createTSIGKey :: T.Text -> TSIGKey -> ClientM TSIGKey
createTSIGKey :: Text -> TSIGKey -> ClientM TSIGKey
createTSIGKey = TSIGKeysAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("tsigkeys"
:> (ReqBody '[JSON] TSIGKey :> PostCreated '[JSON] TSIGKey))))
forall f.
TSIGKeysAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("tsigkeys"
:> (ReqBody '[JSON] TSIGKey :> PostCreated '[JSON] TSIGKey))))
apiCreateTSIGKey TSIGKeysAPI (AsClientT ClientM)
tsigkeysClient
getTSIGKey :: T.Text -> T.Text -> ClientM TSIGKey
getTSIGKey :: Text -> Text -> ClientM TSIGKey
getTSIGKey = TSIGKeysAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("tsigkeys"
:> (Capture "tsigkey_id" Text :> Get '[JSON] TSIGKey))))
forall f.
TSIGKeysAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("tsigkeys"
:> (Capture "tsigkey_id" Text :> Get '[JSON] TSIGKey))))
apiGetTSIGKey TSIGKeysAPI (AsClientT ClientM)
tsigkeysClient
updateTSIGKey :: T.Text -> T.Text -> TSIGKey -> ClientM TSIGKey
updateTSIGKey :: Text -> Text -> TSIGKey -> ClientM TSIGKey
updateTSIGKey = TSIGKeysAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("tsigkeys"
:> (Capture "tsigkey_id" Text
:> (ReqBody '[JSON] TSIGKey :> Put '[JSON] TSIGKey)))))
forall f.
TSIGKeysAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("tsigkeys"
:> (Capture "tsigkey_id" Text
:> (ReqBody '[JSON] TSIGKey :> Put '[JSON] TSIGKey)))))
apiUpdateTSIGKey TSIGKeysAPI (AsClientT ClientM)
tsigkeysClient
deleteTSIGKey :: T.Text -> T.Text -> ClientM NoContent
deleteTSIGKey :: Text -> Text -> ClientM NoContent
deleteTSIGKey = TSIGKeysAPI (AsClientT ClientM)
-> AsClientT ClientM
:- ("servers"
:> (Capture "server_id" Text
:> ("tsigkeys" :> (Capture "tsigkey_id" Text :> DeleteNoContent))))
forall f.
TSIGKeysAPI f
-> f
:- ("servers"
:> (Capture "server_id" Text
:> ("tsigkeys" :> (Capture "tsigkey_id" Text :> DeleteNoContent))))
apiDeleteTSIGKey TSIGKeysAPI (AsClientT ClientM)
tsigkeysClient