ganeti-htoolsSource codeContentsIndex
Ganeti.HTools.Text
Description

Parsing data from text-files

This module holds the code for loading the cluster state from text files, as produced by gnt-node and gnt-instance list.

Synopsis
serializeGroup :: Group -> String
serializeGroups :: List -> String
serializeNode :: List -> Node -> String
serializeNodes :: List -> List -> String
serializeInstance :: List -> Instance -> String
serializeInstances :: List -> List -> String
serializeCluster :: ClusterData -> String
loadGroup :: Monad m => [String] -> m (String, Group)
loadNode :: Monad m => NameAssoc -> [String] -> m (String, Node)
loadInst :: Monad m => NameAssoc -> [String] -> m (String, Instance)
loadTabular :: (Monad m, Element a) => [String] -> ([String] -> m (String, a)) -> m (NameAssoc, Container a)
readData :: String -> IO String
parseData :: String -> Result ClusterData
loadData :: String -> IO (Result ClusterData)
Documentation
serializeGroup :: Group -> StringSource
Serialize a single group
serializeGroups :: List -> StringSource
Generate group file data from a group list
serializeNode :: List -> Node -> StringSource
Serialize a single node
serializeNodes :: List -> List -> StringSource
Generate node file data from node objects
serializeInstance :: List -> Instance -> StringSource
Serialize a single instance
serializeInstances :: List -> List -> StringSource
Generate instance file data from instance objects
serializeCluster :: ClusterData -> StringSource
Generate complete cluster data from node and instance lists
loadGroup :: Monad m => [String] -> m (String, Group)Source
Load a group from a field list.
loadNode :: Monad m => NameAssoc -> [String] -> m (String, Node)Source
Load a node from a field list.
loadInst :: Monad m => NameAssoc -> [String] -> m (String, Instance)Source
Load an instance from a field list.
loadTabular :: (Monad m, Element a) => [String] -> ([String] -> m (String, a)) -> m (NameAssoc, Container a)Source

Convert newline and delimiter-separated text.

This function converts a text in tabular format as generated by gnt-instance list and gnt-node list to a list of objects using a supplied conversion function.

readDataSource
:: StringPath to the text file
-> IO String
Load the cluser data from disk.
parseDataSource
:: StringText data
-> Result ClusterData
Builds the cluster data from text input.
loadDataSource
:: StringPath to the text file
-> IO (Result ClusterData)
Top level function for data loading
Produced by Haddock version 2.6.0