Safe Haskell | None |
---|
Implementation of the Ganeti data collector types.
- data DCCategory
- = DCInstance
- | DCStorage
- | DCDaemon
- | DCHypervisor
- data DCStatusCode
- = DCSCOk
- | DCSCTempBad
- | DCSCUnknown
- | DCSCBad
- data DCStatus = DCStatus {
- dcStatusCode :: DCStatusCode
- dcStatusMessage :: String
- loadDCStatus :: JSValue -> Result DCStatus
- saveDCStatus :: DCStatus -> JSValue
- toDictDCStatus :: DCStatus -> [(String, JSValue)]
- data DCKind
- data DCVersion
- = DCVerBuiltin
- | DCVersion String
- data DCReport = DCReport {
- dcReportName :: String
- dcReportVersion :: DCVersion
- dcReportFormatVersion :: Int
- dcReportTimestamp :: Integer
- dcReportCategory :: Maybe DCCategory
- dcReportKind :: DCKind
- dcReportData :: JSValue
- loadDCReport :: JSValue -> Result DCReport
- saveDCReport :: DCReport -> JSValue
- toDictDCReport :: DCReport -> [(String, JSValue)]
- addStatus :: DCStatus -> JSValue -> JSValue
- buildReport :: String -> DCVersion -> Int -> Maybe DCCategory -> DCKind -> JSValue -> IO DCReport
Documentation
data DCCategory Source
The possible classes a data collector can belong to.
Eq DCCategory | |
Show DCCategory | |
JSON DCCategory | The JSON instance for DCCategory. |
data DCStatusCode Source
The possible status codes of a data collector.
DCSCOk | Everything is OK |
DCSCTempBad | Bad, but being automatically fixed |
DCSCUnknown | Unable to determine the status |
DCSCBad | Bad. External intervention required |
Eq DCStatusCode | |
Ord DCStatusCode | |
Show DCStatusCode | |
JSON DCStatusCode | The JSON instance for CollectorStatus. |
The status of a "status reporting data collector".
DCStatus | |
|
loadDCStatus :: JSValue -> Result DCStatusSource
saveDCStatus :: DCStatus -> JSValueSource
toDictDCStatus :: DCStatus -> [(String, JSValue)]Source
The type representing the kind of the collector.
Type representing the version number of a data collector.
DCVerBuiltin | |
DCVersion String |
This is the format of the report produced by each data collector.
DCReport | |
|
loadDCReport :: JSValue -> Result DCReportSource
saveDCReport :: DCReport -> JSValueSource
toDictDCReport :: DCReport -> [(String, JSValue)]Source
addStatus :: DCStatus -> JSValue -> JSValueSource
Add the data collector status information to the JSON representation of the collector data.
buildReport :: String -> DCVersion -> Int -> Maybe DCCategory -> DCKind -> JSValue -> IO DCReportSource
Utility function for building a report automatically adding the current timestamp (rounded up to seconds). If the version is not specified, it will be set to the value indicating a builtin collector.