Revision 1e82bc80 lib/rapi/rlib2.py
b/lib/rapi/rlib2.py | ||
---|---|---|
323 | 323 |
return baserlib.SubmitJob([op]) |
324 | 324 |
|
325 | 325 |
|
326 |
class R_2_nodes_name_storage_modify(baserlib.R_Generic): |
|
327 |
"""/2/nodes/[node_name]/storage/modify ressource. |
|
328 |
|
|
329 |
""" |
|
330 |
def PUT(self): |
|
331 |
node_name = self.items[0] |
|
332 |
|
|
333 |
storage_type = self._checkStringVariable("storage_type", None) |
|
334 |
if not storage_type: |
|
335 |
raise http.HttpBadRequest("Missing the required 'storage_type'" |
|
336 |
" parameter") |
|
337 |
|
|
338 |
name = self._checkStringVariable("name", None) |
|
339 |
if not name: |
|
340 |
raise http.HttpBadRequest("Missing the required 'name'" |
|
341 |
" parameter") |
|
342 |
|
|
343 |
changes = {} |
|
344 |
|
|
345 |
if "allocatable" in self.queryargs: |
|
346 |
changes[constants.SF_ALLOCATABLE] = \ |
|
347 |
bool(self._checkIntVariable("allocatable", default=1)) |
|
348 |
|
|
349 |
op = opcodes.OpModifyNodeStorage(node_name=node_name, |
|
350 |
storage_type=storage_type, |
|
351 |
name=name, |
|
352 |
changes=changes) |
|
353 |
return baserlib.SubmitJob([op]) |
|
354 |
|
|
355 |
|
|
326 | 356 |
class R_2_instances(baserlib.R_Generic): |
327 | 357 |
"""/2/instances resource. |
328 | 358 |
|
Also available in: Unified diff