Revision 8bcdde0c Ganeti/HTools/Instance.hs
b/Ganeti/HTools/Instance.hs | ||
---|---|---|
33 | 33 |
, create |
34 | 34 |
, setIdx |
35 | 35 |
, setName |
36 |
, setAlias |
|
36 | 37 |
, setPri |
37 | 38 |
, setSec |
38 | 39 |
, setBoth |
... | ... | |
49 | 50 |
|
50 | 51 |
-- | The instance type |
51 | 52 |
data Instance = Instance { name :: String -- ^ The instance name |
53 |
, alias :: String -- ^ The shortened name |
|
52 | 54 |
, mem :: Int -- ^ Memory of the instance |
53 | 55 |
, dsk :: Int -- ^ Disk size of instance |
54 | 56 |
, vcpus :: Int -- ^ Number of VCPUs |
... | ... | |
88 | 90 |
-> [String] -> T.Ndx -> T.Ndx -> Instance |
89 | 91 |
create name_init mem_init dsk_init vcpus_init run_init tags_init pn sn = |
90 | 92 |
Instance { name = name_init |
93 |
, alias = name_init |
|
91 | 94 |
, mem = mem_init |
92 | 95 |
, dsk = dsk_init |
93 | 96 |
, vcpus = vcpus_init |
... | ... | |
115 | 118 |
setName :: Instance -- ^ The original instance |
116 | 119 |
-> String -- ^ New name |
117 | 120 |
-> Instance -- ^ The modified instance |
118 |
setName t s = t { name = s } |
|
121 |
setName t s = t { name = s, alias = s } |
|
122 |
|
|
123 |
-- | Changes the alias. |
|
124 |
-- |
|
125 |
-- This is used only during the building of the data structures. |
|
126 |
setAlias :: Instance -- ^ The original instance |
|
127 |
-> String -- ^ New alias |
|
128 |
-> Instance -- ^ The modified instance |
|
129 |
setAlias t s = t { alias = s } |
|
119 | 130 |
|
120 | 131 |
-- * Update functions |
121 | 132 |
|
Also available in: Unified diff