Revision 1e82bc80

b/doc/rapi.rst
541 541
``output_fields``. The result will be a job id, using which the result can be
542 542
retrieved.
543 543

  
544
``/2/nodes/[node_name]/storage/modify``
545
+++++++++++++++++++++++++++++++++++++++
546

  
547
Modifies storage units on the node.
548

  
549
``PUT``
550
~~~~~~~
551

  
552
Modifies parameters of storage units on the node. Requires the parameters
553
``storage_type`` (one of ``file``, ``lvm-pv`` or ``lvm-vg``) and ``name`` (name
554
of the storage unit).  Parameters can be passed additionally. Currently only
555
``allocatable`` (bool) is supported. The result will be a job id.
556

  
544 557
``/2/nodes/[node_name]/tags``
545 558
+++++++++++++++++++++++++++++
546 559

  
b/lib/rapi/connector.py
161 161
      rlib2.R_2_nodes_name_migrate,
162 162
  re.compile(r'^/2/nodes/([\w\._-]+)/storage$'):
163 163
      rlib2.R_2_nodes_name_storage,
164
  re.compile(r'^/2/nodes/([\w\._-]+)/storage/modify$'):
165
      rlib2.R_2_nodes_name_storage_modify,
164 166
  "/2/instances": rlib2.R_2_instances,
165 167
  re.compile(r'^/2/instances/([\w\._-]+)$'): rlib2.R_2_instances_name,
166 168
  re.compile(r'^/2/instances/([\w\._-]+)/tags$'): rlib2.R_2_instances_name_tags,
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