Commit 7b6e99b3 authored by Iustin Pop's avatar Iustin Pop
Browse files

Add a new type ClusterData



This will be used to hold all the disparate uses of the cluster data:
we have either tuples with these four elements, or functions taking
these four arguments, etc.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarBalazs Lecz <leczb@google.com>
parent 45cb5963
......@@ -36,6 +36,8 @@ module Ganeti.HTools.Loader
, commonSuffix
, RqType(..)
, Request(..)
, ClusterData(..)
, emptyCluster
) where
import Data.List
......@@ -74,6 +76,18 @@ data RqType
data Request = Request RqType Group.List Node.List Instance.List [String]
deriving (Show)
-- | The cluster state.
data ClusterData = ClusterData
{ cdGroups :: Group.List -- ^ The node group list
, cdNodes :: Node.List -- ^ The node list
, cdInstances :: Instance.List -- ^ The instance list
, cdTags :: [String] -- ^ The cluster tags
} deriving (Show)
-- | An empty cluster.
emptyCluster :: ClusterData
emptyCluster = ClusterData Container.empty Container.empty Container.empty []
-- * Functions
-- | Lookups a node into an assoc list.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment