ganeti-htoolsSource codeContentsIndex
Ganeti.HTools.CLI
Contents
Constants
Data types
Command line options
Functions
Description

Implementation of command-line functions.

This module holds the common command-line related functions for the binaries, separated into this module since Ganeti.HTools.Utils is used in many other places and this is more IO oriented.

Synopsis
defaultLuxiSocket :: FilePath
data Options = Options {
optDataFile :: Maybe FilePath
optDiskMoves :: Bool
optInstMoves :: Bool
optDiskTemplate :: DiskTemplate
optDynuFile :: Maybe FilePath
optEvacMode :: Bool
optExInst :: [String]
optExTags :: Maybe [String]
optExecJobs :: Bool
optGroup :: Maybe GroupID
optSelInst :: [String]
optISpec :: RSpec
optLuxi :: Maybe FilePath
optMachineReadable :: Bool
optMaster :: String
optMaxLength :: Int
optMcpu :: Double
optMdsk :: Double
optMinGain :: Score
optMinGainLim :: Score
optMinScore :: Score
optNoHeaders :: Bool
optNodeSim :: [String]
optOffline :: [String]
optOneline :: Bool
optOutPath :: FilePath
optSaveCluster :: Maybe FilePath
optShowCmds :: Maybe FilePath
optShowHelp :: Bool
optShowInsts :: Bool
optShowNodes :: Maybe [String]
optShowVer :: Bool
optTieredSpec :: Maybe RSpec
optReplay :: Maybe String
optVerbose :: Int
}
defaultOptions :: Options
type OptType = OptDescr (Options -> Result Options)
oDataFile :: OptType
oDiskMoves :: OptType
oDiskTemplate :: OptType
oSelInst :: OptType
oInstMoves :: OptType
oDynuFile :: OptType
oEvacMode :: OptType
oExInst :: OptType
oExTags :: OptType
oExecJobs :: OptType
oGroup :: OptType
oIDisk :: OptType
oIMem :: OptType
oIVcpus :: OptType
oLuxiSocket :: OptType
oMachineReadable :: OptType
oMaxCpu :: OptType
oMaxSolLength :: OptType
oMinDisk :: OptType
oMinGain :: OptType
oMinGainLim :: OptType
oMinScore :: OptType
oNoHeaders :: OptType
oNodeSim :: OptType
oOfflineNode :: OptType
oOneline :: OptType
oOutputDir :: OptType
oPrintCommands :: OptType
oPrintInsts :: OptType
oPrintNodes :: OptType
oQuiet :: OptType
oRapiMaster :: OptType
oSaveCluster :: OptType
oShowHelp :: OptType
oShowVer :: OptType
oTieredSpec :: OptType
oReplay :: OptType
oVerbose :: OptType
parseYesNo :: Bool -> Maybe String -> Result Bool
usageHelp :: String -> [OptType] -> String
parseOpts :: [String] -> String -> [OptType] -> IO (Options, [String])
shTemplate :: String
maybePrintNodes :: Maybe [String] -> String -> ([String] -> String) -> IO ()
maybePrintInsts :: Bool -> String -> String -> IO ()
maybeShowWarnings :: [String] -> IO ()
Constants
defaultLuxiSocket :: FilePathSource

The default value for the luxi socket.

This is re-exported from the Ganeti.Constants module.

