Commit eccf096a authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Add an RPC call to activate the master IP



We need to be able to do this from Haskell, as
this task has to be taken over by luxid.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent e181c8cd
...@@ -49,6 +49,9 @@ module Ganeti.Rpc ...@@ -49,6 +49,9 @@ module Ganeti.Rpc
, toCompressed , toCompressed
, getCompressed , getCompressed
, RpcCallNodeActivateMasterIp(..)
, RpcResultNodeActivateMasterIp(..)
, RpcCallInstanceInfo(..) , RpcCallInstanceInfo(..)
, InstanceState(..) , InstanceState(..)
, InstanceInfo(..) , InstanceInfo(..)
...@@ -790,3 +793,25 @@ instance Rpc RpcCallWriteSsconfFiles RpcResultWriteSsconfFiles where ...@@ -790,3 +793,25 @@ instance Rpc RpcCallWriteSsconfFiles RpcResultWriteSsconfFiles where
J.JSNull -> Right RpcResultWriteSsconfFiles J.JSNull -> Right RpcResultWriteSsconfFiles
_ -> Left $ JsonDecodeError _ -> Left $ JsonDecodeError
("Expected JSNull, got " ++ show (pp_value res)) ("Expected JSNull, got " ++ show (pp_value res))
-- | Activate the master IP address
$(buildObject "RpcCallNodeActivateMasterIp" "rpcCallNodeActivateMasterIp"
[ simpleField "params" [t| MasterNetworkParameters |]
, simpleField "ems" [t| Bool |]
])
instance RpcCall RpcCallNodeActivateMasterIp where
rpcCallName _ = "node_activate_master_ip"
rpcCallTimeout _ = rpcTimeoutToRaw Fast
rpcCallAcceptOffline _ = False
$(buildObject "RpcResultNodeActivateMasterIp" "rpcResultNodeActivateMasterIp"
[])
instance Rpc RpcCallNodeActivateMasterIp RpcResultNodeActivateMasterIp where
rpcResultFill _ res =
case res of
J.JSNull -> Right RpcResultNodeActivateMasterIp
_ -> Left $ JsonDecodeError
("Expected JSNull, got " ++ show (pp_value res))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment