---
lib/rapi/client.py | 14 +++++++++++---
lib/rapi/rlib2.py | 8 ++++++--
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/lib/rapi/client.py b/lib/rapi/client.py
index cb43784..eb30794 100644
--- a/lib/rapi/client.py
+++ b/lib/rapi/client.py
@@ -1,7 +1,7 @@
#
#
-# Copyright (C) 2010 Google Inc.
+# Copyright (C) 2010, 2011 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -908,35 +908,43 @@ class GanetiRapiClient(object): # pylint:
disable-msg=R0904
("/%s/instances/%s/reboot" %
(GANETI_RAPI_VERSION, instance)), query, None)
- def ShutdownInstance(self, instance, dry_run=False):
+ def ShutdownInstance(self, instance, dry_run=False, no_remember=False):
"""Shuts down an instance.
@type instance: str
@param instance: the instance to shut down
@type dry_run: bool
@param dry_run: whether to perform a dry run
+ @type no_remember: bool
+ @param no_remember: if true, will not record the state change
"""
query = []
if dry_run:
query.append(("dry-run", 1))
+ if no_remember:
+ query.append(("no-remember", 1))
return self._SendRequest(HTTP_PUT,
("/%s/instances/%s/shutdown" %
(GANETI_RAPI_VERSION, instance)), query, None)
- def StartupInstance(self, instance, dry_run=False):
+ def StartupInstance(self, instance, dry_run=False, no_remember=False):
"""Starts up an instance.
@type instance: str
@param instance: the instance to start up
@type dry_run: bool
@param dry_run: whether to perform a dry run
+ @type no_remember: bool
+ @param no_remember: if true, will not record the state change
"""
query = []
if dry_run:
query.append(("dry-run", 1))
+ if no_remember:
+ query.append(("no-remember", 1))
return self._SendRequest(HTTP_PUT,
("/%s/instances/%s/startup" %
diff --git a/lib/rapi/rlib2.py b/lib/rapi/rlib2.py
index db5fcb9..61ff6b7 100644
--- a/lib/rapi/rlib2.py
+++ b/lib/rapi/rlib2.py
@@ -995,9 +995,11 @@ class R_2_instances_name_startup(baserlib.R_Generic):
"""
instance_name = self.items[0]
force_startup = bool(self._checkIntVariable('force'))
+ no_remember = bool(self._checkIntVariable('no_remember'))
op = opcodes.OpInstanceStartup(instance_name=instance_name,
force=force_startup,
- dry_run=bool(self.dryRun()))
+ dry_run=bool(self.dryRun()),
+ no_remember=no_remember)
return baserlib.SubmitJob([op])
@@ -1013,8 +1015,10 @@ class R_2_instances_name_shutdown(baserlib.R_Generic):
"""
instance_name = self.items[0]
+ no_remember = bool(self._checkIntVariable('no_remember'))
op = opcodes.OpInstanceShutdown(instance_name=instance_name,
- dry_run=bool(self.dryRun()))
+ dry_run=bool(self.dryRun()),
+ no_remember=no_remember)
return baserlib.SubmitJob([op])
--
1.7.3.1