Commit b8481ebf authored by Guido Trotter's avatar Guido Trotter
Browse files

rapi client: accept arbitrary shutdown arguments

The "ignore_offline_nodes" parameter is unsupported. Rather than
explicitely adding it, just pass all keyword arguments in the body of
the query, and rapi on the other side will do the right thing.

Supports for old arguments that were passed via the query is unchanged.
Signed-off-by: default avatarGuido Trotter <>
Reviewed-by: default avatarIustin Pop <>
parent 1b9690aa
......@@ -923,7 +923,8 @@ class GanetiRapiClient(object): # pylint: disable=R0904
("/%s/instances/%s/reboot" %
(GANETI_RAPI_VERSION, instance)), query, None)
def ShutdownInstance(self, instance, dry_run=False, no_remember=False):
def ShutdownInstance(self, instance, dry_run=False, no_remember=False,
"""Shuts down an instance.
@type instance: str
......@@ -937,12 +938,14 @@ class GanetiRapiClient(object): # pylint: disable=R0904
query = []
body = kwargs
_AppendDryRunIf(query, dry_run)
_AppendIf(query, no_remember, ("no-remember", 1))
return self._SendRequest(HTTP_PUT,
("/%s/instances/%s/shutdown" %
(GANETI_RAPI_VERSION, instance)), query, None)
(GANETI_RAPI_VERSION, instance)), query, body)
def StartupInstance(self, instance, dry_run=False, no_remember=False):
"""Starts up an instance.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment