Revision 608efcce Ganeti/HTools/Instance.hs
b/Ganeti/HTools/Instance.hs | ||
---|---|---|
15 | 15 |
, running :: Bool -- ^ whether the instance |
16 | 16 |
-- is running |
17 | 17 |
, run_st :: String -- ^ original (text) run status |
18 |
, pnode :: Int -- ^ original primary node
|
|
19 |
, snode :: Int -- ^ original secondary node
|
|
20 |
, idx :: Int -- ^ internal index for
|
|
18 |
, pnode :: T.Ndx -- ^ original primary node
|
|
19 |
, snode :: T.Ndx -- ^ original secondary node
|
|
20 |
, idx :: T.Idx -- ^ internal index for
|
|
21 | 21 |
-- book-keeping |
22 | 22 |
} deriving (Show) |
23 | 23 |
|
... | ... | |
28 | 28 |
setIdx = setIdx |
29 | 29 |
|
30 | 30 |
-- | A simple name for the int, instance association list |
31 |
type AssocList = [(Int, Instance)]
|
|
31 |
type AssocList = [(T.Idx, Instance)]
|
|
32 | 32 |
|
33 | 33 |
-- | A simple name for an instance map |
34 | 34 |
type List = Container.Container Instance |
35 | 35 |
|
36 |
create :: String -> Int -> Int -> String -> Int -> Int -> Instance
|
|
36 |
create :: String -> Int -> Int -> String -> T.Ndx -> T.Ndx -> Instance
|
|
37 | 37 |
create name_init mem_init dsk_init run_init pn sn = |
38 | 38 |
Instance { |
39 | 39 |
name = name_init, |
... | ... | |
51 | 51 |
|
52 | 52 |
-- | Changes the primary node of the instance. |
53 | 53 |
setPri :: Instance -- ^ the original instance |
54 |
-> Int -- ^ the new primary node
|
|
54 |
-> T.Ndx -- ^ the new primary node
|
|
55 | 55 |
-> Instance -- ^ the modified instance |
56 | 56 |
setPri t p = t { pnode = p } |
57 | 57 |
|
58 | 58 |
-- | Changes the secondary node of the instance. |
59 | 59 |
setSec :: Instance -- ^ the original instance |
60 |
-> Int -- ^ the new secondary node
|
|
60 |
-> T.Ndx -- ^ the new secondary node
|
|
61 | 61 |
-> Instance -- ^ the modified instance |
62 | 62 |
setSec t s = t { snode = s } |
63 | 63 |
|
64 | 64 |
-- | Changes both nodes of the instance. |
65 | 65 |
setBoth :: Instance -- ^ the original instance |
66 |
-> Int -- ^ new primary node index
|
|
67 |
-> Int -- ^ new secondary node index
|
|
66 |
-> T.Ndx -- ^ new primary node index
|
|
67 |
-> T.Ndx -- ^ new secondary node index
|
|
68 | 68 |
-> Instance -- ^ the modified instance |
69 | 69 |
setBoth t p s = t { pnode = p, snode = s } |
70 | 70 |
|
71 | 71 |
-- | Changes the index. |
72 | 72 |
-- This is used only during the building of the data structures. |
73 | 73 |
setIdx :: Instance -- ^ the original instance |
74 |
-> Int -- ^ new index
|
|
74 |
-> T.Idx -- ^ new index
|
|
75 | 75 |
-> Instance -- ^ the modified instance |
76 | 76 |
setIdx t i = t { idx = i } |
77 | 77 |
|
Also available in: Unified diff