ganeti

Safe HaskellNone

Ganeti.Rpc

Contents

Description

Implementation of the RPC client.

Synopsis

Base RPC functionality and types

curlOpts :: [CurlOption]Source

data RpcError Source

Data type for RPC error reporting.

Constructors

CurlLayerError String 
JsonDecodeError String 
RpcResultError String 
OfflineNodeError 

Instances

Eq RpcError 
Show RpcError 

explainRpcError :: RpcError -> StringSource

Provide explanation to RPC errors.

data HttpClientRequest Source

Constructors

HttpClientRequest 

Fields

requestUrl :: String
 
requestData :: String
 
requestOpts :: [CurlOption]
 

isIpV6 :: String -> BoolSource

prepareUrl :: RpcCall a => Int -> Node -> a -> StringSource

prepareHttpRequest :: RpcCall a => Int -> [CurlOption] -> Node -> a -> ERpcError HttpClientRequestSource

parseHttpReply :: Rpc a b => a -> ERpcError (CurlCode, String) -> ERpcError bSource

parseHttpResponse :: Rpc a b => a -> String -> ERpcError bSource

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

executeRpcCalls :: Rpc a b => [(Node, a)] -> 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.

sanitizeDictResults :: [(String, Result a)] -> ERpcError [(String, a)]Source

fromJResultToRes :: Result a -> (a -> b) -> ERpcError bSource

fromJSValueToRes :: JSON a => JSValue -> (a -> b) -> ERpcError bSource

newtype Compressed Source

An opaque data type for representing data that should be compressed over the wire.

On Python side it is decompressed by backend._Decompress.

Constructors

Compressed 

Fields

getCompressed :: ByteString
 

Instances

Eq Compressed 
Ord Compressed 
Show Compressed 
Arbitrary Compressed 
JSON Compressed 

RPC calls and results

Instance info

instanceStateFromRaw :: forall m. Monad m => Int -> m InstanceStateSource

AllInstancesInfo

InstanceConsoleInfo

InstanceList

NodeInfo

loadStorageInfo :: JSValue -> Result StorageInfoSource

data HvInfo Source

Common fields (as described in hv_base.py) are mandatory, other fields are optional.

Constructors

HvInfo 

Fields

hvInfoHvVersion :: Maybe [Int]
 
hvInfoMemoryTotal :: Int
 
hvInfoMemoryFree :: Int
 
hvInfoMemoryDom0 :: Int
 
hvInfoMemoryHv :: Maybe Int
 
hvInfoCpuTotal :: Int
 
hvInfoCpuNodes :: Int
 
hvInfoCpuSockets :: Int
 
hvInfoCpuDom0 :: Int
 

Instances

loadHvInfo :: JSValue -> Result HvInfoSource

saveHvInfo :: HvInfo -> JSValueSource

Version

StorageList

TestDelay

data RpcResultTestDelay Source

Result definition for test delay.

Constructors

RpcResultTestDelay 

Instances

Show RpcResultTestDelay 
JSON RpcResultTestDelay

Custom JSON instance for null result.

Rpc RpcCallTestDelay RpcResultTestDelay 

ExportList

Job Queue Replication

Watcher Status Update

Queue drain status

Configuration files upload to nodes

prepareRpcCallUploadFile :: RuntimeEnts -> FilePath -> ResultG RpcCallUploadFileSource

Reads a file and constructs the corresponding RpcCallUploadFile value.