return self._SendRequest(HTTP_POST, "/%s/instances" % GANETI_RAPI_VERSION,
query, body)
- def DeleteInstance(self, instance, dry_run=False):
+ def DeleteInstance(self, instance, dry_run=False, **kwargs):
"""Deletes an instance.
@type instance: str
"""
query = []
+ body = kwargs
+
_AppendDryRunIf(query, dry_run)
return self._SendRequest(HTTP_DELETE,
("/%s/instances/%s" %
- (GANETI_RAPI_VERSION, instance)), query, None)
+ (GANETI_RAPI_VERSION, instance)), query, body)
def ModifyInstance(self, instance, **kwargs):
"""Modifies an instance.
(GANETI_RAPI_VERSION, instance)), query, None)
def RebootInstance(self, instance, reboot_type=None, ignore_secondaries=None,
- dry_run=False, reason=None):
+ dry_run=False, reason=None, **kwargs):
"""Reboots an instance.
@type instance: str
"""
query = []
+ body = kwargs
+
_AppendDryRunIf(query, dry_run)
_AppendIf(query, reboot_type, ("type", reboot_type))
_AppendIf(query, ignore_secondaries is not None,
return self._SendRequest(HTTP_POST,
("/%s/instances/%s/reboot" %
- (GANETI_RAPI_VERSION, instance)), query, None)
+ (GANETI_RAPI_VERSION, instance)), query, body)
def ShutdownInstance(self, instance, dry_run=False, no_remember=False,
reason=None, **kwargs):
"""
assert len(self.items) == 1
- return ({}, {
+ return (self.request_body, {
"instance_name": self.items[0],
"ignore_failures": False,
"dry_run": self.dryRun(),
ignore_secondaries=[False|True] parameters.
"""
- return ({}, {
+ return (self.request_body, {
"instance_name": self.items[0],
"reboot_type":
self.queryargs.get("type", [constants.INSTANCE_REBOOT_HARD])[0],