Add some admin messages: GenerateAllZoneFiles + GenerateZoneFile.

beta
Philippe Pittoli 2024-02-25 06:30:28 +01:00
parent 0793b2c878
commit b155ee1d2f
1 changed files with 36 additions and 22 deletions

View File

@ -85,6 +85,16 @@ type DeleteRR = { domain :: String, rrid :: Int }
codecDeleteRR ∷ CA.JsonCodec DeleteRR codecDeleteRR ∷ CA.JsonCodec DeleteRR
codecDeleteRR = CA.object "DeleteRR" (CAR.record { domain: CA.string, rrid: CA.int }) codecDeleteRR = CA.object "DeleteRR" (CAR.record { domain: CA.string, rrid: CA.int })
{- 100 -}
type GenerateAllZoneFiles = {}
codecGenerateAllZoneFiles ∷ CA.JsonCodec GenerateAllZoneFiles
codecGenerateAllZoneFiles = CA.object "GenerateAllZoneFiles" (CAR.record {})
{- 101 -}
type GenerateZoneFile = { domain :: String }
codecGenerateZoneFile ∷ CA.JsonCodec GenerateZoneFile
codecGenerateZoneFile = CA.object "GenerateZoneFile" (CAR.record { domain: CA.string })
{- 250 -} {- 250 -}
type KeepAlive = { } type KeepAlive = { }
codecKeepAlive ∷ CA.JsonCodec KeepAlive codecKeepAlive ∷ CA.JsonCodec KeepAlive
@ -248,6 +258,8 @@ data RequestMessage
| MkAddRR AddRR -- 14 | MkAddRR AddRR -- 14
| MkUpdateRR UpdateRR -- 15 | MkUpdateRR UpdateRR -- 15
| MkDeleteRR DeleteRR -- 16 | MkDeleteRR DeleteRR -- 16
| MkGenerateAllZoneFiles GenerateAllZoneFiles -- 100
| MkGenerateZoneFile GenerateZoneFile -- 101
| MkKeepAlive KeepAlive -- 250 | MkKeepAlive KeepAlive -- 250
-- All possible answers from the authentication daemon (authd). -- All possible answers from the authentication daemon (authd).
@ -292,6 +304,8 @@ encode m = case m of
(MkAddRR request) -> get_tuple 14 codecAddRR request (MkAddRR request) -> get_tuple 14 codecAddRR request
(MkUpdateRR request) -> get_tuple 15 codecUpdateRR request (MkUpdateRR request) -> get_tuple 15 codecUpdateRR request
(MkDeleteRR request) -> get_tuple 16 codecDeleteRR request (MkDeleteRR request) -> get_tuple 16 codecDeleteRR request
(MkGenerateAllZoneFiles request) -> get_tuple 100 codecGenerateAllZoneFiles request
(MkGenerateZoneFile request) -> get_tuple 101 codecGenerateZoneFile request
(MkKeepAlive request) -> get_tuple 250 codecKeepAlive request (MkKeepAlive request) -> get_tuple 250 codecKeepAlive request
where where
get_tuple :: forall a. Int -> CA.JsonCodec a -> a -> Tuple UInt String get_tuple :: forall a. Int -> CA.JsonCodec a -> a -> Tuple UInt String