Revision 7ec2f76b

b/src/Ganeti/HTools/Types.hs
78 78
  , AutoRepairResult(..)
79 79
  , autoRepairResultToRaw
80 80
  , autoRepairResultFromRaw
81
  , AutoRepairPolicy(..)
82
  , AutoRepairSuspendTime(..)
83
  , AutoRepairData(..)
84
  , AutoRepairStatus(..)
81 85
  ) where
82 86

  
83 87
import qualified Data.Map as M
88
import System.Time (ClockTime)
84 89

  
85 90
import qualified Ganeti.Constants as C
86 91
import qualified Ganeti.THH as THH
......
369 374
       , ("ArFailure", 'C.autoRepairFailure)
370 375
       , ("ArEnoperm", 'C.autoRepairEnoperm)
371 376
       ])
377

  
378
-- | The possible auto-repair policy for a given instance.
379
data AutoRepairPolicy
380
  = ArEnabled AutoRepairType          -- ^ Auto-repair explicitly enabled
381
  | ArSuspended AutoRepairSuspendTime -- ^ Suspended temporarily, or forever
382
  | ArNotEnabled                      -- ^ Auto-repair not explicitly enabled
383
  deriving (Eq, Show)
384

  
385
-- | The suspend timeout for 'ArSuspended'.
386
data AutoRepairSuspendTime = Forever         -- ^ Permanently suspended
387
                           | Until ClockTime -- ^ Suspended up to a certain time
388
                           deriving (Eq, Show)
389

  
390
-- | The possible auto-repair states for any given instance.
391
data AutoRepairStatus
392
  = ArHealthy                      -- ^ No problems detected with the instance
393
  | ArNeedsRepair AutoRepairData   -- ^ Instance has problems, no action taken
394
  | ArPendingRepair AutoRepairData -- ^ Repair jobs ongoing for the instance
395
  | ArFailedRepair AutoRepairData  -- ^ Some repair jobs for the instance failed
396

  
397
-- | The data accompanying a repair operation (future, pending, or failed).
398
data AutoRepairData = AutoRepairData { arType :: AutoRepairType
399
                                     , arUuid :: String
400
                                     , arTime :: ClockTime
401
                                     , arJobs :: [JobId]
402
                                     , arResult :: Maybe AutoRepairResult
403
                                     }

Also available in: Unified diff