Revision 19f38ee8 Ganeti/HTools/Loader.hs
b/Ganeti/HTools/Loader.hs | ||
---|---|---|
11 | 11 |
, lookupNode |
12 | 12 |
, lookupInstance |
13 | 13 |
, stripSuffix |
14 |
, RqType(..) |
|
15 |
, Request(..) |
|
14 | 16 |
) where |
15 | 17 |
|
16 | 18 |
import Data.List |
... | ... | |
23 | 25 |
|
24 | 26 |
import Ganeti.HTools.Types |
25 | 27 |
|
28 |
-- * Types |
|
29 |
|
|
30 |
{-| The request type. |
|
31 |
|
|
32 |
This type denotes what request we got from Ganeti and also holds |
|
33 |
request-specific fields. |
|
34 |
|
|
35 |
-} |
|
36 |
data RqType |
|
37 |
= Allocate Instance.Instance Int -- ^ A new instance allocation |
|
38 |
| Relocate Idx Int [Ndx] -- ^ Move an instance to a new |
|
39 |
-- secondary node |
|
40 |
deriving (Show) |
|
41 |
|
|
42 |
-- | A complete request, as received from Ganeti. |
|
43 |
data Request = Request RqType Node.List Instance.List String |
|
44 |
deriving (Show) |
|
45 |
|
|
46 |
-- * Functions |
|
47 |
|
|
26 | 48 |
-- | Lookups a node into an assoc list. |
27 | 49 |
lookupNode :: (Monad m) => [(String, Ndx)] -> String -> String -> m Ndx |
28 | 50 |
lookupNode ktn inst node = |
Also available in: Unified diff