ganeti-htoolsSource codeContentsIndex
Ganeti.HTools.Rapi
Description
Implementation of the RAPI client interface.
Synopsis
getUrl :: Monad m => String -> IO (m String)
formatHost :: String -> String
getInstances :: NameAssoc -> String -> Result [(String, Instance)]
getNodes :: NameAssoc -> String -> Result [(String, Node)]
getGroups :: String -> Result [(String, Group)]
parseInstance :: NameAssoc -> JSRecord -> Result (String, Instance)
parseNode :: NameAssoc -> JSRecord -> Result (String, Node)
parseGroup :: JSRecord -> Result (String, Group)
readData :: String -> IO (Result String, Result String, Result String, Result String)
parseData :: (Result String, Result String, Result String, Result String) -> Result ClusterData
loadData :: String -> IO (Result ClusterData)
Documentation
getUrl :: Monad m => String -> IO (m String)Source
Read an URL via curl and return the body if successful.
formatHost :: String -> StringSource
Append the default port if not passed in.
getInstances :: NameAssoc -> String -> Result [(String, Instance)]Source
Parse a instance list in JSON format.
getNodes :: NameAssoc -> String -> Result [(String, Node)]Source
Parse a node list in JSON format.
getGroups :: String -> Result [(String, Group)]Source
Parse a group list in JSON format.
parseInstance :: NameAssoc -> JSRecord -> Result (String, Instance)Source
Construct an instance from a JSON object.
parseNode :: NameAssoc -> JSRecord -> Result (String, Node)Source
Construct a node from a JSON object.
parseGroup :: JSRecord -> Result (String, Group)Source
Construct a group from a JSON object.
readDataSource
:: StringCluster or URL to use as source
-> IO (Result String, Result String, Result String, Result String)
Loads the raw cluster data from an URL.
parseData :: (Result String, Result String, Result String, Result String) -> Result ClusterDataSource
Builds the cluster data from the raw Rapi content.
loadDataSource
:: StringCluster or URL to use as source
-> IO (Result ClusterData)
Top level function for data loading.
Produced by Haddock version 2.6.0