Safe Haskell | Safe-Infered |
---|
Implementation of the Ganeti Query2 instance queries.
- type LiveInfo = (Maybe (InstanceInfo, Bool), Maybe InstanceConsoleInfo)
- type Runtime = Either RpcError LiveInfo
- fieldsMap :: FieldMap Instance Runtime
- instanceAliases :: [(FieldName, FieldName)]
- aliasedFields :: FieldList Instance Runtime
- instanceFields :: FieldList Instance Runtime
- nicDescSuffix :: String
- nicAggDescPrefix :: String
- getNetworkName :: ConfigData -> String -> NonEmptyString
- getNicBridge :: FilledNicParams -> Maybe String
- getNicVlan :: FilledNicParams -> Maybe String
- fillNicParamsFromConfig :: ConfigData -> PartialNicParams -> FilledNicParams
- getDefaultNicParams :: ConfigData -> FilledNicParams
- getDiskSizeRequirements :: ConfigData -> Instance -> ResultEntry
- getDiskSizes :: ConfigData -> Instance -> ResultEntry
- getDiskSpindles :: ConfigData -> Instance -> ResultEntry
- getDiskNames :: ConfigData -> Instance -> ResultEntry
- getDiskUuids :: ConfigData -> Instance -> ResultEntry
- getIndexedOptionalConfField :: JSON b => (ConfigData -> Instance -> ErrorResult [a]) -> (a -> Maybe b) -> Int -> FieldGetter Instance Runtime
- getIndexedConfField :: JSON b => (ConfigData -> Instance -> ErrorResult [a]) -> (a -> b) -> Int -> FieldGetter Instance Runtime
- getIndexedNicNetworkNameField :: Int -> FieldGetter Instance Runtime
- getIndexedNicField :: JSON a => (FilledNicParams -> a) -> Int -> FieldGetter Instance Runtime
- getOptionalIndexedNicField :: JSON a => (FilledNicParams -> Maybe a) -> Int -> FieldGetter Instance Runtime
- getIndexedFieldWithDefault :: JSON c => (Instance -> [a]) -> (ConfigData -> Instance -> b) -> (b -> a -> b) -> (b -> Maybe c) -> Int -> FieldGetter Instance Runtime
- getIndexedOptionalField :: JSON b => (Instance -> [a]) -> (a -> Maybe b) -> Int -> FieldGetter Instance Runtime
- getIndexedField :: JSON b => (Instance -> [a]) -> (a -> b) -> Int -> FieldGetter Instance Runtime
- maybeAt :: Int -> [a] -> Maybe a
- fieldDefinitionCompleter :: PrintfArg t1 => PrintfArg t2 => FieldName -> FieldTitle -> FieldType -> FieldDoc -> t1 -> t2 -> FieldDefinition
- fillIncompleteFields :: (t1 -> t2 -> FieldDefinition, t1 -> FieldGetter a b, QffMode) -> t1 -> t2 -> FieldData a b
- instantiateIndexedFields :: (Show t1, Integral t1) => Int -> [(t1 -> String -> FieldDefinition, t1 -> FieldGetter a b, QffMode)] -> FieldList a b
- getPrimaryNode :: ConfigData -> Instance -> ErrorResult Node
- getPrimaryNodeName :: ConfigData -> Instance -> ResultEntry
- getPrimaryNodeGroup :: ConfigData -> Instance -> ErrorResult NodeGroup
- getPrimaryNodeGroupName :: ConfigData -> Instance -> ResultEntry
- getPrimaryNodeGroupUuid :: ConfigData -> Instance -> ResultEntry
- getSecondaryNodes :: ConfigData -> Instance -> ErrorResult [Node]
- getSecondaryNodeAttribute :: JSON a => (Node -> a) -> ConfigData -> Instance -> ResultEntry
- getSecondaryNodeGroups :: ConfigData -> Instance -> ErrorResult [NodeGroup]
- getSecondaryNodeGroupAttribute :: JSON a => (NodeGroup -> a) -> ConfigData -> Instance -> ResultEntry
- beParamGetter :: String -> ConfigData -> Instance -> ResultEntry
- hvParamGetter :: String -> ConfigData -> Instance -> ResultEntry
- instanceLiveFieldsDefs :: [(FieldName, FieldTitle, FieldType, String, FieldDoc)]
- instanceLiveFieldExtract :: FieldName -> InstanceInfo -> Instance -> JSValue
- instanceLiveRpcCall :: FieldName -> Runtime -> Instance -> ResultEntry
- instanceLiveFieldBuilder :: (FieldName, FieldTitle, FieldType, String, FieldDoc) -> FieldData Instance Runtime
- statusDocText :: String
- isPrimaryOffline :: ConfigData -> Instance -> Bool
- userShutdownEnabled :: ConfigData -> Bool
- liveInstanceStatus :: ConfigData -> (InstanceInfo, Bool) -> Instance -> InstanceStatus
- deadInstanceStatus :: ConfigData -> Instance -> InstanceStatus
- determineInstanceStatus :: ConfigData -> Runtime -> Instance -> InstanceStatus
- statusExtract :: ConfigData -> Runtime -> Instance -> ResultEntry
- operStatusExtract :: Runtime -> Instance -> ResultEntry
- consoleExtract :: Runtime -> Instance -> ResultEntry
- checkForNodeError :: [(String, ERpcError a)] -> String -> Maybe RpcError
- findInfoInNodeResult :: Instance -> ERpcError RpcResultAllInstancesInfo -> Maybe InstanceInfo
- getInstanceInfo :: [(String, ERpcError RpcResultAllInstancesInfo)] -> Instance -> ERpcError (Maybe (InstanceInfo, Bool))
- getConsoleInfo :: [(String, ERpcError RpcResultInstanceConsoleInfo)] -> Instance -> Maybe InstanceConsoleInfo
- extractLiveInfo :: [(Node, ERpcError RpcResultAllInstancesInfo)] -> [(Node, ERpcError RpcResultInstanceConsoleInfo)] -> Instance -> Runtime
- getAllConsoleParams :: ConfigData -> [Instance] -> ErrorResult [InstanceConsoleInfoParams]
- compareParamsByNode :: InstanceConsoleInfoParams -> InstanceConsoleInfoParams -> Bool
- consoleParamsToCalls :: [InstanceConsoleInfoParams] -> [(Node, RpcCallInstanceConsoleInfo)]
- getHypervisorSpecs :: ConfigData -> [Instance] -> [(Hypervisor, HvParams)]
- collectLiveData :: Bool -> ConfigData -> [String] -> [Instance] -> IO [(Instance, Runtime)]
Documentation
type LiveInfo = (Maybe (InstanceInfo, Bool), Maybe InstanceConsoleInfo)Source
type Runtime = Either RpcError LiveInfoSource
Runtime containing the LiveInfo
. See the genericQuery function in
the Query.hs file for an explanation of the terms used.
instanceAliases :: [(FieldName, FieldName)]Source
The instance aliases.
instanceFields :: FieldList Instance RuntimeSource
The instance fields.
Helper functions for node property retrieval
nicDescSuffix :: StringSource
nicAggDescPrefix :: StringSource
getNetworkName :: ConfigData -> String -> NonEmptyStringSource
getNicBridge :: FilledNicParams -> Maybe StringSource
getNicVlan :: FilledNicParams -> Maybe StringSource
getDiskSizes :: ConfigData -> Instance -> ResultEntrySource
getDiskNames :: ConfigData -> Instance -> ResultEntrySource
getDiskUuids :: ConfigData -> Instance -> ResultEntrySource
getIndexedOptionalConfField :: JSON b => (ConfigData -> Instance -> ErrorResult [a]) -> (a -> Maybe b) -> Int -> FieldGetter Instance RuntimeSource
getIndexedConfField :: JSON b => (ConfigData -> Instance -> ErrorResult [a]) -> (a -> b) -> Int -> FieldGetter Instance RuntimeSource
getIndexedNicField :: JSON a => (FilledNicParams -> a) -> Int -> FieldGetter Instance RuntimeSource
getOptionalIndexedNicField :: JSON a => (FilledNicParams -> Maybe a) -> Int -> FieldGetter Instance RuntimeSource
getIndexedFieldWithDefault :: JSON c => (Instance -> [a]) -> (ConfigData -> Instance -> b) -> (b -> a -> b) -> (b -> Maybe c) -> Int -> FieldGetter Instance RuntimeSource
getIndexedOptionalField :: JSON b => (Instance -> [a]) -> (a -> Maybe b) -> Int -> FieldGetter Instance RuntimeSource
getIndexedField :: JSON b => (Instance -> [a]) -> (a -> b) -> Int -> FieldGetter Instance RuntimeSource
fieldDefinitionCompleter :: PrintfArg t1 => PrintfArg t2 => FieldName -> FieldTitle -> FieldType -> FieldDoc -> t1 -> t2 -> FieldDefinitionSource
fillIncompleteFields :: (t1 -> t2 -> FieldDefinition, t1 -> FieldGetter a b, QffMode) -> t1 -> t2 -> FieldData a bSource
instantiateIndexedFields :: (Show t1, Integral t1) => Int -> [(t1 -> String -> FieldDefinition, t1 -> FieldGetter a b, QffMode)] -> FieldList a bSource
Various helper functions for property retrieval
getSecondaryNodes :: ConfigData -> Instance -> ErrorResult [Node]Source
getSecondaryNodeAttribute :: JSON a => (Node -> a) -> ConfigData -> Instance -> ResultEntrySource
getSecondaryNodeGroupAttribute :: JSON a => (NodeGroup -> a) -> ConfigData -> Instance -> ResultEntrySource
beParamGetter :: String -> ConfigData -> Instance -> ResultEntrySource
hvParamGetter :: String -> ConfigData -> Instance -> ResultEntrySource
Live fields functionality
instanceLiveFieldsDefs :: [(FieldName, FieldTitle, FieldType, String, FieldDoc)]Source
instanceLiveFieldExtract :: FieldName -> InstanceInfo -> Instance -> JSValueSource
instanceLiveRpcCall :: FieldName -> Runtime -> Instance -> ResultEntrySource
instanceLiveFieldBuilder :: (FieldName, FieldTitle, FieldType, String, FieldDoc) -> FieldData Instance RuntimeSource
Functionality related to status and operational status extraction
statusDocText :: StringSource
isPrimaryOffline :: ConfigData -> Instance -> BoolSource
userShutdownEnabled :: ConfigData -> BoolSource
liveInstanceStatus :: ConfigData -> (InstanceInfo, Bool) -> Instance -> InstanceStatusSource
statusExtract :: ConfigData -> Runtime -> Instance -> ResultEntrySource
consoleExtract :: Runtime -> Instance -> ResultEntrySource
Helper functions extracting information as necessary for the generic query
checkForNodeError :: [(String, ERpcError a)] -> String -> Maybe RpcErrorSource
getInstanceInfo :: [(String, ERpcError RpcResultAllInstancesInfo)] -> Instance -> ERpcError (Maybe (InstanceInfo, Bool))Source
Retrieves the instance information if it is present anywhere in the all instances RPC result. Notes if it originates from the primary node. An error is delivered if there is no result, and the primary node is down.
getConsoleInfo :: [(String, ERpcError RpcResultInstanceConsoleInfo)] -> Instance -> Maybe InstanceConsoleInfoSource
extractLiveInfo :: [(Node, ERpcError RpcResultAllInstancesInfo)] -> [(Node, ERpcError RpcResultInstanceConsoleInfo)] -> Instance -> RuntimeSource
getHypervisorSpecs :: ConfigData -> [Instance] -> [(Hypervisor, HvParams)]Source
:: Bool | Live queries allowed |
-> ConfigData | The cluster config |
-> [String] | The requested fields |
-> [Instance] | The instance objects |
-> IO [(Instance, Runtime)] |
Collect live data from RPC query if enabled.