Revision b1e47e2d lib/masterd/iallocator.py
b/lib/masterd/iallocator.py | ||
---|---|---|
186 | 186 |
} |
187 | 187 |
|
188 | 188 |
|
189 |
class IAReqMultiInstanceAlloc(IARequestBase): |
|
190 |
"""An multi instance allocation request. |
|
191 |
|
|
192 |
""" |
|
193 |
MODE = constants.IALLOCATOR_MODE_MULTI_ALLOC |
|
194 |
REQ_PARAMS = [ |
|
195 |
("instances", ht.TListOf(ht.TInstanceOf(IAReqInstanceAlloc))) |
|
196 |
] |
|
197 |
_MASUCCESS = \ |
|
198 |
ht.TListOf(ht.TAnd(ht.TIsLength(2), |
|
199 |
ht.TItems([ht.TNonEmptyString, |
|
200 |
ht.TListOf(ht.TNonEmptyString), |
|
201 |
]))) |
|
202 |
_MAFAILED = ht.TListOf(ht.TNonEmptyString) |
|
203 |
REQ_RESULT = ht.TListOf(ht.TAnd(ht.TIsLength(2), |
|
204 |
ht.TItems([_MASUCCESS, _MAFAILED]))) |
|
205 |
|
|
206 |
def GetRequest(self, cfg): |
|
207 |
return { |
|
208 |
"instances": [iareq.GetRequest(cfg) for iareq in self.instances] |
|
209 |
} |
|
210 |
|
|
211 |
|
|
189 | 212 |
class IAReqRelocate(IARequestBase): |
190 | 213 |
"""A relocation request. |
191 | 214 |
|
Also available in: Unified diff