ganeti-htoolsSource codeContentsIndex
Ganeti.Config
Contents
Query functions
Description
Implementation of the Ganeti configuration database.
Synopsis
type LinkIpMap = Map String (Map String String)
readConfig :: FilePath -> IO String
parseConfig :: String -> Result ConfigData
loadConfig :: FilePath -> IO (Result ConfigData)
computeDiskNodes :: Disk -> Set String
instDiskNodes :: Instance -> Set String
instNodes :: Instance -> Set String
instSecondaryNodes :: Instance -> Set String
getNodeInstances :: ConfigData -> String -> ([Instance], [Instance])
getDefaultNicLink :: ConfigData -> String
getInstancesIpByLink :: LinkIpMap -> String -> [String]
getItem :: String -> String -> Map String a -> Result a
getNode :: ConfigData -> String -> Result Node
getInstance :: ConfigData -> String -> Result Instance
getInstPrimaryNode :: ConfigData -> String -> Result Node
getDrbdMinorsForNode :: String -> Disk -> [(Int, String)]
rolePrimary :: String
roleSecondary :: String
getInstMinorsForNode :: String -> Instance -> [(String, Int, String, String, String, String)]
buildLinkIpInstnameMap :: ConfigData -> LinkIpMap
Documentation
type LinkIpMap = Map String (Map String String)Source
Type alias for the link and ip map.
readConfig :: FilePath -> IO StringSource
Reads the config file.
parseConfig :: String -> Result ConfigDataSource
Parses the configuration file.
loadConfig :: FilePath -> IO (Result ConfigData)Source
Wrapper over readConfig and parseConfig.
Query functions
computeDiskNodes :: Disk -> Set StringSource
Computes the nodes covered by a disk.
instDiskNodes :: Instance -> Set StringSource
Computes all disk-related nodes of an instance. For non-DRBD, this will be empty, for DRBD it will contain both the primary and the secondaries.
instNodes :: Instance -> Set StringSource
Computes all nodes of an instance.
instSecondaryNodes :: Instance -> Set StringSource
Computes the secondary nodes of an instance. Since this is valid only for DRBD, we call directly instDiskNodes, skipping over the extra primary insert.
getNodeInstances :: ConfigData -> String -> ([Instance], [Instance])Source
Get instances of a given node.
getDefaultNicLink :: ConfigData -> StringSource
Returns the default cluster link.
getInstancesIpByLink :: LinkIpMap -> String -> [String]Source
Returns instances of a given link.
getItem :: String -> String -> Map String a -> Result aSource
Generic lookup function that converts from a possible abbreviated name to a full name.
getNode :: ConfigData -> String -> Result NodeSource
Looks up a node.
getInstance :: ConfigData -> String -> Result InstanceSource
Looks up an instance.
getInstPrimaryNode :: ConfigData -> String -> Result NodeSource
Looks up an instance's primary node.
getDrbdMinorsForNode :: String -> Disk -> [(Int, String)]Source
Filters DRBD minors for a given node.
rolePrimary :: StringSource
String for primary role.
roleSecondary :: StringSource
String for secondary role.
getInstMinorsForNode :: String -> Instance -> [(String, Int, String, String, String, String)]Source
Gets the list of DRBD minors for an instance that are related to a given node.
buildLinkIpInstnameMap :: ConfigData -> LinkIpMapSource

Builds link -> ip -> instname map.

TODO: improve this by splitting it into multiple independent functions:

  • abstract the "fetch instance with filled params" functionality
  • abstsract the [instance] -> [(nic, instance_name)] part
  • etc.
Produced by Haddock version 2.6.0