Revision 5cd95d46 htools/Ganeti/Types.hs

b/htools/Ganeti/Types.hs
89 89
  , OpStatus(..)
90 90
  , opStatusToRaw
91 91
  , opStatusFromRaw
92
  , ELogType(..)
92 93
  ) where
93 94

  
94 95
import Control.Monad (liftM)
......
453 454

  
454 455
-- | Our ADT for the OpCode status at runtime (while in a job).
455 456
$(THH.declareSADT "OpStatus"
456
       [ ("OP_STATUS_QUEUED",    'C.opStatusQueued)
457
       , ("OP_STATUS_WAITING",   'C.opStatusWaiting)
458
       , ("OP_STATUS_CANCELING", 'C.opStatusCanceling)
459
       , ("OP_STATUS_RUNNING",   'C.opStatusRunning)
460
       , ("OP_STATUS_CANCELED",  'C.opStatusCanceled)
461
       , ("OP_STATUS_SUCCESS",   'C.opStatusSuccess)
462
       , ("OP_STATUS_ERROR",     'C.opStatusError)
463
       ])
457
  [ ("OP_STATUS_QUEUED",    'C.opStatusQueued)
458
  , ("OP_STATUS_WAITING",   'C.opStatusWaiting)
459
  , ("OP_STATUS_CANCELING", 'C.opStatusCanceling)
460
  , ("OP_STATUS_RUNNING",   'C.opStatusRunning)
461
  , ("OP_STATUS_CANCELED",  'C.opStatusCanceled)
462
  , ("OP_STATUS_SUCCESS",   'C.opStatusSuccess)
463
  , ("OP_STATUS_ERROR",     'C.opStatusError)
464
  ])
464 465
$(THH.makeJSONInstance ''OpStatus)
466

  
467
-- | Type for the job message type.
468
$(THH.declareSADT "ELogType"
469
  [ ("ELogMessage",      'C.elogMessage)
470
  , ("ELogRemoteImport", 'C.elogRemoteImport)
471
  , ("ELogJqueueTest",   'C.elogJqueueTest)
472
  ])
473
$(THH.makeJSONInstance ''ELogType)

Also available in: Unified diff