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 
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 
ChangeJobPriority JobId Int 
SetDrainFlag Bool 
SetWatcherPause (Maybe Double) 

Instances

Eq LuxiOp 
Show LuxiOp 
Arbitrary LuxiOp 

luxiReqFromRaw :: forall m. Monad m => String -> m LuxiReqSource

opToArgs :: LuxiOp -> JSValueSource

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

allLuxiCalls :: [String]Source

List of all defined Luxi calls.

strOfOp :: LuxiOp -> StringSource

The serialisation of LuxiOps into strings in messages.

getLuxiClient :: String -> IO ClientSource

Connects to the master daemon and returns a luxi Client.

getLuxiServer :: Bool -> FilePath -> IO ServerSource

Creates and returns a server endpoint.

buildCallSource

Arguments

:: LuxiOp

The method

-> String

The serialized form

Serialize a request to String.

decodeLuxiCall :: JSValue -> JSValue -> Result LuxiOpSource

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.

validateResult :: String -> ErrorResult JSValueSource

decodeError :: JSValue -> ErrorResult JSValueSource

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

Generic luxi method call.

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

Specialized submitManyJobs call.

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

Custom queryJobs call.