ganeti-htoolsSource codeContentsIndex
Ganeti.Luxi
Contents
Utility functions
Generic protocol functionality
Description
Implementation of the Ganeti LUXI interface.
Synopsis
withTimeout :: Int -> String -> IO a -> IO a
data LuxiOp
= QueryInstances [String] [String] Bool
| QueryNodes [String] [String] Bool
| QueryGroups [String] [String] Bool
| QueryJobs [Int] [String]
| QueryExports [String] Bool
| QueryConfigValues [String]
| QueryClusterInfo
| QueryTags String String
| SubmitJob [OpCode]
| SubmitManyJobs [[OpCode]]
| WaitForJobChange Int [String] JSValue JSValue Int
| ArchiveJob Int
| AutoArchiveJobs Int Int
| CancelJob Int
| SetDrainFlag Bool
| SetWatcherPause Double
strOfOp :: LuxiOp -> String
eOM :: Char
data MsgKeys
= Method
| Args
| Success
| Result
strOfKey :: MsgKeys -> String
data Client = Client {
socket :: Socket
rbuf :: IORef String
}
getClient :: String -> IO Client
closeClient :: Client -> IO ()
sendMsg :: Client -> String -> IO ()
recvMsg :: Client -> IO String
opToArgs :: LuxiOp -> JSValue
buildCall :: LuxiOp -> String
validateResult :: String -> Result JSValue
callMethod :: LuxiOp -> Client -> IO (Result JSValue)
submitManyJobs :: Client -> [[OpCode]] -> IO (Result [String])
queryJobsStatus :: Client -> [String] -> IO (Result [JobStatus])
Utility functions
withTimeout :: Int -> String -> IO a -> IO aSource
Wrapper over System.Timeout.timeout that fails in the IO monad.
Generic protocol functionality
data LuxiOp Source
Currently supported Luxi operations.
Constructors
QueryInstances [String] [String] Bool
QueryNodes [String] [String] Bool
QueryGroups [String] [String] Bool
QueryJobs [Int] [String]
QueryExports [String] Bool
QueryConfigValues [String]
QueryClusterInfo
QueryTags String String
SubmitJob [OpCode]
SubmitManyJobs [[OpCode]]
WaitForJobChange Int [String] JSValue JSValue Int
ArchiveJob Int
AutoArchiveJobs Int Int
CancelJob Int
SetDrainFlag Bool
SetWatcherPause Double
strOfOp :: LuxiOp -> StringSource
The serialisation of LuxiOps into strings in messages.
eOM :: CharSource
The end-of-message separator.
data MsgKeys Source
Valid keys in the requests and responses.
Constructors
Method
Args
Success
Result
strOfKey :: MsgKeys -> StringSource
The serialisation of MsgKeys into strings in messages.
data Client Source
Luxi client encapsulation.
Constructors
Client
socket :: SocketThe socket of the client
rbuf :: IORef StringAlready received buffer
getClient :: String -> IO ClientSource
Connects to the master daemon and returns a luxi Client.
closeClient :: Client -> IO ()Source
Closes the client socket.
sendMsg :: Client -> String -> IO ()Source
Sends a message over a luxi transport.
recvMsg :: Client -> IO StringSource
Waits for a message over a luxi transport.
opToArgs :: LuxiOp -> JSValueSource
Compute the serialized form of a Luxi operation.
buildCallSource
:: LuxiOpThe method
-> StringThe serialized form
Serialize a request to String.
validateResult :: String -> Result JSValueSource
Check that luxi responses contain the required keys and that the call was successful.
callMethod :: LuxiOp -> Client -> IO (Result JSValue)Source
Generic luxi method call.
submitManyJobs :: Client -> [[OpCode]] -> IO (Result [String])Source
Specialized submitManyJobs call.
queryJobsStatus :: Client -> [String] -> IO (Result [JobStatus])Source
Custom queryJobs call.
Produced by Haddock version 2.6.0