Safe Haskell | Safe-Infered |
---|
Implementation of the Ganeti Query2 functionality.
- 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
- getAllQuotedStrings :: [FilterValue] -> [String]
- getRequestedNames :: Query -> [String]
- getRequestedJobIDs :: Filter FilterField -> Result [JobId]
- query :: ConfigData -> Bool -> Query -> IO (ErrorResult QueryResult)
- 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]]
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.
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.
:: 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
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.