From 3771d104caa87546cf3ef97e088261d14aa814e9 Mon Sep 17 00:00:00 2001
From: Agata Murawska <agatamurawska@google.com>
Date: Thu, 10 Nov 2011 11:10:13 +0100
Subject: [PATCH] htools: create InstanceStatus ADT

Signed-off-by: Agata Murawska <agatamurawska@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 htools/Ganeti/HTools/Types.hs | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/htools/Ganeti/HTools/Types.hs b/htools/Ganeti/HTools/Types.hs
index a7d7130e6..a3719d8dd 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
-- 
GitLab