Add Haskell parser for "xm uptime"
[ganeti-local] / src / Ganeti / Hypervisor / Xen / Types.hs
index 239f267..f37dc86 100644 (file)
@@ -26,6 +26,7 @@ module Ganeti.Hypervisor.Xen.Types
   ( LispConfig(..)
   , Domain(..)
   , FromLispConfig(..)
+  , UptimeInfo(..)
   , ActualState(..)
   ) where
 
@@ -84,6 +85,13 @@ instance FromLispConfig [LispConfig] where
     Bad $ "Unable to extract a List from this configuration: "
       ++ show c
 
+-- Data type representing the information that can be obtained from @xm uptime@
+data UptimeInfo = UptimeInfo
+  { uInfoName   :: String
+  , uInfoID     :: Int
+  , uInfoUptime :: String
+  } deriving (Eq, Show)
+
 data ActualState = ActualRunning  -- ^ The instance is running
                  | ActualBlocked  -- ^ The instance is not running or runnable
                  | ActualPaused   -- ^ The instance has been paused