ganeti
Safe HaskellNone

Ganeti.Luxi

Description

Implementation of the Ganeti LUXI interface.

Synopsis

Documentation

data LuxiOp Source #

Currently supported Luxi operations and JSON serialization.

Constructors

Query ItemType [String] (Filter FilterField) 
QueryFields ItemType [String] 
QueryNodes [String] [String] Bool 
QueryGroups [String] [String] Bool 
QueryNetworks [String] [String] Bool 
QueryInstances [String] [String] Bool 
QueryFilters [String] [String] 
ReplaceFilter (Maybe String) (NonNegative Int) [FilterPredicate] FilterAction ReasonTrail 
DeleteFilter String 
QueryJobs [JobId] [String] 
QueryExports [String] Bool 
QueryConfigValues [String] 
QueryClusterInfo 
QueryTags TagKind String 
SubmitJob [MetaOpCode] 
SubmitJobToDrainedQueue [MetaOpCode] 
SubmitManyJobs [[MetaOpCode]] 
WaitForJobChange JobId [String] JSValue JSValue Int 
PickupJob JobId 
ArchiveJob JobId 
AutoArchiveJobs Int Int 
CancelJob JobId Bool 
ChangeJobPriority JobId Int 
SetDrainFlag Bool 
SetWatcherPause (Maybe ClockTime) 

Instances

Instances details
Eq LuxiOp # 
Instance details

Defined in Ganeti.Luxi

Methods

(==) :: LuxiOp -> LuxiOp -> Bool

(/=) :: LuxiOp -> LuxiOp -> Bool

Show LuxiOp # 
Instance details

Defined in Ganeti.Luxi

Methods

showsPrec :: Int -> LuxiOp -> ShowS

show :: LuxiOp -> String

showList :: [LuxiOp] -> ShowS

DictObject LuxiOp # 
Instance details

Defined in Ganeti.Luxi

Methods

toDict :: LuxiOp -> [(String, JSValue)] Source #

fromDictWKeys :: [(String, JSValue)] -> WriterT UsedKeys Result LuxiOp Source #

fromDict :: [(String, JSValue)] -> Result LuxiOp Source #

Arbitrary LuxiOp 
Instance details

Defined in Test.Ganeti.Luxi

Methods

arbitrary :: Gen LuxiOp

shrink :: LuxiOp -> [LuxiOp]

data LuxiReq Source #

Instances

Instances details
Bounded LuxiReq # 
Instance details

Defined in Ganeti.Luxi

Enum LuxiReq # 
Instance details

Defined in Ganeti.Luxi

Eq LuxiReq # 
Instance details

Defined in Ganeti.Luxi

Methods

(==) :: LuxiReq -> LuxiReq -> Bool

(/=) :: LuxiReq -> LuxiReq -> Bool

Ord LuxiReq # 
Instance details

Defined in Ganeti.Luxi

Methods

compare :: LuxiReq -> LuxiReq -> Ordering

(<) :: LuxiReq -> LuxiReq -> Bool

(<=) :: LuxiReq -> LuxiReq -> Bool

(>) :: LuxiReq -> LuxiReq -> Bool

(>=) :: LuxiReq -> LuxiReq -> Bool

max :: LuxiReq -> LuxiReq -> LuxiReq

min :: LuxiReq -> LuxiReq -> LuxiReq

Show LuxiReq # 
Instance details

Defined in Ganeti.Luxi

Methods

showsPrec :: Int -> LuxiReq -> ShowS

show :: LuxiReq -> String

showList :: [LuxiReq] -> ShowS

JSON LuxiReq # 
Instance details

Defined in Ganeti.Luxi

Methods

readJSON :: JSValue -> Result LuxiReq

showJSON :: LuxiReq -> JSValue

readJSONs :: JSValue -> Result [LuxiReq]

showJSONs :: [LuxiReq] -> JSValue

Arbitrary LuxiReq 
Instance details

Defined in Test.Ganeti.Luxi

Methods

arbitrary :: Gen LuxiReq

shrink :: LuxiReq -> [LuxiReq]

luxiReqFromRaw :: forall m. (Monad m, MonadFail m) => String -> m LuxiReq Source #

opToArgs :: LuxiOp -> JSValue Source #

allLuxiCalls :: [String] Source #

List of all defined Luxi calls.

strOfOp :: LuxiOp -> String Source #

The serialisation of LuxiOps into strings in messages.

getLuxiClient :: String -> IO Client Source #

Connects to the master daemon and returns a luxi Client.

getLuxiServer :: Bool -> FilePath -> IO Server Source #

Creates and returns a server endpoint.

decodeLuxiCall :: JSValue -> JSValue -> Result LuxiOp Source #

Converts Luxi call arguments into a LuxiOp data structure. This is used for building a Luxi Handler.

This is currently hand-coded until we make it more uniform so that it can be generated using TH.

callMethod :: LuxiOp -> Client -> IO (ErrorResult JSValue) Source #

Generic luxi method call

parseSubmitJobResult :: JSValue -> ErrorResult JobId Source #

Parse job submission result.

submitManyJobs :: Client -> [[MetaOpCode]] -> IO (ErrorResult [JobId]) Source #

Specialized submitManyJobs call.

queryJobsStatus :: Client -> [JobId] -> IO (ErrorResult [JobStatus]) Source #

Custom queryJobs call.