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
serializeNode :: Node -> String
serializeNodes :: List -> String
serializeInstance :: List -> Instance -> String
serializeInstances :: List -> List -> String
serializeCluster :: List -> List -> String
loadNode :: Monad m => [String] -> m (String, Node)
loadInst :: Monad m => [(String, Ndx)] -> [String] -> m (String, Instance)
loadTabular :: (Monad m, Element a) => [String] -> ([String] -> m (String, a)) -> m ([(String, Int)], [(Int, a)])
loadData :: String -> IO (Result (AssocList, AssocList, [String]))
Documentation
serializeNode :: Node -> StringSource
Serialize a single node
serializeNodes :: 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 :: List -> List -> StringSource
Generate complete cluster data from node and instance lists
loadNode :: Monad m => [String] -> m (String, Node)Source
Load a node from a field list.
loadInst :: Monad m => [(String, Ndx)] -> [String] -> m (String, Instance)Source
Load an instance from a field list.
loadTabular :: (Monad m, Element a) => [String] -> ([String] -> m (String, a)) -> m ([(String, Int)], [(Int, 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.

loadDataSource
:: StringPath to the text file
-> IO (Result (AssocList, AssocList, [String]))
Builds the cluster data from text input.
Produced by Haddock version 2.6.0