summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Chang <schang@tesora.com>2014-06-02 15:20:35 -0400
committerSimon Chang <schang@tesora.com>2014-06-02 17:22:12 -0400
commit0462bad1d8253c7e3057698edd982661e23df254 (patch)
treede52443e67f14e9143434c08410da3b5cbd43147
parent68a6424256b0053fe554c1cf2101e95d60fe1c14 (diff)
downloadpython-troveclient-0462bad1d8253c7e3057698edd982661e23df254.tar.gz
Rename resize-flavor subcommand to resize-instance
The trove resize-flavor <instance> <flavor_id> subcommand actually changes the flavor of an instance, not the size of the flavor itself. To improve clarity, the resize-flavor subcommand was renamed as resize-instance. To avoid backward compatibility issues, marked deprecated the resize-flavor subcommand while we introduce the new resize-instance subcommand. DocImpact: This potentially affects any user scripts that may exist. Any instructions like: 'trove resize-flavor <instance> <flavor_id>' should be changed to: 'trove resize-instance <instance> <flavor_id>' Change-Id: Ie801d5632383b67c3f777487f4b6bc608b4a69e8 Closes-Bug: #1324719
-rw-r--r--troveclient/v1/instances.py5
-rw-r--r--troveclient/v1/shell.py17
2 files changed, 16 insertions, 6 deletions
diff --git a/troveclient/v1/instances.py b/troveclient/v1/instances.py
index ea0fae5..1b53ccb 100644
--- a/troveclient/v1/instances.py
+++ b/troveclient/v1/instances.py
@@ -147,7 +147,7 @@ class Instances(base.ManagerWithFind):
self._action(instance_id, body)
def resize_instance(self, instance_id, flavor_id):
- """Resize the volume on an existing instances."""
+ """Resizes an instance with a new flavor."""
body = {"resize": {"flavorRef": flavor_id}}
self._action(instance_id, body)
@@ -168,9 +168,6 @@ class Instances(base.ManagerWithFind):
"instance")
-Instances.resize_flavor = Instances.resize_instance
-
-
class InstanceStatus(object):
ACTIVE = "ACTIVE"
diff --git a/troveclient/v1/shell.py b/troveclient/v1/shell.py
index 75f9127..5f2658a 100644
--- a/troveclient/v1/shell.py
+++ b/troveclient/v1/shell.py
@@ -273,8 +273,21 @@ def do_create(cs, args):
help='New flavor of the instance.')
@utils.service_type('database')
def do_resize_flavor(cs, args):
- """Resizes the flavor of an instance."""
- cs.instances.resize_flavor(args.instance, args.flavor_id)
+ """[DEPRECATED] Please use resize-instance instead."""
+ do_resize_instance(cs, args)
+
+
+@utils.arg('instance',
+ metavar='<instance>',
+ type=str,
+ help='ID of the instance.')
+@utils.arg('flavor_id',
+ metavar='<flavor_id>',
+ help='New flavor of the instance.')
+@utils.service_type('database')
+def do_resize_instance(cs, args):
+ """Resizes an instance with a new flavor."""
+ cs.instances.resize_instance(args.instance, args.flavor_id)
@utils.arg('instance',