Revision e23881ed lib/rapi/client.py
b/lib/rapi/client.py | ||
---|---|---|
757 | 757 |
("/%s/instances/%s/modify" % |
758 | 758 |
(GANETI_RAPI_VERSION, instance)), None, body) |
759 | 759 |
|
760 |
def GrowInstanceDisk(self, instance, disk, amount, wait_for_sync=None): |
|
761 |
"""Grows a disk of an instance. |
|
762 |
|
|
763 |
More details for parameters can be found in the RAPI documentation. |
|
764 |
|
|
765 |
@type instance: string |
|
766 |
@param instance: Instance name |
|
767 |
@type disk: integer |
|
768 |
@param disk: Disk index |
|
769 |
@type amount: integer |
|
770 |
@param amount: Grow disk by this amount (MiB) |
|
771 |
@type wait_for_sync: bool |
|
772 |
@param wait_for_sync: Wait for disk to synchronize |
|
773 |
@rtype: int |
|
774 |
@return: job id |
|
775 |
|
|
776 |
""" |
|
777 |
body = { |
|
778 |
"amount": amount, |
|
779 |
} |
|
780 |
|
|
781 |
if wait_for_sync is not None: |
|
782 |
body["wait_for_sync"] = wait_for_sync |
|
783 |
|
|
784 |
return self._SendRequest(HTTP_POST, |
|
785 |
("/%s/instances/%s/disk/%s/grow" % |
|
786 |
(GANETI_RAPI_VERSION, instance, disk)), |
|
787 |
None, body) |
|
788 |
|
|
760 | 789 |
def GetInstanceTags(self, instance): |
761 | 790 |
"""Gets tags for an instance. |
762 | 791 |
|
Also available in: Unified diff