diff --git a/htools/Ganeti/HTools/Types.hs b/htools/Ganeti/HTools/Types.hs index a7d7130e6f73651870d0868becb079c14016678a..a3719d8dd9fe1adf9e286c65ebf509eb54ac9550 100644 --- a/htools/Ganeti/HTools/Types.hs +++ b/htools/Ganeti/HTools/Types.hs @@ -36,6 +36,9 @@ module Ganeti.HTools.Types , AllocPolicy(..) , allocPolicyFromRaw , allocPolicyToRaw + , InstanceStatus(..) + , instanceStatusFromRaw + , instanceStatusToRaw , RSpec(..) , DynUtil(..) , zeroUtil @@ -110,6 +113,19 @@ $(THH.declareSADT "AllocPolicy" ]) $(THH.makeJSONInstance ''AllocPolicy) +-- | The Instance real state type. +$(THH.declareSADT "InstanceStatus" + [ ("AdminDown", 'C.inststAdmindown) + , ("AdminOffline", 'C.inststAdminoffline) + , ("ErrorDown", 'C.inststErrordown) + , ("ErrorUp", 'C.inststErrorup) + , ("NodeDown", 'C.inststNodedown) + , ("NodeOffline", 'C.inststNodeoffline) + , ("Running", 'C.inststRunning) + , ("WrongNode", 'C.inststWrongnode) + ]) +$(THH.makeJSONInstance ''InstanceStatus) + -- | The resource spec type. data RSpec = RSpec { rspecCpu :: Int -- ^ Requested VCPUs