Add the reason trail type definition in Haskell
authorMichele Tartara <mtartara@google.com>
Thu, 25 Apr 2013 07:16:03 +0000 (07:16 +0000)
committerMichele Tartara <mtartara@google.com>
Tue, 30 Apr 2013 15:38:25 +0000 (15:38 +0000)
It will be added to the haskell definition of opcodes, to keep it aligned to
the python one, and it will be used for fetching the reason trail by the
instance status data collector.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

src/Ganeti/Types.hs

index 6bd3ade..c0fa6bd 100644 (file)
@@ -92,6 +92,8 @@ module Ganeti.Types
   , opStatusToRaw
   , opStatusFromRaw
   , ELogType(..)
+  , ReasonElem
+  , ReasonTrail
   ) where
 
 import Control.Monad (liftM)
@@ -485,3 +487,9 @@ $(THH.declareSADT "ELogType"
   , ("ELogJqueueTest",   'C.elogJqueueTest)
   ])
 $(THH.makeJSONInstance ''ELogType)
+
+-- | Type of one element of a reason trail.
+type ReasonElem = (String, String, Integer)
+
+-- | Type representing a reason trail.
+type ReasonTrail = [ReasonElem]