Revision 139c0683 htools/Ganeti/OpParams.hs
b/htools/Ganeti/OpParams.hs | ||
---|---|---|
308 | 308 |
| TagNode String |
309 | 309 |
| TagGroup String |
310 | 310 |
| TagCluster |
311 |
deriving (Show, Read, Eq)
|
|
311 |
deriving (Show, Eq) |
|
312 | 312 |
|
313 | 313 |
-- | Tag type for a given tag object. |
314 | 314 |
tagTypeOf :: TagObject -> TagType |
... | ... | |
365 | 365 |
-- | Disk index type (embedding constraints on the index value via a |
366 | 366 |
-- smart constructor). |
367 | 367 |
newtype DiskIndex = DiskIndex { unDiskIndex :: Int } |
368 |
deriving (Show, Read, Eq, Ord)
|
|
368 |
deriving (Show, Eq, Ord) |
|
369 | 369 |
|
370 | 370 |
-- | Smart constructor for 'DiskIndex'. |
371 | 371 |
mkDiskIndex :: (Monad m) => Int -> m DiskIndex |
... | ... | |
413 | 413 |
= RecreateDisksAll |
414 | 414 |
| RecreateDisksIndices (NonEmpty DiskIndex) |
415 | 415 |
| RecreateDisksParams (NonEmpty (DiskIndex, IDiskParams)) |
416 |
deriving (Eq, Read, Show)
|
|
416 |
deriving (Eq, Show) |
|
417 | 417 |
|
418 | 418 |
readRecreateDisks :: JSValue -> Text.JSON.Result RecreateDisksInfo |
419 | 419 |
readRecreateDisks (JSArray []) = return RecreateDisksAll |
... | ... | |
435 | 435 |
-- | Simple type for old-style ddm changes. |
436 | 436 |
data DdmOldChanges = DdmOldIndex (NonNegative Int) |
437 | 437 |
| DdmOldMod DdmSimple |
438 |
deriving (Eq, Read, Show)
|
|
438 |
deriving (Eq, Show) |
|
439 | 439 |
|
440 | 440 |
readDdmOldChanges :: JSValue -> Text.JSON.Result DdmOldChanges |
441 | 441 |
readDdmOldChanges v = |
... | ... | |
456 | 456 |
= SetParamsEmpty |
457 | 457 |
| SetParamsDeprecated (NonEmpty (DdmOldChanges, a)) |
458 | 458 |
| SetParamsNew (NonEmpty (DdmFull, Int, a)) |
459 |
deriving (Eq, Read, Show)
|
|
459 |
deriving (Eq, Show) |
|
460 | 460 |
|
461 | 461 |
-- | Custom deserialiser for 'SetParamsMods'. |
462 | 462 |
readSetParams :: (JSON a) => JSValue -> Text.JSON.Result (SetParamsMods a) |
... | ... | |
478 | 478 |
-- tests). But the proper type could be parsed if we wanted. |
479 | 479 |
data ExportTarget = ExportTargetLocal NonEmptyString |
480 | 480 |
| ExportTargetRemote UncheckedList |
481 |
deriving (Eq, Read, Show)
|
|
481 |
deriving (Eq, Show) |
|
482 | 482 |
|
483 | 483 |
-- | Custom reader for 'ExportTarget'. |
484 | 484 |
readExportTarget :: JSValue -> Text.JSON.Result ExportTarget |
Also available in: Unified diff