ganeti-htoolsSource codeContentsIndex
Ganeti.HTools.CLI
Description

Implementation of command-line functions.

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

Synopsis
defaultLuxiSocket :: FilePath
data Options = Options {
optDataFile :: Maybe FilePath
optDiskMoves :: Bool
optDynuFile :: Maybe FilePath
optEvacMode :: Bool
optExInst :: [String]
optExTags :: Maybe [String]
optExecJobs :: Bool
optGroup :: Maybe GroupID
optINodes :: Int
optISpec :: RSpec
optLuxi :: Maybe FilePath
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
optVerbose :: Int
}
defaultOptions :: Options
type OptType = OptDescr (Options -> Result Options)
oDataFile :: OptType
oDiskMoves :: OptType
oDynuFile :: OptType
oEvacMode :: OptType
oExInst :: OptType
oExTags :: OptType
oExecJobs :: OptType
oGroup :: OptType
oIDisk :: OptType
oIMem :: OptType
oINodes :: OptType
oIVcpus :: OptType
oLuxiSocket :: 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
oVerbose :: OptType
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 ()
Documentation
defaultLuxiSocket :: FilePathSource
The default value for the luxi socket
data Options Source
Command line options structure.
Constructors
Options
optDataFile :: Maybe FilePathPath to the cluster data file
optDiskMoves :: BoolAllow disk moves
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
optINodes :: IntNodes required for an instance
optISpec :: RSpecRequested instance specs
optLuxi :: Maybe FilePathCollect data from Luxi
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
optVerbose :: IntVerbosity level
defaultOptions :: OptionsSource
Default values for the command line options.
type OptType = OptDescr (Options -> Result Options)Source
Abrreviation for the option type
oDataFile :: OptTypeSource
oDiskMoves :: OptTypeSource
oDynuFile :: OptTypeSource
oEvacMode :: OptTypeSource
oExInst :: OptTypeSource
oExTags :: OptTypeSource
oExecJobs :: OptTypeSource
oGroup :: OptTypeSource
oIDisk :: OptTypeSource
oIMem :: OptTypeSource
oINodes :: OptTypeSource
oIVcpus :: OptTypeSource
oLuxiSocket :: 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
oVerbose :: OptTypeSource
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.
Produced by Haddock version 2.6.0