ganeti-3.1: Cluster-based virtualization management software
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ganeti.HTools.Backend.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 command.

Synopsis

Documentation

loadData #

Arguments

:: String

Path to the text file

-> IO (Result ClusterData) 

Top level function for data loading.

parseData #

Arguments

:: String

Text data

-> Result ClusterData 

Builds the cluster data from text input.

loadInst #

Arguments

:: NameAssoc

Association list with the current nodes

-> [String]

Input data as a list of fields

-> Result (String, Instance)

A tuple of instance name and the instance object

Load an instance from a field list.

loadNode #

Arguments

:: MonadFail m 
=> NameAssoc

Association list with current groups

-> [String]

Input data as a list of fields

-> m (String, Node)

The result, a tuple o node name and node object

Load a node from a field list.

loadISpec :: String -> [String] -> Result ISpec #

Loads a spec from a field list.

loadMultipleMinMaxISpecs :: String -> [String] -> Result [MinMaxISpecs] #

Load a list of min/max ispecs pairs

loadIPolicy :: [String] -> Result (String, IPolicy) #

Loads an ipolicy from a field list.

serializeInstance #

Arguments

:: List

The node list (needed for node names)

-> Instance

The instance to be serialised

-> String 

Serialize a single instance.

serializeInstances :: List -> List -> String #

Generate instance file data from instance objects.

serializeNode #

Arguments

:: List

The list of groups (needed for group uuid)

-> Node

The node to be serialised

-> String 

Serialize a single node.

serializeNodes :: List -> List -> String #

Generate node file data from node objects.

serializeGroup :: Group -> String #

Serialize a single group.

serializeISpec :: ISpec -> String #

Generate a spec data from a given ISpec object.

serializeMultipleMinMaxISpecs :: [MinMaxISpecs] -> String #

Generate min/max instance specs data.

serializeIPolicy :: String -> IPolicy -> String #

Generate policy data from a given policy object.

serializeCluster :: ClusterData -> String #

Generate complete cluster data from node and instance lists.