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
This commit is contained in:
parent
68a6424256
commit
0462bad1d8
|
@ -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"
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue