Revision b680c8be lib/rapi/client.py
b/lib/rapi/client.py | ||
---|---|---|
767 | 767 |
("/%s/instances/%s/modify" % |
768 | 768 |
(GANETI_RAPI_VERSION, instance)), None, body) |
769 | 769 |
|
770 |
def ActivateInstanceDisks(self, instance, ignore_size=None): |
|
771 |
"""Activates an instance's disks. |
|
772 |
|
|
773 |
@type instance: string |
|
774 |
@param instance: Instance name |
|
775 |
@type ignore_size: bool |
|
776 |
@param ignore_size: Whether to ignore recorded size |
|
777 |
@return: job id |
|
778 |
|
|
779 |
""" |
|
780 |
query = [] |
|
781 |
if ignore_size: |
|
782 |
query.append(("ignore_size", 1)) |
|
783 |
|
|
784 |
return self._SendRequest(HTTP_PUT, |
|
785 |
("/%s/instances/%s/activate-disks" % |
|
786 |
(GANETI_RAPI_VERSION, instance)), query, None) |
|
787 |
|
|
788 |
def DeactivateInstanceDisks(self, instance): |
|
789 |
"""Deactivates an instance's disks. |
|
790 |
|
|
791 |
@type instance: string |
|
792 |
@param instance: Instance name |
|
793 |
@return: job id |
|
794 |
|
|
795 |
""" |
|
796 |
return self._SendRequest(HTTP_PUT, |
|
797 |
("/%s/instances/%s/deactivate-disks" % |
|
798 |
(GANETI_RAPI_VERSION, instance)), None, None) |
|
799 |
|
|
770 | 800 |
def GrowInstanceDisk(self, instance, disk, amount, wait_for_sync=None): |
771 | 801 |
"""Grows a disk of an instance. |
772 | 802 |
|
Also available in: Unified diff