Safe Haskell | Safe-Infered |
---|
Implementation of the Ganeti Query2 functionality.
- data CollectorType a b
- = CollectorSimple (Bool -> ConfigData -> [a] -> IO [(a, b)])
- | CollectorFieldAware (Bool -> ConfigData -> [String] -> [a] -> IO [(a, b)])
- mkUnknownFDef :: String -> FieldData a b
- execGetter :: ConfigData -> b -> a -> FieldGetter a b -> ResultEntry
- getSelectedFields :: FieldMap a b -> [String] -> FieldList a b
- needsLiveData :: [FieldGetter a b] -> Bool
- needsNames :: Query -> Maybe [FilterValue]
- nameField :: ItemType -> FilterField
- uuidField :: ItemType -> FilterField
- getAllQuotedStrings :: [FilterValue] -> [String]
- getRequestedNames :: Query -> [String]
- getRequestedJobIDs :: Filter FilterField -> Result [JobId]
- genericQuery :: FieldMap a b -> CollectorType a b -> (a -> String) -> (ConfigData -> Container a) -> (ConfigData -> String -> ErrorResult a) -> ConfigData -> Bool -> [String] -> Filter FilterField -> [String] -> IO (ErrorResult QueryResult)
- query :: ConfigData -> Bool -> Query -> IO (ErrorResult QueryResult)
- dummyCollectLiveData :: Bool -> ConfigData -> [a] -> IO [(a, NoDataRuntime)]
- queryInner :: ConfigData -> Bool -> Query -> [String] -> IO (ErrorResult QueryResult)
- queryJobs :: ConfigData -> Bool -> [FilterField] -> Filter FilterField -> IO (ErrorResult QueryResult)
- fieldsExtractor :: FieldMap a b -> [FilterField] -> QueryFieldsResult
- queryFields :: QueryFields -> ErrorResult QueryFieldsResult
- queryCompat :: QueryResult -> ErrorResult [[JSValue]]
Documentation
data CollectorType a b Source
CollectorSimple (Bool -> ConfigData -> [a] -> IO [(a, b)]) | |
CollectorFieldAware (Bool -> ConfigData -> [String] -> [a] -> IO [(a, b)]) |
Helper functions
mkUnknownFDef :: String -> FieldData a bSource
execGetter :: ConfigData -> b -> a -> FieldGetter a b -> ResultEntrySource
Main query execution
getSelectedFields :: FieldMap a b -> [String] -> FieldList a bSource
needsLiveData :: [FieldGetter a b] -> BoolSource
needsNames :: Query -> Maybe [FilterValue]Source
nameField :: ItemType -> FilterFieldSource
Computes the name field for different query types.
uuidField :: ItemType -> FilterFieldSource
Computes the uuid field, or the best possible substitute, for different query types.
getAllQuotedStrings :: [FilterValue] -> [String]Source
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 -> CollectorType a b -> (a -> String) -> (ConfigData -> Container a) -> (ConfigData -> String -> ErrorResult a) -> ConfigData -> Bool -> [String] -> Filter FilterField -> [String] -> IO (ErrorResult QueryResult)Source
:: ConfigData | The current configuration |
-> Bool | Whether to collect live data |
-> Query | The query (item, fields, filter) |
-> IO (ErrorResult QueryResult) | Result |
Main query execution function.
dummyCollectLiveData :: Bool -> ConfigData -> [a] -> IO [(a, NoDataRuntime)]Source
queryInner :: ConfigData -> Bool -> Query -> [String] -> IO (ErrorResult QueryResult)Source
queryJobs :: ConfigData -> Bool -> [FilterField] -> Filter FilterField -> IO (ErrorResult QueryResult)Source
fieldsExtractor :: FieldMap a b -> [FilterField] -> QueryFieldsResultSource
queryFields :: QueryFields -> ErrorResult QueryFieldsResultSource
Query fields call.
queryCompat :: QueryResult -> ErrorResult [[JSValue]]Source
Classic query converter. It gets a standard query result on input and computes the classic style results.