projects
/
ganeti-local
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Haskell parser for "xm uptime"
[ganeti-local]
/
src
/
Ganeti
/
Hypervisor
/
Xen
/
Types.hs
diff --git
a/src/Ganeti/Hypervisor/Xen/Types.hs
b/src/Ganeti/Hypervisor/Xen/Types.hs
index
239f267
..
f37dc86
100644
(file)
--- a/
src/Ganeti/Hypervisor/Xen/Types.hs
+++ b/
src/Ganeti/Hypervisor/Xen/Types.hs
@@
-26,6
+26,7
@@
module Ganeti.Hypervisor.Xen.Types
( LispConfig(..)
, Domain(..)
, FromLispConfig(..)
( LispConfig(..)
, Domain(..)
, FromLispConfig(..)
+ , UptimeInfo(..)
, ActualState(..)
) where
, ActualState(..)
) where
@@
-84,6
+85,13
@@
instance FromLispConfig [LispConfig] where
Bad $ "Unable to extract a List from this configuration: "
++ show c
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
data ActualState = ActualRunning -- ^ The instance is running
| ActualBlocked -- ^ The instance is not running or runnable
| ActualPaused -- ^ The instance has been paused