ganeti-htoolsSource codeContentsIndex
Ganeti.HTools.Luxi
Contents
Utility functions
Data querying functionality
Main loader functionality
Description
Implementation of the LUXI loader.
Synopsis
toArray :: Monad m => JSValue -> m [JSValue]
genericConvert :: JSON a => String -> String -> String -> JSValue -> Result a
queryNodesMsg :: LuxiOp
queryInstancesMsg :: LuxiOp
queryClusterInfoMsg :: LuxiOp
queryGroupsMsg :: LuxiOp
queryNodes :: Client -> IO (Result JSValue)
queryInstances :: Client -> IO (Result JSValue)
queryClusterInfo :: Client -> IO (Result JSValue)
queryGroups :: Client -> IO (Result JSValue)
getInstances :: NameAssoc -> JSValue -> Result [(String, Instance)]
parseInstance :: NameAssoc -> JSValue -> Result (String, Instance)
getNodes :: NameAssoc -> JSValue -> Result [(String, Node)]
parseNode :: NameAssoc -> JSValue -> Result (String, Node)
getClusterTags :: JSValue -> Result [String]
getGroups :: JSValue -> Result [(String, Group)]
parseGroup :: JSValue -> Result (String, Group)
readData :: String -> IO (Result JSValue, Result JSValue, Result JSValue, Result JSValue)
parseData :: (Result JSValue, Result JSValue, Result JSValue, Result JSValue) -> Result ClusterData
loadData :: String -> IO (Result ClusterData)
Utility functions
toArray :: Monad m => JSValue -> m [JSValue]Source
Ensure a given JSValue is actually a JSArray.
genericConvertSource
:: JSON a
=> StringThe object name
-> StringThe attribute we're trying to convert
-> StringThe value we try to convert
-> JSValueThe annotated result
-> Result a
Annotate errors when converting values with owner/attribute for better debugging.
Data querying functionality
queryNodesMsg :: LuxiOpSource
The input data for node query.
queryInstancesMsg :: LuxiOpSource
The input data for instance query.
queryClusterInfoMsg :: LuxiOpSource
The input data for cluster query.
queryGroupsMsg :: LuxiOpSource
The input data for node group query.
queryNodes :: Client -> IO (Result JSValue)Source
Wraper over callMethod doing node query.
queryInstances :: Client -> IO (Result JSValue)Source
Wraper over callMethod doing instance query.
queryClusterInfo :: Client -> IO (Result JSValue)Source
Wrapper over callMethod doing cluster information query.
queryGroups :: Client -> IO (Result JSValue)Source
Wrapper over callMethod doing group query.
getInstances :: NameAssoc -> JSValue -> Result [(String, Instance)]Source
Parse a instance list in JSON format.
parseInstance :: NameAssoc -> JSValue -> Result (String, Instance)Source
Construct an instance from a JSON object.
getNodes :: NameAssoc -> JSValue -> Result [(String, Node)]Source
Parse a node list in JSON format.
parseNode :: NameAssoc -> JSValue -> Result (String, Node)Source
Construct a node from a JSON object.
getClusterTags :: JSValue -> Result [String]Source
Parses the cluster tags.
getGroups :: JSValue -> Result [(String, Group)]Source
Parses the cluster groups.
parseGroup :: JSValue -> Result (String, Group)Source
Parses a given group information.
Main loader functionality
readDataSource
:: StringUnix socket to use as source
-> IO (Result JSValue, Result JSValue, Result JSValue, Result JSValue)
Builds the cluster data by querying a given socket name.
parseData :: (Result JSValue, Result JSValue, Result JSValue, Result JSValue) -> Result ClusterDataSource
Converts the output of readData into the internal cluster representation.
loadDataSource
:: StringUnix socket to use as source
-> IO (Result ClusterData)
Top level function for data loading.
Produced by Haddock version 2.6.0