Safe Haskell | None |
---|
Implementation of the Ganeti Query2 node queries.
Synopsis
- type Runtime = Either RpcError RpcResultNodeInfo
- nodeLiveFieldsDefs :: [(FieldName, FieldTitle, FieldType, String, FieldDoc)]
- getAttrFromStorageInfo :: JSON a => (StorageInfo -> Maybe a) -> Maybe StorageInfo -> JSValue
- isStorageInfoOfType :: StorageType -> StorageInfo -> Bool
- getStorageInfoForDefault :: [StorageInfo] -> Maybe StorageInfo
- getStorageInfoForType :: [StorageInfo] -> StorageType -> Maybe StorageInfo
- nodeLiveFieldExtract :: FieldName -> RpcResultNodeInfo -> JSValue
- nodeLiveRpcCall :: FieldName -> Runtime -> Node -> ResultEntry
- nodeLiveFieldBuilder :: (FieldName, FieldTitle, FieldType, String, FieldDoc) -> FieldData Node Runtime
- nodeRoleDoc :: String
- getNodePower :: ConfigData -> Node -> ResultEntry
- nodeFields :: FieldList Node Runtime
- getNumInstances :: (([Instance], [Instance]) -> [Instance]) -> ConfigData -> Node -> Int
- fieldsMap :: FieldMap Node Runtime
- rpcResultNodeBroken :: Node -> (Node, Runtime)
- storageFields :: [String]
- hypervisorFields :: [String]
- queryDomainRequired :: [String] -> [String] -> Bool
- collectLiveData :: Bool -> ConfigData -> [String] -> [Node] -> IO [(Node, Runtime)]
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.
getNumInstances :: (([Instance], [Instance]) -> [Instance]) -> ConfigData -> Node -> Int Source #
Helper function to retrieve the number of (primary or secondary) instances
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.