ganeti

Safe HaskellSafe-Infered

Ganeti.Query.Instance

Contents

Description

Implementation of the Ganeti Query2 instance queries.

Synopsis

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.

fieldsMap :: FieldMap Instance RuntimeSource

The instance fields map.

instanceAliases :: [(FieldName, FieldName)]Source

The instance aliases.

Helper functions for node property retrieval

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

maybeAt :: Int -> [a] -> Maybe aSource

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

Live fields functionality

Functionality related to status and operational status extraction

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.

collectLiveDataSource

Arguments

:: 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.