ganeti-htoolsSource codeContentsIndex
Ganeti.HTools.IAlloc
Description
Implementation of the iallocator interface.
Synopsis
parseBaseInstance :: String -> [(String, JSValue)] -> Result (String, Instance)
parseInstance :: NameAssoc -> String -> [(String, JSValue)] -> Result (String, Instance)
parseNode :: String -> [(String, JSValue)] -> Result (String, Node)
parseData :: String -> Result Request
formatRVal :: RqType -> [AllocElement] -> JSValue
formatResponse :: Bool -> String -> RqType -> [AllocElement] -> String
Documentation
parseBaseInstance :: String -> [(String, JSValue)] -> Result (String, Instance)Source

Parse the basic specifications of an instance.

Instances in the cluster instance list and the instance in an Allocate request share some common properties, which are read by this function.

parseInstanceSource
:: NameAssocThe node name-to-index association list
-> StringThe name of the instance
-> [(String, JSValue)]The JSON object
-> Result (String, Instance)
Parses an instance as found in the cluster instance listg.
parseNodeSource
:: StringThe node's name
-> [(String, JSValue)]The JSON object
-> Result (String, Node)
Parses a node as found in the cluster node list.
parseDataSource
:: StringThe JSON message as received from Ganeti
-> Result RequestA (possible valid) request
Top-level parser.
formatRVal :: RqType -> [AllocElement] -> JSValueSource
Format the result
formatResponseSource
:: BoolWhether the request was successful
-> StringInformation text
-> RqTypeRequest type
-> [AllocElement]The resulting allocations
-> StringThe JSON-formatted message
Formats the response into a valid IAllocator response message.
Produced by Haddock version 2.6.0