ganeti
Safe HaskellNone

Ganeti.Query.Node

Description

Implementation of the Ganeti Query2 node queries.

Synopsis

Documentation

type Runtime = Either RpcError RpcResultNodeInfo Source #

Runtime is the resulting type for NodeInfo call.

nodeLiveFieldsDefs :: [(FieldName, FieldTitle, FieldType, String, FieldDoc)] Source #

List of node live fields.

getAttrFromStorageInfo :: JSON a => (StorageInfo -> Maybe a) -> Maybe StorageInfo -> JSValue Source #

Helper function to extract an attribute from a maybe StorageType

isStorageInfoOfType :: StorageType -> StorageInfo -> Bool Source #

Check whether the given storage info fits to the given storage type

getStorageInfoForDefault :: [StorageInfo] -> Maybe StorageInfo Source #

Get storage info for the default storage unit

getStorageInfoForType :: [StorageInfo] -> StorageType -> Maybe StorageInfo Source #

Gets the storage info for a storage type FIXME: This needs to be extended when storage pools are implemented, because storage types are not necessarily unique then

nodeLiveFieldExtract :: FieldName -> RpcResultNodeInfo -> JSValue Source #

Map each name to a function that extracts that value from the RPC result.

nodeLiveRpcCall :: FieldName -> Runtime -> Node -> ResultEntry Source #

Helper for extracting field from RPC result.

nodeLiveFieldBuilder :: (FieldName, FieldTitle, FieldType, String, FieldDoc) -> FieldData Node Runtime Source #

Builder for node live fields.

nodeRoleDoc :: String Source #

The docstring for the node role. Note that we use reverse in order to keep the same order as Python.

getNodePower :: ConfigData -> Node -> ResultEntry Source #

Get node powered status.

nodeFields :: FieldList Node Runtime Source #

List of all node fields.

getNumInstances :: (([Instance], [Instance]) -> [Instance]) -> ConfigData -> Node -> Int Source #

Helper function to retrieve the number of (primary or secondary) instances

fieldsMap :: FieldMap Node Runtime Source #

The node fields map.

rpcResultNodeBroken :: Node -> (Node, Runtime) Source #

Create an RPC result for a broken node

storageFields :: [String] Source #

Storage-related query fields

hypervisorFields :: [String] Source #

Hypervisor-related query fields

queryDomainRequired :: [String] -> [String] -> Bool Source #

Check if it is required to include domain-specific entities (for example storage units for storage info, hypervisor specs for hypervisor info) in the node_info call

collectLiveData :: Bool -> ConfigData -> [String] -> [Node] -> IO [(Node, Runtime)] Source #

Collect live data from RPC query if enabled.