Revision 8d232068 lib/rapi/rlib2.py

b/lib/rapi/rlib2.py
518 518
      })
519 519

  
520 520

  
521
class R_2_nodes_name_storage_modify(baserlib.ResourceBase):
521
class R_2_nodes_name_storage_modify(baserlib.OpcodeResource):
522 522
  """/2/nodes/[node_name]/storage/modify resource.
523 523

  
524 524
  """
525
  def PUT(self):
526
    node_name = self.items[0]
525
  PUT_OPCODE = opcodes.OpNodeModifyStorage
527 526

  
528
    storage_type = self._checkStringVariable("storage_type", None)
529
    if not storage_type:
530
      raise http.HttpBadRequest("Missing the required 'storage_type'"
531
                                " parameter")
527
  def GetPutOpInput(self):
528
    """Modifies a storage volume on a node.
532 529

  
530
    """
531
    storage_type = self._checkStringVariable("storage_type", None)
533 532
    name = self._checkStringVariable("name", None)
533

  
534 534
    if not name:
535 535
      raise http.HttpBadRequest("Missing the required 'name'"
536 536
                                " parameter")
......
541 541
      changes[constants.SF_ALLOCATABLE] = \
542 542
        bool(self._checkIntVariable("allocatable", default=1))
543 543

  
544
    op = opcodes.OpNodeModifyStorage(node_name=node_name,
545
                                     storage_type=storage_type,
546
                                     name=name,
547
                                     changes=changes)
548
    return self.SubmitJob([op])
544
    return ({}, {
545
      "node_name": self.items[0],
546
      "storage_type": storage_type,
547
      "name": name,
548
      "changes": changes,
549
      })
549 550

  
550 551

  
551 552
class R_2_nodes_name_storage_repair(baserlib.ResourceBase):

Also available in: Unified diff