diff --git a/troveclient/v1/instances.py b/troveclient/v1/instances.py index ab33686b..f667654b 100644 --- a/troveclient/v1/instances.py +++ b/troveclient/v1/instances.py @@ -94,11 +94,16 @@ class Instances(base.ManagerWithFind): common.check_for_exceptions(resp, body, url) def edit(self, instance_id, configuration=None, name=None, - detach_replica_source=False): + detach_replica_source=False, remove_configuration=False): body = { "instance": { } } + if configuration and remove_configuration: + raise Exception("Cannot attach and detach configuration " + "simultaneosly.") + if remove_configuration: + body["instance"]["configuration"] = None if configuration is not None: body["instance"]["configuration"] = configuration if name is not None: diff --git a/troveclient/v1/shell.py b/troveclient/v1/shell.py index 595f4b55..a33b1456 100644 --- a/troveclient/v1/shell.py +++ b/troveclient/v1/shell.py @@ -184,12 +184,17 @@ def do_delete(cs, args): dest='detach_replica_source', action="store_true", default=False, - help='Detach the replica instance from its replication source .') + help='Detach the replica instance from its replication source.') +@utils.arg('--remove_configuration', + dest='remove_configuration', + action="store_true", + default=False, + help='Drops the current configuration reference.') @utils.service_type('database') def do_update(cs, args): """Updates an instance: Edits name, configuration, or replica source.""" cs.instances.edit(args.instance, args.configuration, args.name, - args.detach_replica_source) + args.detach_replica_source, args.remove_configuration) @utils.arg('name',