Revision 5ce9cc30
b/src/Ganeti/Rpc.hs | ||
---|---|---|
77 | 77 |
, RpcResultExportList(..) |
78 | 78 |
|
79 | 79 |
, RpcCallJobqueueUpdate(..) |
80 |
, RpcCallSetWatcherPause(..) |
|
80 | 81 |
) where |
81 | 82 |
|
82 | 83 |
import Control.Arrow (second) |
... | ... | |
588 | 589 |
_ -> Left $ JsonDecodeError |
589 | 590 |
("Expected JSNull, got " ++ show (pp_value res)) |
590 | 591 |
|
592 |
-- ** Watcher Status Update |
|
593 |
|
|
594 |
-- | Set the watcher status |
|
595 |
|
|
596 |
$(buildObject "RpcCallSetWatcherPause" "rpcCallSetWatcherPause" |
|
597 |
[ simpleField "time" [t| Maybe Double |] |
|
598 |
]) |
|
599 |
|
|
600 |
instance RpcCall RpcCallSetWatcherPause where |
|
601 |
rpcCallName _ = "set_watcher_pause" |
|
602 |
rpcCallTimeout _ = rpcTimeoutToRaw Fast |
|
603 |
rpcCallAcceptOffline _ = False |
|
604 |
rpcCallData _ call = J.encode |
|
605 |
[ maybe J.JSNull J.showJSON $ rpcCallSetWatcherPauseTime call ] |
|
606 |
|
|
607 |
$(buildObject "RpcResultSetWatcherPause" "rpcResultSetWatcherPause" []) |
|
608 |
|
|
609 |
instance Rpc RpcCallSetWatcherPause RpcResultSetWatcherPause where |
|
610 |
rpcResultFill _ res = |
|
611 |
case res of |
|
612 |
J.JSNull -> Right RpcResultSetWatcherPause |
|
613 |
_ -> Left $ JsonDecodeError |
|
614 |
("Expected JSNull, got " ++ show (pp_value res)) |
|
615 |
|
Also available in: Unified diff