Data types
data Options Source
Command line options structure.
Constructors
Options
optDataFile :: Maybe FilePathPath to the cluster data file
optDiskMoves :: BoolAllow disk moves
optInstMoves :: BoolAllow instance moves
optDiskTemplate :: DiskTemplateThe requested disk template
optDynuFile :: Maybe FilePathOptional file with dynamic use data
optEvacMode :: BoolEnable evacuation mode
optExInst :: [String]Instances to be excluded
optExTags :: Maybe [String]Tags to use for exclusion
optExecJobs :: BoolExecute the commands via Luxi
optGroup :: Maybe GroupIDThe UUID of the group to process
optSelInst :: [String]Instances to be excluded
optISpec :: RSpecRequested instance specs
optLuxi :: Maybe FilePathCollect data from Luxi
optMachineReadable :: BoolOutput machine-readable format
optMaster :: StringCollect data from RAPI
optMaxLength :: IntStop after this many steps
optMcpu :: DoubleMax cpu ratio for nodes
optMdsk :: DoubleMax disk usage ratio for nodes
optMinGain :: ScoreMin gain we aim for in a step
optMinGainLim :: ScoreLimit below which we apply mingain
optMinScore :: ScoreThe minimum score we aim for
optNoHeaders :: BoolDo not show a header line
optNodeSim :: [String]Cluster simulation mode
optOffline :: [String]Names of offline nodes
optOneline :: BoolSwitch output to a single line
optOutPath :: FilePathPath to the output directory
optSaveCluster :: Maybe FilePathSave cluster state to this file
optShowCmds :: Maybe FilePathWhether to show the command list
optShowHelp :: BoolJust show the help
optShowInsts :: BoolWhether to show the instance map
optShowNodes :: Maybe [String]Whether to show node status
optShowVer :: BoolJust show the program version
optTieredSpec :: Maybe RSpecRequested specs for tiered mode
optReplay :: Maybe StringUnittests: RNG state
optVerbose :: IntVerbosity level
defaultOptions :: OptionsSource
Default values for the command line options.
type OptType = OptDescr (Options -> Result Options)Source
Abrreviation for the option type.
Command line options
oDataFile :: OptTypeSource
oDiskMoves :: OptTypeSource
oDiskTemplate :: OptTypeSource
oSelInst :: OptTypeSource
oInstMoves :: OptTypeSource
oDynuFile :: OptTypeSource
oEvacMode :: OptTypeSource
oExInst :: OptTypeSource
oExTags :: OptTypeSource
oExecJobs :: OptTypeSource
oGroup :: OptTypeSource
oIDisk :: OptTypeSource
oIMem :: OptTypeSource
oIVcpus :: OptTypeSource
oLuxiSocket :: OptTypeSource
oMachineReadable :: OptTypeSource
oMaxCpu :: OptTypeSource
oMaxSolLength :: OptTypeSource
oMinDisk :: OptTypeSource
oMinGain :: OptTypeSource
oMinGainLim :: OptTypeSource
oMinScore :: OptTypeSource
oNoHeaders :: OptTypeSource
oNodeSim :: OptTypeSource
oOfflineNode :: OptTypeSource
oOneline :: OptTypeSource
oOutputDir :: OptTypeSource
oPrintCommands :: OptTypeSource
oPrintInsts :: OptTypeSource
oPrintNodes :: OptTypeSource
oQuiet :: OptTypeSource
oRapiMaster :: OptTypeSource
oSaveCluster :: OptTypeSource
oShowHelp :: OptTypeSource
oShowVer :: OptTypeSource
oTieredSpec :: OptTypeSource
oReplay :: OptTypeSource
oVerbose :: OptTypeSource
Functions
parseYesNoSource
:: BoolDefault whalue (when we get a Nothing)
-> Maybe StringParameter value
-> Result BoolResulting boolean value
Helper for parsing a yes/no command line flag.
usageHelp :: String -> [OptType] -> StringSource
Usage info.
parseOptsSource
:: [String]The command line arguments
-> StringThe program name
-> [OptType]The supported command line options
-> IO (Options, [String])The resulting options and leftover arguments
Command line parser, using the Options structure.
shTemplate :: StringSource
A shell script template for autogenerated scripts.
maybePrintNodesSource
:: Maybe [String]The field list
-> StringInformational message
-> [String] -> StringFunction to generate the listing
-> IO ()
Optionally print the node list.
maybePrintInstsSource
:: BoolWhether to print the instance list
-> StringType of the instance map (e.g. initial)
-> StringThe instance data
-> IO ()
Optionally print the instance list.
maybeShowWarningsSource
:: [String]The warning messages
-> IO ()
Function to display warning messages from parsing the cluster state.
Produced by Haddock version 2.6.0