Revision c32c4e4d src/Ganeti/DataCollectors/Types.hs
b/src/Ganeti/DataCollectors/Types.hs | ||
---|---|---|
37 | 37 |
, CollectorMap |
38 | 38 |
, buildReport |
39 | 39 |
, mergeStatuses |
40 |
, getCategoryName |
|
40 | 41 |
) where |
41 | 42 |
|
42 | 43 |
import Data.Char |
... | ... | |
52 | 53 |
data DCCategory = DCInstance | DCStorage | DCDaemon | DCHypervisor |
53 | 54 |
deriving (Show, Eq) |
54 | 55 |
|
56 |
-- | Get the category name and return it as a string. |
|
57 |
getCategoryName :: DCCategory -> String |
|
58 |
getCategoryName dcc = map toLower . drop 2 . show $ dcc |
|
59 |
|
|
55 | 60 |
-- | The JSON instance for DCCategory. |
56 | 61 |
instance JSON DCCategory where |
57 |
showJSON = showJSON . map toLower . drop 2 . show
|
|
62 |
showJSON = showJSON . getCategoryName
|
|
58 | 63 |
readJSON = |
59 | 64 |
error "JSON read instance not implemented for type DCCategory" |
60 | 65 |
|
Also available in: Unified diff