diff options
author | Jenkins <jenkins@review.openstack.org> | 2014-06-24 08:41:06 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2014-06-24 08:41:06 +0000 |
commit | cba9568e958d49a6863a21ff9235809342d22d91 (patch) | |
tree | 0e2e0fda5b5704d47e776bd5692957b444d33bf3 | |
parent | 792431c5bbe6275d100e6d73ef07218061da5b69 (diff) | |
parent | 258b47b2a06915d17079a57a4243a8141ee50d71 (diff) | |
download | python-troveclient-cba9568e958d49a6863a21ff9235809342d22d91.tar.gz |
Merge "Add 'slave_of' option for enabling replication"
-rw-r--r-- | troveclient/v1/instances.py | 5 | ||||
-rw-r--r-- | troveclient/v1/shell.py | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/troveclient/v1/instances.py b/troveclient/v1/instances.py index 1b53ccb..aef6da4 100644 --- a/troveclient/v1/instances.py +++ b/troveclient/v1/instances.py @@ -45,7 +45,8 @@ class Instances(base.ManagerWithFind): def create(self, name, flavor_id, volume=None, databases=None, users=None, restorePoint=None, availability_zone=None, datastore=None, - datastore_version=None, nics=None, configuration=None): + datastore_version=None, nics=None, configuration=None, + slave_of=None): """Create (boot) a new instance.""" body = {"instance": { "name": name, @@ -72,6 +73,8 @@ class Instances(base.ManagerWithFind): body["instance"]["nics"] = nics if configuration: body["instance"]["configuration"] = configuration + if slave_of: + body["instance"]["slave_of"] = slave_of return self._create("/instances", body, "instance") diff --git a/troveclient/v1/shell.py b/troveclient/v1/shell.py index 899780f..d78f670 100644 --- a/troveclient/v1/shell.py +++ b/troveclient/v1/shell.py @@ -224,6 +224,10 @@ def do_update(cs, args): metavar='<configuration>', default=None, help='ID of the configuration group to attach to the instance.') +@utils.arg('--slave_of', + metavar='<master_id>', + default=None, + help='ID of an existing instance to replicate from.') @utils.service_type('database') def do_create(cs, args): """Creates a new instance.""" @@ -257,7 +261,8 @@ def do_create(cs, args): datastore=args.datastore, datastore_version=args.datastore_version, nics=nics, - configuration=args.configuration) + configuration=args.configuration, + slave_of=args.slave_of) if hasattr(instance, 'configuration'): instance._info['configuration'] = instance.configuration['id'] instance._info['flavor'] = instance.flavor['id'] |