ganeti

Safe HaskellSafe-Infered

Ganeti.Query.Query

Contents

Description

Implementation of the Ganeti Query2 functionality.

Synopsis

Helper functions

Main query execution

getSelectedFields :: FieldMap a b -> [String] -> FieldList a bSource

nameField :: ItemType -> FilterFieldSource

Computes the name field for different query types.

getRequestedNames :: Query -> [String]Source

Checks that we have either requested a valid set of names, or we have a more complex filter.

genericQuery :: FieldMap a b -> (Bool -> ConfigData -> [a] -> IO [(a, b)]) -> (a -> String) -> (ConfigData -> Container a) -> (ConfigData -> String -> ErrorResult a) -> ConfigData -> Bool -> [String] -> Filter FilterField -> [String] -> IO (ErrorResult QueryResult)Source

querySource

Arguments

:: ConfigData

The current configuration

-> Bool

Whether to collect live data

-> Query

The query (item, fields, filter)

-> IO (ErrorResult QueryResult)

Result

Main query execution function.

queryInner :: ConfigData -> Bool -> Query -> [String] -> IO (ErrorResult QueryResult)Source

queryCompat :: QueryResult -> ErrorResult [[JSValue]]Source

Classic query converter. It gets a standard query result on input and computes the classic style results.