Safe Haskell | None |
---|
Implementation of the RPC client.
Synopsis
- curlOpts :: [CurlOption]
- data RpcError
- = CurlLayerError String
- | JsonDecodeError String
- | RpcResultError String
- | OfflineNodeError
- explainRpcError :: RpcError -> String
- type ERpcError = Either RpcError
- class ArrayObject a => RpcCall a where
- rpcCallName :: a -> String
- rpcCallTimeout :: a -> Int
- rpcCallData :: a -> String
- rpcCallAcceptOffline :: a -> Bool
- class (RpcCall a, JSON b) => Rpc a b | a -> b, b -> a where
- rpcResultFill :: a -> JSValue -> ERpcError b
- data HttpClientRequest = HttpClientRequest {
- requestUrl :: String
- requestData :: String
- requestOpts :: [CurlOption]
- isIpV6 :: String -> Bool
- prepareUrl :: RpcCall a => Int -> Node -> a -> String
- prepareHttpRequest :: RpcCall a => Int -> [CurlOption] -> Node -> String -> a -> ERpcError HttpClientRequest
- parseHttpReply :: Rpc a b => a -> ERpcError (CurlCode, String) -> ERpcError b
- parseHttpResponse :: Rpc a b => a -> String -> ERpcError b
- rpcErrors :: [(a, ERpcError b)] -> [(a, RpcError)]
- logRpcErrors :: (MonadLog m, Show a) => [(a, ERpcError b)] -> m [(a, RpcError)]
- getOptionsForCall :: Rpc a b => FilePath -> FilePath -> a -> [CurlOption]
- getNodedPort :: IO Int
- executeRpcCalls :: Rpc a b => [(Node, a)] -> IO [(Node, ERpcError b)]
- executeRpcCalls' :: Rpc a b => [(Node, a, String)] -> IO [(Node, ERpcError b)]
- executeRpcCall :: Rpc a b => [Node] -> a -> IO [(Node, ERpcError b)]
- sanitizeDictResults :: [(String, Result a)] -> ERpcError [(String, a)]
- fromJResultToRes :: Result a -> (a -> b) -> ERpcError b
- fromJSValueToRes :: JSON a => JSValue -> (a -> b) -> ERpcError b
- newtype Compressed = Compressed {
- getCompressed :: ByteString
- packCompressed :: ByteString -> Compressed
- toCompressed :: String -> Compressed
- data RpcCallInstanceInfo = RpcCallInstanceInfo {
- rpcCallInstInfoInstance :: String
- rpcCallInstInfoHname :: Hypervisor
- loadRpcCallInstanceInfo :: JSValue -> Result RpcCallInstanceInfo
- saveRpcCallInstanceInfo :: RpcCallInstanceInfo -> JSValue
- data InstanceState
- instanceStateFromRaw :: forall m. (Monad m, MonadFail m) => Int -> m InstanceState
- instanceStateToRaw :: InstanceState -> Int
- _InstanceStateShutdown :: Int
- _InstanceStateRunning :: Int
- data InstanceInfo = InstanceInfo {
- instInfoMemory :: Int
- instInfoState :: InstanceState
- instInfoVcpus :: Int
- instInfoTime :: Int
- loadInstanceInfo :: JSValue -> Result InstanceInfo
- saveInstanceInfo :: InstanceInfo -> JSValue
- data RpcResultInstanceInfo = RpcResultInstanceInfo {
- rpcResInstInfoInstInfo :: (Maybe InstanceInfo)
- loadRpcResultInstanceInfo :: JSValue -> Result RpcResultInstanceInfo
- saveRpcResultInstanceInfo :: RpcResultInstanceInfo -> JSValue
- data RpcCallAllInstancesInfo = RpcCallAllInstancesInfo {}
- loadRpcCallAllInstancesInfo :: JSValue -> Result RpcCallAllInstancesInfo
- saveRpcCallAllInstancesInfo :: RpcCallAllInstancesInfo -> JSValue
- data RpcResultAllInstancesInfo = RpcResultAllInstancesInfo {
- rpcResAllInstInfoInstances :: [(String, InstanceInfo)]
- loadRpcResultAllInstancesInfo :: JSValue -> Result RpcResultAllInstancesInfo
- saveRpcResultAllInstancesInfo :: RpcResultAllInstancesInfo -> JSValue
- data InstanceConsoleInfoParams = InstanceConsoleInfoParams {}
- loadInstanceConsoleInfoParams :: JSValue -> Result InstanceConsoleInfoParams
- saveInstanceConsoleInfoParams :: InstanceConsoleInfoParams -> JSValue
- data RpcCallInstanceConsoleInfo = RpcCallInstanceConsoleInfo {
- rpcCallInstConsInfoInstanceInfo :: [(String, InstanceConsoleInfoParams)]
- loadRpcCallInstanceConsoleInfo :: JSValue -> Result RpcCallInstanceConsoleInfo
- saveRpcCallInstanceConsoleInfo :: RpcCallInstanceConsoleInfo -> JSValue
- data InstanceConsoleInfo = InstanceConsoleInfo {
- instConsInfoInstance :: String
- instConsInfoKind :: String
- instConsInfoMessage :: (Maybe String)
- instConsInfoHost :: (Maybe String)
- instConsInfoPort :: (Maybe Int)
- instConsInfoUser :: (Maybe String)
- instConsInfoCommand :: (Maybe [String])
- instConsInfoDisplay :: (Maybe String)
- loadInstanceConsoleInfo :: JSValue -> Result InstanceConsoleInfo
- saveInstanceConsoleInfo :: InstanceConsoleInfo -> JSValue
- data RpcResultInstanceConsoleInfo = RpcResultInstanceConsoleInfo {
- rpcResInstConsInfoInstancesInfo :: [(String, InstanceConsoleInfo)]
- loadRpcResultInstanceConsoleInfo :: JSValue -> Result RpcResultInstanceConsoleInfo
- saveRpcResultInstanceConsoleInfo :: RpcResultInstanceConsoleInfo -> JSValue
- data RpcCallInstanceList = RpcCallInstanceList {}
- loadRpcCallInstanceList :: JSValue -> Result RpcCallInstanceList
- saveRpcCallInstanceList :: RpcCallInstanceList -> JSValue
- data RpcResultInstanceList = RpcResultInstanceList {
- rpcResInstListInstances :: [String]
- loadRpcResultInstanceList :: JSValue -> Result RpcResultInstanceList
- saveRpcResultInstanceList :: RpcResultInstanceList -> JSValue
- data RpcCallNodeInfo = RpcCallNodeInfo {}
- loadRpcCallNodeInfo :: JSValue -> Result RpcCallNodeInfo
- saveRpcCallNodeInfo :: RpcCallNodeInfo -> JSValue
- data StorageInfo = StorageInfo {
- storageInfoName :: String
- storageInfoType :: String
- storageInfoStorageFree :: (Maybe Int)
- storageInfoStorageSize :: (Maybe Int)
- loadStorageInfo :: JSValue -> Result StorageInfo
- saveStorageInfo :: StorageInfo -> JSValue
- data HvInfo = HvInfo {
- hvInfoHvVersion :: (Maybe [Int])
- hvInfoMemoryTotal :: Int
- hvInfoMemoryFree :: Int
- hvInfoMemoryDom0 :: Int
- hvInfoMemoryHv :: (Maybe Int)
- hvInfoCpuTotal :: Int
- hvInfoCpuNodes :: Int
- hvInfoCpuSockets :: Int
- hvInfoCpuDom0 :: Int
- loadHvInfo :: JSValue -> Result HvInfo
- saveHvInfo :: HvInfo -> JSValue
- data RpcResultNodeInfo = RpcResultNodeInfo {
- rpcResNodeInfoBootId :: String
- rpcResNodeInfoStorageInfo :: [StorageInfo]
- rpcResNodeInfoHvInfo :: [HvInfo]
- loadRpcResultNodeInfo :: JSValue -> Result RpcResultNodeInfo
- saveRpcResultNodeInfo :: RpcResultNodeInfo -> JSValue
- data RpcCallVersion = RpcCallVersion {
- loadRpcCallVersion :: JSValue -> Result RpcCallVersion
- saveRpcCallVersion :: RpcCallVersion -> JSValue
- data RpcResultVersion = RpcResultVersion {
- rpcResultVersionVersion :: Int
- loadRpcResultVersion :: JSValue -> Result RpcResultVersion
- saveRpcResultVersion :: RpcResultVersion -> JSValue
- data RpcCallStorageList = RpcCallStorageList {
- rpcCallStorageListSuName :: StorageType
- rpcCallStorageListSuArgs :: [String]
- rpcCallStorageListName :: String
- rpcCallStorageListFields :: [StorageField]
- loadRpcCallStorageList :: JSValue -> Result RpcCallStorageList
- saveRpcCallStorageList :: RpcCallStorageList -> JSValue
- data RpcResultStorageList = RpcResultStorageList {
- rpcResStorageListStorage :: [[(StorageField, JSValue)]]
- loadRpcResultStorageList :: JSValue -> Result RpcResultStorageList
- saveRpcResultStorageList :: RpcResultStorageList -> JSValue
- data RpcCallTestDelay = RpcCallTestDelay {
- rpcCallTestDelayDuration :: Double
- loadRpcCallTestDelay :: JSValue -> Result RpcCallTestDelay
- saveRpcCallTestDelay :: RpcCallTestDelay -> JSValue
- data RpcResultTestDelay = RpcResultTestDelay
- data RpcCallExportList = RpcCallExportList {
- loadRpcCallExportList :: JSValue -> Result RpcCallExportList
- saveRpcCallExportList :: RpcCallExportList -> JSValue
- data RpcResultExportList = RpcResultExportList {
- rpcResExportListExports :: [String]
- loadRpcResultExportList :: JSValue -> Result RpcResultExportList
- saveRpcResultExportList :: RpcResultExportList -> JSValue
- data RpcCallJobqueueUpdate = RpcCallJobqueueUpdate {
- rpcCallJobqueueUpdateFileName :: String
- rpcCallJobqueueUpdateContent :: String
- loadRpcCallJobqueueUpdate :: JSValue -> Result RpcCallJobqueueUpdate
- saveRpcCallJobqueueUpdate :: RpcCallJobqueueUpdate -> JSValue
- data RpcResultJobQueueUpdate = RpcResultJobQueueUpdate {
- loadRpcResultJobQueueUpdate :: JSValue -> Result RpcResultJobQueueUpdate
- saveRpcResultJobQueueUpdate :: RpcResultJobQueueUpdate -> JSValue
- data RpcCallJobqueueRename = RpcCallJobqueueRename {
- rpcCallJobqueueRenameRename :: [(String, String)]
- loadRpcCallJobqueueRename :: JSValue -> Result RpcCallJobqueueRename
- saveRpcCallJobqueueRename :: RpcCallJobqueueRename -> JSValue
- data RpcResultJobqueueRename = RpcResultJobqueueRename {
- loadRpcResultJobqueueRename :: JSValue -> Result RpcResultJobqueueRename
- saveRpcResultJobqueueRename :: RpcResultJobqueueRename -> JSValue
- data RpcCallSetWatcherPause = RpcCallSetWatcherPause {
- rpcCallSetWatcherPauseTime :: (Maybe ClockTime)
- loadRpcCallSetWatcherPause :: JSValue -> Result RpcCallSetWatcherPause
- saveRpcCallSetWatcherPause :: RpcCallSetWatcherPause -> JSValue
- data RpcResultSetWatcherPause = RpcResultSetWatcherPause {
- loadRpcResultSetWatcherPause :: JSValue -> Result RpcResultSetWatcherPause
- saveRpcResultSetWatcherPause :: RpcResultSetWatcherPause -> JSValue
- data RpcCallSetDrainFlag = RpcCallSetDrainFlag {
- rpcCallSetDrainFlagValue :: Bool
- loadRpcCallSetDrainFlag :: JSValue -> Result RpcCallSetDrainFlag
- saveRpcCallSetDrainFlag :: RpcCallSetDrainFlag -> JSValue
- data RpcResultSetDrainFlag = RpcResultSetDrainFlag {
- loadRpcResultSetDrainFlag :: JSValue -> Result RpcResultSetDrainFlag
- saveRpcResultSetDrainFlag :: RpcResultSetDrainFlag -> JSValue
- data RpcCallUploadFile = RpcCallUploadFile {
- rpcCallUploadFileFileName :: FilePath
- rpcCallUploadFileContent :: Compressed
- rpcCallUploadFileMode :: (Maybe FileMode)
- rpcCallUploadFileUid :: String
- rpcCallUploadFileGid :: String
- rpcCallUploadFileAtime :: ClockTime
- rpcCallUploadFileMtime :: ClockTime
- loadRpcCallUploadFile :: JSValue -> Result RpcCallUploadFile
- saveRpcCallUploadFile :: RpcCallUploadFile -> JSValue
- data RpcResultUploadFile = RpcResultUploadFile {
- loadRpcResultUploadFile :: JSValue -> Result RpcResultUploadFile
- saveRpcResultUploadFile :: RpcResultUploadFile -> JSValue
- prepareRpcCallUploadFile :: RuntimeEnts -> FilePath -> ResultG RpcCallUploadFile
- data RpcCallWriteSsconfFiles = RpcCallWriteSsconfFiles {}
- loadRpcCallWriteSsconfFiles :: JSValue -> Result RpcCallWriteSsconfFiles
- saveRpcCallWriteSsconfFiles :: RpcCallWriteSsconfFiles -> JSValue
- data RpcResultWriteSsconfFiles = RpcResultWriteSsconfFiles {
- loadRpcResultWriteSsconfFiles :: JSValue -> Result RpcResultWriteSsconfFiles
- saveRpcResultWriteSsconfFiles :: RpcResultWriteSsconfFiles -> JSValue
- data RpcCallNodeActivateMasterIp = RpcCallNodeActivateMasterIp {}
- loadRpcCallNodeActivateMasterIp :: JSValue -> Result RpcCallNodeActivateMasterIp
- saveRpcCallNodeActivateMasterIp :: RpcCallNodeActivateMasterIp -> JSValue
- data RpcResultNodeActivateMasterIp = RpcResultNodeActivateMasterIp {
- loadRpcResultNodeActivateMasterIp :: JSValue -> Result RpcResultNodeActivateMasterIp
- saveRpcResultNodeActivateMasterIp :: RpcResultNodeActivateMasterIp -> JSValue
- data RpcCallMasterNodeName = RpcCallMasterNodeName {
- loadRpcCallMasterNodeName :: JSValue -> Result RpcCallMasterNodeName
- saveRpcCallMasterNodeName :: RpcCallMasterNodeName -> JSValue
- data RpcResultMasterNodeName = RpcResultMasterNodeName {
- rpcResultMasterNodeNameMaster :: String
- loadRpcResultMasterNodeName :: JSValue -> Result RpcResultMasterNodeName
- saveRpcResultMasterNodeName :: RpcResultMasterNodeName -> JSValue
Base RPC functionality and types
Data type for RPC error reporting.
CurlLayerError String | |
JsonDecodeError String | |
RpcResultError String | |
OfflineNodeError |
explainRpcError :: RpcError -> String Source #
Provide explanation to RPC errors.
class ArrayObject a => RpcCall a where Source #
A generic class for RPC calls.
rpcCallName :: a -> String Source #
Give the (Python) name of the procedure.
rpcCallTimeout :: a -> Int Source #
Calculate the timeout value for the call execution.
rpcCallData :: a -> String Source #
Prepare arguments of the call to be send as POST.
rpcCallAcceptOffline :: a -> Bool Source #
Whether we accept offline nodes when making a call.
Instances
class (RpcCall a, JSON b) => Rpc a b | a -> b, b -> a where Source #
Generic class that ensures matching RPC call with its respective result.
rpcResultFill :: a -> JSValue -> ERpcError b Source #
Create a result based on the received HTTP response.
Instances
data HttpClientRequest Source #
Http Request definition.
HttpClientRequest | |
|
prepareUrl :: RpcCall a => Int -> Node -> a -> String Source #
Prepare url for the HTTP request.
prepareHttpRequest :: RpcCall a => Int -> [CurlOption] -> Node -> String -> a -> ERpcError HttpClientRequest Source #
Create HTTP request for a given node provided it is online, otherwise create empty response.
parseHttpReply :: Rpc a b => a -> ERpcError (CurlCode, String) -> ERpcError b Source #
Parse an HTTP reply.
parseHttpResponse :: Rpc a b => a -> String -> ERpcError b Source #
Parse a result based on the received HTTP response.
rpcErrors :: [(a, ERpcError b)] -> [(a, RpcError)] Source #
Scan the list of results produced by executeRpcCall and extract all the RPC errors.
logRpcErrors :: (MonadLog m, Show a) => [(a, ERpcError b)] -> m [(a, RpcError)] Source #
Scan the list of results produced by executeRpcCall and log all the RPC errors. Returns the list of errors for further processing.
getOptionsForCall :: Rpc a b => FilePath -> FilePath -> a -> [CurlOption] Source #
Get options for RPC call
getNodedPort :: IO Int Source #
Determine to port to call noded at.
executeRpcCalls :: Rpc a b => [(Node, a)] -> IO [(Node, ERpcError b)] Source #
Execute multiple distinct RPC calls in parallel
executeRpcCalls' :: Rpc a b => [(Node, a, String)] -> IO [(Node, ERpcError b)] Source #
Execute multiple RPC calls in parallel
executeRpcCall :: Rpc a b => [Node] -> a -> IO [(Node, ERpcError b)] Source #
Execute an RPC call for many nodes in parallel. NB this computes the RPC call payload string only once.
sanitizeDictResults :: [(String, Result a)] -> ERpcError [(String, a)] Source #
Helper function that is used to read dictionaries of values.
fromJResultToRes :: Result a -> (a -> b) -> ERpcError b Source #
Helper function to tranform JSON Result to Either RpcError b. Note: For now we really only use it for b s.t. Rpc c b for some c
fromJSValueToRes :: JSON a => JSValue -> (a -> b) -> ERpcError b Source #
Helper function transforming JSValue to Rpc result type.
newtype Compressed Source #
An opaque data type for representing data that might be compressed over the wire.
On Python side it is decompressed by backend._Decompress
.
Compressed | |
|
Instances
Eq Compressed # | |
Defined in Ganeti.Rpc (==) :: Compressed -> Compressed -> Bool (/=) :: Compressed -> Compressed -> Bool | |
Ord Compressed # | |
Defined in Ganeti.Rpc compare :: Compressed -> Compressed -> Ordering (<) :: Compressed -> Compressed -> Bool (<=) :: Compressed -> Compressed -> Bool (>) :: Compressed -> Compressed -> Bool (>=) :: Compressed -> Compressed -> Bool max :: Compressed -> Compressed -> Compressed min :: Compressed -> Compressed -> Compressed | |
Show Compressed # | |
Defined in Ganeti.Rpc showsPrec :: Int -> Compressed -> ShowS show :: Compressed -> String showList :: [Compressed] -> ShowS | |
JSON Compressed # | |
Defined in Ganeti.Rpc readJSON :: JSValue -> Result Compressed showJSON :: Compressed -> JSValue readJSONs :: JSValue -> Result [Compressed] showJSONs :: [Compressed] -> JSValue | |
Arbitrary Compressed | |
Defined in Test.Ganeti.Rpc arbitrary :: Gen Compressed shrink :: Compressed -> [Compressed] |
packCompressed :: ByteString -> Compressed Source #
toCompressed :: String -> Compressed Source #
RPC calls and results
Instance info
data RpcCallInstanceInfo Source #
Returns information about a single instance
Instances
loadRpcCallInstanceInfo :: JSValue -> Result RpcCallInstanceInfo Source #
saveRpcCallInstanceInfo :: RpcCallInstanceInfo -> JSValue Source #
data InstanceState Source #
Instances
instanceStateFromRaw :: forall m. (Monad m, MonadFail m) => Int -> m InstanceState Source #
instanceStateToRaw :: InstanceState -> Int Source #
_InstanceStateShutdown :: Int Source #
_InstanceStateRunning :: Int Source #
data InstanceInfo Source #
InstanceInfo | |
|
Instances
Eq InstanceInfo # | |
Defined in Ganeti.Rpc (==) :: InstanceInfo -> InstanceInfo -> Bool (/=) :: InstanceInfo -> InstanceInfo -> Bool | |
Show InstanceInfo # | |
Defined in Ganeti.Rpc showsPrec :: Int -> InstanceInfo -> ShowS show :: InstanceInfo -> String showList :: [InstanceInfo] -> ShowS | |
JSON InstanceInfo # | |
Defined in Ganeti.Rpc readJSON :: JSValue -> Result InstanceInfo showJSON :: InstanceInfo -> JSValue readJSONs :: JSValue -> Result [InstanceInfo] showJSONs :: [InstanceInfo] -> JSValue | |
ArrayObject InstanceInfo # | |
Defined in Ganeti.Rpc toJSArray :: InstanceInfo -> [JSValue] Source # fromJSArray :: [JSValue] -> Result InstanceInfo Source # | |
DictObject InstanceInfo # | |
Defined in Ganeti.Rpc toDict :: InstanceInfo -> [(String, JSValue)] Source # fromDictWKeys :: [(String, JSValue)] -> WriterT UsedKeys Result InstanceInfo Source # fromDict :: [(String, JSValue)] -> Result InstanceInfo Source # |
loadInstanceInfo :: JSValue -> Result InstanceInfo Source #
saveInstanceInfo :: InstanceInfo -> JSValue Source #
data RpcResultInstanceInfo Source #
Instances
loadRpcResultInstanceInfo :: JSValue -> Result RpcResultInstanceInfo Source #
saveRpcResultInstanceInfo :: RpcResultInstanceInfo -> JSValue Source #
AllInstancesInfo
data RpcCallAllInstancesInfo Source #
Returns information about all running instances on the given nodes
Instances
loadRpcCallAllInstancesInfo :: JSValue -> Result RpcCallAllInstancesInfo Source #
saveRpcCallAllInstancesInfo :: RpcCallAllInstancesInfo -> JSValue Source #
data RpcResultAllInstancesInfo Source #
RpcResultAllInstancesInfo | |
|
Instances
loadRpcResultAllInstancesInfo :: JSValue -> Result RpcResultAllInstancesInfo Source #
saveRpcResultAllInstancesInfo :: RpcResultAllInstancesInfo -> JSValue Source #
InstanceConsoleInfo
data InstanceConsoleInfoParams Source #
Returns information about how to access instances on the given node
Instances
loadInstanceConsoleInfoParams :: JSValue -> Result InstanceConsoleInfoParams Source #
saveInstanceConsoleInfoParams :: InstanceConsoleInfoParams -> JSValue Source #
data RpcCallInstanceConsoleInfo Source #
Instances
loadRpcCallInstanceConsoleInfo :: JSValue -> Result RpcCallInstanceConsoleInfo Source #
saveRpcCallInstanceConsoleInfo :: RpcCallInstanceConsoleInfo -> JSValue Source #
data InstanceConsoleInfo Source #
InstanceConsoleInfo | |
|
Instances
loadInstanceConsoleInfo :: JSValue -> Result InstanceConsoleInfo Source #
saveInstanceConsoleInfo :: InstanceConsoleInfo -> JSValue Source #
data RpcResultInstanceConsoleInfo Source #
Instances
loadRpcResultInstanceConsoleInfo :: JSValue -> Result RpcResultInstanceConsoleInfo Source #
saveRpcResultInstanceConsoleInfo :: RpcResultInstanceConsoleInfo -> JSValue Source #
InstanceList
data RpcCallInstanceList Source #
Returns the list of running instances on the given nodes
Instances
loadRpcCallInstanceList :: JSValue -> Result RpcCallInstanceList Source #
saveRpcCallInstanceList :: RpcCallInstanceList -> JSValue Source #
data RpcResultInstanceList Source #
RpcResultInstanceList | |
|
Instances
loadRpcResultInstanceList :: JSValue -> Result RpcResultInstanceList Source #
saveRpcResultInstanceList :: RpcResultInstanceList -> JSValue Source #
NodeInfo
data RpcCallNodeInfo Source #
Returns node information
Instances
loadRpcCallNodeInfo :: JSValue -> Result RpcCallNodeInfo Source #
saveRpcCallNodeInfo :: RpcCallNodeInfo -> JSValue Source #
data StorageInfo Source #
StorageInfo | |
|
Instances
Eq StorageInfo # | |
Defined in Ganeti.Rpc (==) :: StorageInfo -> StorageInfo -> Bool (/=) :: StorageInfo -> StorageInfo -> Bool | |
Show StorageInfo # | |
Defined in Ganeti.Rpc showsPrec :: Int -> StorageInfo -> ShowS show :: StorageInfo -> String showList :: [StorageInfo] -> ShowS | |
JSON StorageInfo # | |
Defined in Ganeti.Rpc readJSON :: JSValue -> Result StorageInfo showJSON :: StorageInfo -> JSValue readJSONs :: JSValue -> Result [StorageInfo] showJSONs :: [StorageInfo] -> JSValue | |
ArrayObject StorageInfo # | |
Defined in Ganeti.Rpc toJSArray :: StorageInfo -> [JSValue] Source # fromJSArray :: [JSValue] -> Result StorageInfo Source # | |
DictObject StorageInfo # | |
Defined in Ganeti.Rpc toDict :: StorageInfo -> [(String, JSValue)] Source # fromDictWKeys :: [(String, JSValue)] -> WriterT UsedKeys Result StorageInfo Source # fromDict :: [(String, JSValue)] -> Result StorageInfo Source # |
loadStorageInfo :: JSValue -> Result StorageInfo Source #
saveStorageInfo :: StorageInfo -> JSValue Source #
Common fields (as described in hv_base.py) are mandatory, other fields are optional.
HvInfo | |
|
Instances
Eq HvInfo # | |
Show HvInfo # | |
JSON HvInfo # | |
ArrayObject HvInfo # | |
Defined in Ganeti.Rpc | |
DictObject HvInfo # | |
loadHvInfo :: JSValue -> Result HvInfo Source #
saveHvInfo :: HvInfo -> JSValue Source #
data RpcResultNodeInfo Source #
RpcResultNodeInfo | |
|
Instances
loadRpcResultNodeInfo :: JSValue -> Result RpcResultNodeInfo Source #
saveRpcResultNodeInfo :: RpcResultNodeInfo -> JSValue Source #
Version
data RpcCallVersion Source #
Query node version.
Instances
loadRpcCallVersion :: JSValue -> Result RpcCallVersion Source #
saveRpcCallVersion :: RpcCallVersion -> JSValue Source #
data RpcResultVersion Source #
Query node reply.
Instances
loadRpcResultVersion :: JSValue -> Result RpcResultVersion Source #
saveRpcResultVersion :: RpcResultVersion -> JSValue Source #
StorageList
data RpcCallStorageList Source #
RpcCallStorageList | |
|
Instances
loadRpcCallStorageList :: JSValue -> Result RpcCallStorageList Source #
saveRpcCallStorageList :: RpcCallStorageList -> JSValue Source #
data RpcResultStorageList Source #
RpcResultStorageList | |
|
Instances
loadRpcResultStorageList :: JSValue -> Result RpcResultStorageList Source #
saveRpcResultStorageList :: RpcResultStorageList -> JSValue Source #
TestDelay
data RpcCallTestDelay Source #
Call definition for test delay.
RpcCallTestDelay | |
|
Instances
loadRpcCallTestDelay :: JSValue -> Result RpcCallTestDelay Source #
saveRpcCallTestDelay :: RpcCallTestDelay -> JSValue Source #
data RpcResultTestDelay Source #
Result definition for test delay.
Instances
Show RpcResultTestDelay # | |
Defined in Ganeti.Rpc showsPrec :: Int -> RpcResultTestDelay -> ShowS show :: RpcResultTestDelay -> String showList :: [RpcResultTestDelay] -> ShowS | |
JSON RpcResultTestDelay # | Custom JSON instance for null result. |
Defined in Ganeti.Rpc readJSON :: JSValue -> Result RpcResultTestDelay showJSON :: RpcResultTestDelay -> JSValue readJSONs :: JSValue -> Result [RpcResultTestDelay] showJSONs :: [RpcResultTestDelay] -> JSValue | |
Rpc RpcCallTestDelay RpcResultTestDelay # | |
Defined in Ganeti.Rpc rpcResultFill :: RpcCallTestDelay -> JSValue -> ERpcError RpcResultTestDelay Source # |
ExportList
data RpcCallExportList Source #
Call definition for export list.
Instances
loadRpcCallExportList :: JSValue -> Result RpcCallExportList Source #
saveRpcCallExportList :: RpcCallExportList -> JSValue Source #
data RpcResultExportList Source #
Result definition for export list.
RpcResultExportList | |
|
Instances
loadRpcResultExportList :: JSValue -> Result RpcResultExportList Source #
saveRpcResultExportList :: RpcResultExportList -> JSValue Source #
Job Queue Replication
data RpcCallJobqueueUpdate Source #
Update a job queue file
RpcCallJobqueueUpdate | |
|
Instances
loadRpcCallJobqueueUpdate :: JSValue -> Result RpcCallJobqueueUpdate Source #
saveRpcCallJobqueueUpdate :: RpcCallJobqueueUpdate -> JSValue Source #
loadRpcResultJobQueueUpdate :: JSValue -> Result RpcResultJobQueueUpdate Source #
saveRpcResultJobQueueUpdate :: RpcResultJobQueueUpdate -> JSValue Source #
data RpcCallJobqueueRename Source #
Rename a file in the job queue
RpcCallJobqueueRename | |
|
Instances
loadRpcCallJobqueueRename :: JSValue -> Result RpcCallJobqueueRename Source #
saveRpcCallJobqueueRename :: RpcCallJobqueueRename -> JSValue Source #
loadRpcResultJobqueueRename :: JSValue -> Result RpcResultJobqueueRename Source #
saveRpcResultJobqueueRename :: RpcResultJobqueueRename -> JSValue Source #
Watcher Status Update
data RpcCallSetWatcherPause Source #
Set the watcher status
RpcCallSetWatcherPause | |
|
Instances
loadRpcCallSetWatcherPause :: JSValue -> Result RpcCallSetWatcherPause Source #
saveRpcCallSetWatcherPause :: RpcCallSetWatcherPause -> JSValue Source #
loadRpcResultSetWatcherPause :: JSValue -> Result RpcResultSetWatcherPause Source #
saveRpcResultSetWatcherPause :: RpcResultSetWatcherPause -> JSValue Source #
Queue drain status
data RpcCallSetDrainFlag Source #
Set the queu drain flag
Instances
loadRpcCallSetDrainFlag :: JSValue -> Result RpcCallSetDrainFlag Source #
saveRpcCallSetDrainFlag :: RpcCallSetDrainFlag -> JSValue Source #
loadRpcResultSetDrainFlag :: JSValue -> Result RpcResultSetDrainFlag Source #
saveRpcResultSetDrainFlag :: RpcResultSetDrainFlag -> JSValue Source #
Configuration files upload to nodes
data RpcCallUploadFile Source #
Upload a configuration file to nodes
RpcCallUploadFile | |
|
Instances
loadRpcCallUploadFile :: JSValue -> Result RpcCallUploadFile Source #
saveRpcCallUploadFile :: RpcCallUploadFile -> JSValue Source #
loadRpcResultUploadFile :: JSValue -> Result RpcResultUploadFile Source #
saveRpcResultUploadFile :: RpcResultUploadFile -> JSValue Source #
prepareRpcCallUploadFile :: RuntimeEnts -> FilePath -> ResultG RpcCallUploadFile Source #
Reads a file and constructs the corresponding RpcCallUploadFile
value.
data RpcCallWriteSsconfFiles Source #
Upload ssconf files to nodes
Instances
loadRpcCallWriteSsconfFiles :: JSValue -> Result RpcCallWriteSsconfFiles Source #
saveRpcCallWriteSsconfFiles :: RpcCallWriteSsconfFiles -> JSValue Source #
loadRpcResultWriteSsconfFiles :: JSValue -> Result RpcResultWriteSsconfFiles Source #
saveRpcResultWriteSsconfFiles :: RpcResultWriteSsconfFiles -> JSValue Source #
data RpcCallNodeActivateMasterIp Source #
Activate the master IP address
Instances
loadRpcCallNodeActivateMasterIp :: JSValue -> Result RpcCallNodeActivateMasterIp Source #
saveRpcCallNodeActivateMasterIp :: RpcCallNodeActivateMasterIp -> JSValue Source #
data RpcResultNodeActivateMasterIp Source #
Instances
loadRpcResultNodeActivateMasterIp :: JSValue -> Result RpcResultNodeActivateMasterIp Source #
data RpcCallMasterNodeName Source #
Ask who the node believes is the master.
Instances
loadRpcCallMasterNodeName :: JSValue -> Result RpcCallMasterNodeName Source #
saveRpcCallMasterNodeName :: RpcCallMasterNodeName -> JSValue Source #
data RpcResultMasterNodeName Source #
Instances
loadRpcResultMasterNodeName :: JSValue -> Result RpcResultMasterNodeName Source #
saveRpcResultMasterNodeName :: RpcResultMasterNodeName -> JSValue Source #