Jump to: navigation, search

Trove/add-configuration-copy-command

Description

This enhancement is to add a new "configuration-copy" command.

Justification/Benefits

Creating a configuration group from the CLI is complicated and error prone due to entering values as a JSON formatted string.

In many situations the user will want to have multiple 'similar' but slightly different configuration groups - so being able to copy an existing group and then tweak it will save time and frustration.

Impacts

Configuration

No changes.

Database

No changes.

Public API

No changes.

CLI interface

The configuration-copy command will perform the following operations.

  1. Use the existing _get() method to obtain the source configuration.
  2. The body of the new configuration will be initialized with the source configuration values, datastore type and datastore version.along with the new configuration name and description.
  3. The body will passed to the existing _create() method to create the new configuration.
  4. The new configuration will be returned to the caller.


An example of the usage follows:

vbox@vmw-1:~/dev/trove-integration/scripts$ trove configuration-copy 03511d07-3865-4501-9e08-98b39facd9b1 testconfig2 --description "A new description"
+------------------------+-----------------------------------------------------------------------+
| Property               | Value                                                                 |
+------------------------+-----------------------------------------------------------------------+
| created                | 2014-08-14T14:46:44                                                   |
| datastore_name         | mysql                                                                 |
| datastore_version_id   | 7c096179-c977-4720-a802-914cfcf2dd44                                  |
| datastore_version_name | 5.5                                                                   |
| description            | A new description                                                     |
| id                     | be25c796-c55d-40c4-a858-9e3eb599376a                                  |
| instance_count         | 0                                                                     |
| name                   | testconfig2                                                           |
| updated                | 2014-08-14T14:46:44                                                   |
| values                 | {u'collation_server': u'latin1_swedish_ci', u'max_connections': 5000} |
+------------------------+-----------------------------------------------------------------------+
Help

The help for the configuration-copy command will appear as follows:

usage: trove configuration-copy <configuration_group> <name> [--description <description>]
Copies an existing configuration group.
Positional arguments:
  <configuration_group>        ID of the source configuration group.
  <name>                       Name of the new configuration group.
Optional arguments:
  --description <description>  An optional description for the new configuration group.


ReST Part

No changes.

Internal API

No changes.

RPC API description

No changes.

Guest Agent

No changes.