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
formatResponse :: Bool -> String -> [String] -> 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.
formatResponseSource
:: BoolWhether the request was successful
-> StringInformation text
-> [String]The list of chosen nodes
-> StringThe JSON-formatted message
Formats the response into a valid IAllocator response message.
Produced by Haddock version 0.8