Skip to content
Snippets Groups Projects
Commit 3771d104 authored by Agata Murawska's avatar Agata Murawska
Browse files

htools: create InstanceStatus ADT


Signed-off-by: default avatarAgata Murawska <agatamurawska@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 57de31c0
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment