Revision 40ad3e85 src/Ganeti/Rpc.hs

b/src/Ganeti/Rpc.hs
77 77
  , RpcResultExportList(..)
78 78

  
79 79
  , RpcCallJobqueueUpdate(..)
80
  , RpcCallJobqueueRename(..)
80 81
  , RpcCallSetWatcherPause(..)
81 82
  , RpcCallSetDrainFlag(..)
82 83
  ) where
......
605 606
      _ -> Left $ JsonDecodeError
606 607
           ("Expected JSNull, got " ++ show (pp_value res))
607 608

  
609
-- | Rename a file in the job queue
610

  
611
$(buildObject "RpcCallJobqueueRename" "rpcCallJobqueueRename"
612
  [ simpleField "rename" [t| [(String, String)] |]
613
  ])
614

  
615
$(buildObject "RpcResultJobqueueRename" "rpcResultJobqueueRename" [])
616

  
617
instance RpcCall RpcCallJobqueueRename where
618
  rpcCallName _          = "jobqueue_rename"
619
  rpcCallTimeout _       = rpcTimeoutToRaw Fast
620
  rpcCallAcceptOffline _ = False
621
  rpcCallData _ call     = J.encode [ rpcCallJobqueueRenameRename call ]
622

  
623
instance Rpc RpcCallJobqueueRename RpcResultJobqueueRename where
624
  rpcResultFill _ res =
625
    case res of
626
      J.JSNull -> Right RpcResultJobqueueRename
627
      _ -> Left $ JsonDecodeError
628
           ("Expected JSNull, got " ++ show (pp_value res))
629

  
608 630
-- ** Watcher Status Update
609 631
      
610 632
-- | Set the watcher status

Also available in: Unified diff