ganeti
Safe HaskellNone

Ganeti.Query.Types

Description

Implementation of the Ganeti Query2 basic types.

These are types internal to the library, and for example clients that use the library should not need to import it.

Synopsis

Documentation

data FieldGetter a b Source #

The type of field getters. The "a" type represents the type we're querying, whereas the "b" type represents the 'runtime' data for that type (if any). Note that we don't support multiple runtime sources, and we always consider the entire configuration as a given (so no equivalent for Python's *_CONFIG and *_GROUP; configuration accesses are cheap for us).

data QffMode Source #

Type defining how the value of a field is used in filtering. This implements the equivalent to Python's QFF_ flags, except that we don't use OR-able values.

Constructors

QffNormal

Value is used as-is in filters

QffTimestamp

Value is a timestamp tuple, convert to float

QffHostname

Value is a hostname, compare it smartly

Instances

Instances details
Eq QffMode # 
Instance details

Defined in Ganeti.Query.Types

Methods

(==) :: QffMode -> QffMode -> Bool

(/=) :: QffMode -> QffMode -> Bool

Show QffMode # 
Instance details

Defined in Ganeti.Query.Types

Methods

showsPrec :: Int -> QffMode -> ShowS

show :: QffMode -> String

showList :: [QffMode] -> ShowS

type FieldData a b = (FieldDefinition, FieldGetter a b, QffMode) Source #

Alias for a field data (definition and getter).

type FieldList a b = [FieldData a b] Source #

Alias for a field data list.

type FieldMap a b = Map String (FieldData a b) Source #

Alias for field maps.

isRuntimeField :: FieldGetter a b -> Bool Source #

Helper function to check if a getter is a runtime one.

fieldListToFieldMap :: FieldList a b -> FieldMap a b Source #

Helper function to obtain a FieldMap from the corresponding FieldList.