Safe Haskell | Safe-Infered |
---|
Implementation of command-line functions.
This module holds the common command-line related functions for the binaries, separated into this module since Ganeti.Utils is used in many other places and this is more IO oriented.
- data Options = Options {
- optDataFile :: Maybe FilePath
- optDiskMoves :: Bool
- optInstMoves :: Bool
- optDiskTemplate :: Maybe DiskTemplate
- optSpindleUse :: Maybe Int
- optDynuFile :: Maybe FilePath
- optIgnoreDynu :: Bool
- optIndependentGroups :: Bool
- optAcceptExisting :: Bool
- optMonD :: Bool
- optMonDFile :: Maybe FilePath
- optEvacMode :: Bool
- optRestrictedMigrate :: Bool
- optExInst :: [String]
- optExTags :: Maybe [String]
- optExecJobs :: Bool
- optForce :: Bool
- optFullEvacuation :: Bool
- optGroup :: Maybe GroupID
- optIAllocSrc :: Maybe FilePath
- optIgnoreNonRedundant :: Bool
- optSelInst :: [String]
- optLuxi :: Maybe FilePath
- optJobDelay :: Double
- optMachineReadable :: Bool
- optMaster :: String
- optMaxLength :: Int
- optMcpu :: Maybe Double
- optMdsk :: Double
- optMinGain :: Score
- optMinGainLim :: Score
- optMinScore :: Score
- optNoHeaders :: Bool
- optNoSimulation :: Bool
- optNodeSim :: [String]
- optNodeTags :: Maybe [String]
- optOffline :: [String]
- optOfflineMaintenance :: Bool
- optOneStepOnly :: Bool
- optOutPath :: FilePath
- optPrintMoves :: Bool
- optSaveCluster :: Maybe FilePath
- optShowCmds :: Maybe FilePath
- optShowHelp :: Bool
- optShowComp :: Bool
- optShowInsts :: Bool
- optShowNodes :: Maybe [String]
- optShowVer :: Bool
- optSkipNonRedundant :: Bool
- optStdSpec :: Maybe RSpec
- optTestCount :: Maybe Int
- optTieredSpec :: Maybe RSpec
- optReplay :: Maybe String
- optVerbose :: Int
- optPriority :: Maybe OpSubmitPriority
- defaultOptions :: Options
- type OptType = GenericOptType Options
- parseISpecString :: String -> String -> Result RSpec
- optComplDiskTemplate :: OptCompletion
- oDataFile :: OptType
- oDiskMoves :: OptType
- oMonD :: OptType
- oMonDDataFile :: OptType
- oDiskTemplate :: OptType
- oSpindleUse :: OptType
- oSelInst :: OptType
- oInstMoves :: OptType
- oDynuFile :: OptType
- oIgnoreDyn :: OptType
- oIndependentGroups :: OptType
- oAcceptExisting :: OptType
- oEvacMode :: OptType
- oRestrictedMigrate :: OptType
- oExInst :: OptType
- oExTags :: OptType
- oExecJobs :: OptType
- oForce :: OptType
- oFullEvacuation :: OptType
- oGroup :: OptType
- oIAllocSrc :: OptType
- oIgnoreNonRedundant :: OptType
- oJobDelay :: OptType
- genOLuxiSocket :: String -> OptType
- oLuxiSocket :: IO OptType
- oMachineReadable :: OptType
- oMaxCpu :: OptType
- oMaxSolLength :: OptType
- oMinDisk :: OptType
- oMinGain :: OptType
- oMinGainLim :: OptType
- oMinScore :: OptType
- oNoHeaders :: OptType
- oNoSimulation :: OptType
- oNodeSim :: OptType
- oNodeTags :: OptType
- oOfflineMaintenance :: OptType
- oOfflineNode :: OptType
- oOneStepOnly :: OptType
- oOutputDir :: OptType
- oPrintCommands :: OptType
- oPrintInsts :: OptType
- oPrintMoves :: OptType
- oPrintNodes :: OptType
- oQuiet :: OptType
- oRapiMaster :: OptType
- oSaveCluster :: OptType
- oSkipNonRedundant :: OptType
- oStdSpec :: OptType
- oTieredSpec :: OptType
- oVerbose :: OptType
- oPriority :: OptType
- genericOpts :: [GenericOptType Options]
- parseOpts :: [String] -> String -> [OptType] -> [ArgCompletion] -> IO (Options, [String])
- shTemplate :: String
- maybePrintNodes :: Maybe [String] -> String -> ([String] -> String) -> IO ()
- maybePrintInsts :: Bool -> String -> String -> IO ()
- maybeShowWarnings :: [String] -> IO ()
- printKeys :: String -> [(String, String)] -> IO ()
- printFinal :: String -> Bool -> IO ()
- setNodeOffline :: [Ndx] -> Node -> Node
- setNodeStatus :: Options -> List -> IO List
Data types
Command line options structure.
Options | |
|
defaultOptions :: OptionsSource
Default values for the command line options.
type OptType = GenericOptType OptionsSource
Abbreviation for the option type.
Helper functions
parseISpecString :: String -> String -> Result RSpecSource
Command line options
genOLuxiSocket :: String -> OptTypeSource
oLuxiSocket :: IO OptTypeSource
genericOpts :: [GenericOptType Options]Source
Generic options.
Functions
:: [String] | The command line arguments |
-> String | The program name |
-> [OptType] | The supported command line options |
-> [ArgCompletion] | The supported command line arguments |
-> IO (Options, [String]) | The resulting options and leftover arguments |
Wrapper over parseOpts
with our custom options.
shTemplate :: StringSource
A shell script template for autogenerated scripts.
:: Maybe [String] | The field list |
-> String | Informational message |
-> ([String] -> String) | Function to generate the listing |
-> IO () |
Optionally print the node list.
:: Bool | Whether to print the instance list |
-> String | Type of the instance map (e.g. initial) |
-> String | The instance data |
-> IO () |
Optionally print the instance list.
:: [String] | The warning messages |
-> IO () |
Function to display warning messages from parsing the cluster state.
:: String | Prefix to printed variables |
-> [(String, String)] | List of (key, value) pairs to be printed |
-> IO () |
Format a list of key, value as a shell fragment.
:: String | Prefix to printed variable |
-> Bool | Whether output should be machine readable; note: if not, there is nothing to print |
-> IO () |
Prints the final OK
marker in machine readable output.
setNodeOffline :: [Ndx] -> Node -> NodeSource
setNodeStatus :: Options -> List -> IO ListSource
Set node properties based on command line options.