Revision 83a451f5
b/src/Ganeti/Rpc.hs | ||
---|---|---|
78 | 78 |
|
79 | 79 |
, RpcCallJobqueueUpdate(..) |
80 | 80 |
, RpcCallSetWatcherPause(..) |
81 |
, RpcCallSetDrainFlag(..) |
|
81 | 82 |
) where |
82 | 83 |
|
83 | 84 |
import Control.Arrow (second) |
... | ... | |
628 | 629 |
_ -> Left $ JsonDecodeError |
629 | 630 |
("Expected JSNull, got " ++ show (pp_value res)) |
630 | 631 |
|
632 |
-- ** Queue drain status |
|
633 |
|
|
634 |
-- | Set the queu drain flag |
|
635 |
|
|
636 |
$(buildObject "RpcCallSetDrainFlag" "rpcCallSetDrainFlag" |
|
637 |
[ simpleField "value" [t| Bool |] |
|
638 |
]) |
|
639 |
|
|
640 |
instance RpcCall RpcCallSetDrainFlag where |
|
641 |
rpcCallName _ = "jobqueue_set_drain_flag" |
|
642 |
rpcCallTimeout _ = rpcTimeoutToRaw Fast |
|
643 |
rpcCallAcceptOffline _ = False |
|
644 |
rpcCallData _ call = J.encode [ rpcCallSetDrainFlagValue call ] |
|
645 |
|
|
646 |
$(buildObject "RpcResultSetDrainFlag" "rpcResultSetDrainFalg" []) |
|
647 |
|
|
648 |
instance Rpc RpcCallSetDrainFlag RpcResultSetDrainFlag where |
|
649 |
rpcResultFill _ res = |
|
650 |
case res of |
|
651 |
J.JSNull -> Right RpcResultSetDrainFlag |
|
652 |
_ -> Left $ JsonDecodeError |
|
653 |
("Expected JSNull, got " ++ show (pp_value res)) |
|
654 |
|
Also available in: Unified diff