Safe Haskell | Safe-Infered |
---|
Implementation of the Ganeti Query2 common objects.
- vTypeToQFT :: VType -> FieldType
- rsNoData :: ResultEntry
- rsUnavail :: ResultEntry
- rsNormal :: JSON a => a -> ResultEntry
- rsMaybe :: JSON a => Maybe a -> ResultEntry
- rsUnknown :: ResultEntry
- missingRuntime :: FieldGetter a b
- rpcErrorToStatus :: RpcError -> ResultStatus
- timeStampFields :: TimeStampObject a => FieldList a b
- uuidFields :: UuidObject a => String -> FieldList a b
- serialFields :: SerialNoObject a => String -> FieldList a b
- tagsFields :: TagsObject a => FieldList a b
- dictFieldGetter :: DictObject a => String -> Maybe a -> ResultEntry
- buildQFTLookup :: [(String, String)] -> Map String FieldType
- ndParamTypes :: Map String FieldType
- ndParamTitles :: Map String FieldTitle
- ndParamGetter :: NdParamObject a => String -> ConfigData -> a -> ResultEntry
- buildNdParamField :: NdParamObject a => String -> FieldData a b
Generic functions
vTypeToQFT :: VType -> FieldTypeSource
Result helpers
Helper for a result with no data.
rsUnavail :: ResultEntrySource
Helper for result for an entity which supports no such field.
rsNormal :: JSON a => a -> ResultEntrySource
Helper to declare a normal result.
rsMaybe :: JSON a => Maybe a -> ResultEntrySource
rsUnknown :: ResultEntrySource
Helper for unknown field result.
missingRuntime :: FieldGetter a bSource
Helper for a missing runtime parameter.
Error conversion
rpcErrorToStatus :: RpcError -> ResultStatusSource
Convert RpcError to ResultStatus
Common fields
timeStampFields :: TimeStampObject a => FieldList a bSource
The list of timestamp fields.
uuidFields :: UuidObject a => String -> FieldList a bSource
The list of UUID fields.
serialFields :: SerialNoObject a => String -> FieldList a bSource
The list of serial number fields.
tagsFields :: TagsObject a => FieldList a bSource
The list of tag fields.
Generic parameter functions
dictFieldGetter :: DictObject a => String -> Maybe a -> ResultEntrySource
Returns a field from a (possibly missing) DictObject
. This is
used by parameter dictionaries, usually. Note that we have two
levels of maybe: the top level dict might be missing, or one key in
the dictionary might be.
buildQFTLookup :: [(String, String)] -> Map String FieldTypeSource
Build an optimised lookup map from a Python _PARAMETER_TYPES association list.
ndParamTypes :: Map String FieldTypeSource
ndParamTitles :: Map String FieldTitleSource
ndParamGetter :: NdParamObject a => String -> ConfigData -> a -> ResultEntrySource
buildNdParamField :: NdParamObject a => String -> FieldData a bSource
Builds the ndparam fields for an object.