ganeti

Safe HaskellSafe-Infered

Ganeti.HTools.Backend.Luxi

Contents

Description

Implementation of the LUXI loader.

Synopsis

Utility functions

annotateConvert :: String -> String -> String -> Result a -> Result aSource

genericConvert :: JSON a => String -> String -> String -> (JSValue, JSValue) -> Result aSource

convertArrayMaybe :: JSON a => String -> String -> String -> (JSValue, JSValue) -> Result [Maybe a]Source

Data querying functionality

queryNodes :: Client -> IO (Result JSValue)Source

queryGroups :: Client -> IO (Result JSValue)Source

getInstances :: Bool -> NameAssoc -> JSValue -> Result [(String, Instance)]Source

parseInstance :: Bool -> NameAssoc -> [(JSValue, JSValue)] -> Result (String, Instance)Source

getNodes :: NameAssoc -> JSValue -> Result [(String, Node)]Source

parseNode :: NameAssoc -> [(JSValue, JSValue)] -> Result (String, Node)Source

getClusterData :: JSValue -> Result ([String], IPolicy, String)Source

getGroups :: JSValue -> Result [(String, Group)]Source

parseGroup :: [(JSValue, JSValue)] -> Result (String, Group)Source

Main loader functionality

readData :: String -> IO (Result JSValue, Result JSValue, Result JSValue, Result JSValue)Source

parseDataSource

Arguments

:: Bool

use only state-of-record (SoR) data

-> (Result JSValue, Result JSValue, Result JSValue, Result JSValue) 
-> Result ClusterData 

Converts the output of readData into the internal cluster representation.

loadDataSource

Arguments

:: Bool

use only state-of-record (SoR) data

-> String

Unix socket to use as source

-> IO (Result ClusterData) 

Top level function for data loading.