summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLingxian Kong <anlin.kong@gmail.com>2020-04-18 23:25:26 +1200
committerLingxian Kong <anlin.kong@gmail.com>2020-05-08 00:30:49 -0600
commit27cf71299ec51976fed8b18dbf5c0e4f9f4fd6f5 (patch)
tree26d3c9ca4be03b57eebccb0cbed5c8bac961cf6f
parent4b47eb6f7f8767331411c0323abee1c4a22cf684 (diff)
downloadpython-troveclient-27cf71299ec51976fed8b18dbf5c0e4f9f4fd6f5.tar.gz
Remove flavor API
Change-Id: I5a35911b5658fdf6bc08844b31cc1325b749526a
-rw-r--r--doc/source/cli/index.rst3
-rw-r--r--doc/source/cli/trove.rst2924
-rw-r--r--doc/source/index.rst4
-rw-r--r--doc/source/user/index.rst53
-rw-r--r--setup.cfg2
-rw-r--r--troveclient/compat/__init__.py2
-rw-r--r--troveclient/compat/cli.py11
-rw-r--r--troveclient/compat/client.py3
-rw-r--r--troveclient/compat/mcli.py26
-rw-r--r--troveclient/osc/v1/database_flavors.py97
-rw-r--r--troveclient/osc/v1/database_instances.py6
-rw-r--r--troveclient/tests/osc/v1/fakes.py8
-rw-r--r--troveclient/tests/osc/v1/test_database_flavors.py78
-rw-r--r--troveclient/tests/osc/v1/test_database_instances.py2
-rw-r--r--troveclient/tests/test_management.py32
-rw-r--r--troveclient/tests/test_v1_shell.py59
-rw-r--r--troveclient/v1/client.py2
-rw-r--r--troveclient/v1/flavors.py58
-rw-r--r--troveclient/v1/management.py39
-rw-r--r--troveclient/v1/shell.py56
20 files changed, 34 insertions, 3431 deletions
diff --git a/doc/source/cli/index.rst b/doc/source/cli/index.rst
deleted file mode 100644
index a407afd..0000000
--- a/doc/source/cli/index.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-.. toctree::
-
- trove.rst
diff --git a/doc/source/cli/trove.rst b/doc/source/cli/trove.rst
deleted file mode 100644
index 84c52a5..0000000
--- a/doc/source/cli/trove.rst
+++ /dev/null
@@ -1,2924 +0,0 @@
-.. ###################################################
-.. ## WARNING ######################################
-.. ############## WARNING ##########################
-.. ########################## WARNING ##############
-.. ###################################### WARNING ##
-.. ###################################################
-.. ###################################################
-.. ##
-.. This file is tool-generated. Do not edit manually.
-.. http://docs.openstack.org/contributor-guide/
-.. doc-tools/cli-reference.html
-.. ##
-.. ## WARNING ######################################
-.. ############## WARNING ##########################
-.. ########################## WARNING ##############
-.. ###################################### WARNING ##
-.. ###################################################
-
-============================================
-Database service (trove) command-line client
-============================================
-
-The trove client is the command-line interface (CLI) for
-the Database service (trove) API and its extensions.
-
-This chapter documents :command:`trove` version ``2.10.0``.
-
-For help on a specific :command:`trove` command, enter:
-
-.. code-block:: console
-
- $ trove help COMMAND
-
-.. _trove_command_usage:
-
-trove usage
-~~~~~~~~~~~
-
-.. code-block:: console
-
- usage: trove [--version] [--debug] [--service-type <service-type>]
- [--service-name <service-name>] [--bypass-url <bypass-url>]
- [--database-service-name <database-service-name>]
- [--endpoint-type <endpoint-type>]
- [--os-database-api-version <database-api-ver>]
- [--retries <retries>] [--json] [--profile HMAC_KEY] [--insecure]
- [--os-cacert <ca-certificate>] [--os-cert <certificate>]
- [--os-key <key>] [--timeout <seconds>] [--os-auth-type <name>]
- [--os-auth-url OS_AUTH_URL] [--os-domain-id OS_DOMAIN_ID]
- [--os-domain-name OS_DOMAIN_NAME] [--os-project-id OS_PROJECT_ID]
- [--os-project-name OS_PROJECT_NAME]
- [--os-project-domain-id OS_PROJECT_DOMAIN_ID]
- [--os-project-domain-name OS_PROJECT_DOMAIN_NAME]
- [--os-trust-id OS_TRUST_ID]
- [--os-default-domain-id OS_DEFAULT_DOMAIN_ID]
- [--os-default-domain-name OS_DEFAULT_DOMAIN_NAME]
- [--os-user-id OS_USER_ID] [--os-username OS_USERNAME]
- [--os-user-domain-id OS_USER_DOMAIN_ID]
- [--os-user-domain-name OS_USER_DOMAIN_NAME]
- [--os-password OS_PASSWORD] [--os-region-name <region-name>]
- <subcommand> ...
-
-**Subcommands:**
-
-``backup-copy``
- Creates a backup from another backup.
-
-``backup-create``
- Creates a backup of an instance.
-
-``backup-delete``
- Deletes a backup.
-
-``backup-list``
- Lists available backups.
-
-``backup-list-instance``
- Lists available backups for an instance.
-
-``backup-show``
- Shows details of a backup.
-
-``cluster-create``
- Creates a new cluster.
-
-``cluster-delete``
- Deletes a cluster.
-
-``cluster-force-delete``
- Force delete a cluster
-
-``cluster-grow``
- Adds more instances to a cluster.
-
-``cluster-instances``
- Lists all instances of a cluster.
-
-``cluster-list``
- Lists all the clusters.
-
-``cluster-modules``
- Lists all modules for each instance of a
- cluster.
-
-``cluster-reset-status``
- Set the cluster task to NONE.
-
-``cluster-show``
- Shows details of a cluster.
-
-``cluster-shrink``
- Drops instances from a cluster.
-
-``cluster-upgrade``
- Upgrades a cluster to a new datastore
- version.
-
-``configuration-attach``
- Attaches a configuration group to an
- instance.
-
-``configuration-create``
- Creates a configuration group.
-
-``configuration-default``
- Shows the default configuration of an
- instance.
-
-``configuration-delete``
- Deletes a configuration group.
-
-``configuration-detach``
- Detaches a configuration group from an
- instance.
-
-``configuration-instances``
- Lists all instances associated with a
- configuration group.
-
-``configuration-list``
- Lists all configuration groups.
-
-``configuration-parameter-list``
- Lists available parameters for a
- configuration group.
-
-``configuration-parameter-show``
- Shows details of a configuration parameter.
-
-``configuration-patch``
- Patches a configuration group.
-
-``configuration-show``
- Shows details of a configuration group.
-
-``configuration-update``
- Updates a configuration group.
-
-``create``
- Creates a new instance.
-
-``database-create``
- Creates a database on an instance.
-
-``database-delete``
- Deletes a database from an instance.
-
-``database-list``
- Lists available databases on an instance.
-
-``datastore-list``
- Lists available datastores.
-
-``datastore-show``
- Shows details of a datastore.
-
-``datastore-version-list``
- Lists available versions for a datastore.
-
-``datastore-version-show``
- Shows details of a datastore version.
-
-``delete``
- Deletes an instance.
-
-``detach-replica``
- Detaches a replica instance from its
- replication source.
-
-``eject-replica-source``
- Ejects a replica source from its set.
-
-``execution-delete``
- Deletes an execution.
-
-``execution-list``
- Lists executions of a scheduled backup of an
- instance.
-
-``flavor-list``
- Lists available flavors.
-
-``flavor-show``
- Shows details of a flavor.
-
-``force-delete``
- Force delete an instance.
-
-``limit-list``
- Lists the limits for a tenant.
-
-``list``
- Lists all the instances.
-
-``log-disable``
- Instructs Trove guest to stop collecting log
- details.
-
-``log-discard``
- Instructs Trove guest to discard the
- container of the published log.
-
-``log-enable``
- Instructs Trove guest to start collecting
- log details.
-
-``log-list``
- Lists the log files available for instance.
-
-``log-publish``
- Instructs Trove guest to publish latest log
- entries on instance.
-
-``log-save``
- Save log file for instance.
-
-``log-show``
- Instructs Trove guest to show details of
- log.
-
-``log-tail``
- Display log entries for instance.
-
-``metadata-create``
- Creates metadata in the database for
- instance <id>.
-
-``metadata-delete``
- Deletes metadata for instance <id>.
-
-``metadata-edit``
- Replaces metadata value with a new one, this
- is non-destructive.
-
-``metadata-list``
- Shows all metadata for instance <id>.
-
-``metadata-show``
- Shows metadata entry for key <key> and
- instance <id>.
-
-``metadata-update``
- Updates metadata, this is destructive.
-
-``module-apply``
- Apply modules to an instance.
-
-``module-create``
- Create a module.
-
-``module-delete``
- Delete a module.
-
-``module-instance-count``
- Lists a count of the instances for each
- module md5.
-
-``module-instances``
- Lists the instances that have a particular
- module applied.
-
-``module-list``
- Lists the modules available.
-
-``module-list-instance``
- Lists the modules that have been applied to
- an instance.
-
-``module-query``
- Query the status of the modules on an
- instance.
-
-``module-reapply``
- Reapply a module.
-
-``module-remove``
- Remove a module from an instance.
-
-``module-retrieve``
- Retrieve module contents from an instance.
-
-``module-show``
- Shows details of a module.
-
-``module-update``
- Update a module.
-
-``promote-to-replica-source``
- Promotes a replica to be the new replica
- source of its set.
-
-``quota-show``
- Show quotas for a tenant.
-
-``quota-update``
- Update quotas for a tenant.
-
-``reset-status``
- Set the status to NONE.
-
-``resize-instance``
- Resizes an instance with a new flavor.
-
-``resize-volume``
- Resizes the volume size of an instance.
-
-``restart``
- Restarts an instance.
-
-``root-disable``
- Disables root for an instance.
-
-``root-enable``
- Enables root for an instance and resets if
- already exists.
-
-``root-show``
- Gets status if root was ever enabled for an
- instance or cluster.
-
-``schedule-create``
- Schedules backups for an instance.
-
-``schedule-delete``
- Deletes a schedule.
-
-``schedule-list``
- Lists scheduled backups for an instance.
-
-``schedule-show``
- Shows details of a schedule.
-
-``secgroup-add-rule``
- Creates a security group rule.
-
-``secgroup-delete-rule``
- Deletes a security group rule.
-
-``secgroup-list``
- Lists all security groups.
-
-``secgroup-list-rules``
- Lists all rules for a security group.
-
-``secgroup-show``
- Shows details of a security group.
-
-``show``
- Shows details of an instance.
-
-``update``
- Updates an instance: Edits name,
- configuration, or replica source.
-
-``upgrade``
- Upgrades an instance to a new datastore
- version.
-
-``user-create``
- Creates a user on an instance.
-
-``user-delete``
- Deletes a user from an instance.
-
-``user-grant-access``
- Grants access to a database(s) for a user.
-
-``user-list``
- Lists the users for an instance.
-
-``user-revoke-access``
- Revokes access to a database for a user.
-
-``user-show``
- Shows details of a user of an instance.
-
-``user-show-access``
- Shows access details of a user of an
- instance.
-
-``user-update-attributes``
- Updates a user's attributes on an instance.
-
-``volume-type-list``
- Lists available volume types.
-
-``volume-type-show``
- Shows details of a volume type.
-
-``bash-completion``
- Prints arguments for bash_completion.
-
-``help``
- Displays help about this program or one of
- its subcommands.
-
-.. _trove_command_options:
-
-trove optional arguments
-~~~~~~~~~~~~~~~~~~~~~~~~
-
-``--version``
- Show program's version number and exit.
-
-``--debug``
- Print debugging output.
-
-``--service-type <service-type>``
- Defaults to database for most actions.
-
-``--service-name <service-name>``
- Defaults to ``env[TROVE_SERVICE_NAME]``.
-
-``--bypass-url <bypass-url>``
- Defaults to ``env[TROVE_BYPASS_URL]``.
-
-``--database-service-name <database-service-name>``
- Defaults to
- ``env[TROVE_DATABASE_SERVICE_NAME]``.
-
-``--endpoint-type <endpoint-type>``
- Defaults to ``env[TROVE_ENDPOINT_TYPE]`` or
- ``env[OS_ENDPOINT_TYPE]`` or publicURL.
-
-``--os-database-api-version <database-api-ver>``
- Accepts 1, defaults to
- ``env[OS_DATABASE_API_VERSION]``.
-
-``--retries <retries>``
- Number of retries.
-
-``--json, --os-json-output``
- Output JSON instead of prettyprint. Defaults
- to ``env[OS_JSON_OUTPUT]``.
-
-``--profile HMAC_KEY``
- HMAC key used to encrypt context data when
- profiling the performance of an operation.
- This key should be set to one of the HMAC
- keys configured in Trove (they are found in
- api-paste.ini, typically in /etc/trove).
- Without the key, profiling will not be
- triggered even if it is enabled on the
- server side. Defaults to
- ``env[OS_PROFILE_HMACKEY]``.
-
-``--os-auth-type <name>, --os-auth-plugin <name>``
- Authentication type to use
-
-``--os-region-name <region-name>``
- Specify the region to use. Defaults to
- ``env[OS_REGION_NAME]``.
-
-.. _trove_backup-copy:
-
-trove backup-copy
------------------
-
-.. code-block:: console
-
- usage: trove backup-copy [--description <description>] <name> <backup>
-
-Creates a backup from another backup.
-
-**Positional arguments:**
-
-``<name>``
- Name of the backup.
-
-``<backup>``
- Backup ID of the source backup.
-
-**Optional arguments:**
-
-``--description <description>``
- An optional description for the backup.
-
-.. _trove_backup-create:
-
-trove backup-create
--------------------
-
-.. code-block:: console
-
- usage: trove backup-create <instance> <name>
- [--description <description>] [--parent <parent>]
- [--incremental]
-
-Creates a backup of an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-``<name>``
- Name of the backup.
-
-**Optional arguments:**
-
-``--description <description>``
- An optional description for the backup.
-
-``--parent <parent>``
- Optional ID of the parent backup to perform an
- incremental backup from.
-
-``--incremental``
- Create an incremental backup based on the last
- full or incremental backup. It will create a
- full backup if no existing backup found.
-
-.. _trove_backup-delete:
-
-trove backup-delete
--------------------
-
-.. code-block:: console
-
- usage: trove backup-delete <backup>
-
-Deletes a backup.
-
-**Positional arguments:**
-
-``<backup>``
- ID or name of the backup.
-
-.. _trove_backup-list:
-
-trove backup-list
------------------
-
-.. code-block:: console
-
- usage: trove backup-list [--limit <limit>] [--marker <ID>]
- [--datastore <datastore>]
-
-Lists available backups.
-
-**Optional arguments:**
-
-``--limit <limit>``
- Return up to N number of the most recent backups.
-
-``--marker <ID>``
- Begin displaying the results for IDs greater than
- the specified marker. When used with --limit, set
- this to the last ID displayed in the previous run.
-
-``--datastore <datastore>``
- ID or name of the datastore (to filter backups by).
-
-.. _trove_backup-list-instance:
-
-trove backup-list-instance
---------------------------
-
-.. code-block:: console
-
- usage: trove backup-list-instance [--limit <limit>] [--marker <ID>] <instance>
-
-Lists available backups for an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-**Optional arguments:**
-
-``--limit <limit>``
- Return up to N number of the most recent backups.
-
-``--marker <ID>``
- Begin displaying the results for IDs greater than the
- specified marker. When used with --limit, set this to the
- last ID displayed in the previous run.
-
-.. _trove_backup-show:
-
-trove backup-show
------------------
-
-.. code-block:: console
-
- usage: trove backup-show <backup>
-
-Shows details of a backup.
-
-**Positional arguments:**
-
-``<backup>``
- ID or name of the backup.
-
-.. _trove_cluster-create:
-
-trove cluster-create
---------------------
-
-.. code-block:: console
-
- usage: trove cluster-create <name> <datastore> <datastore_version>
- [--instance "opt=<value>[,opt=<value> ...] "]
- [--locality <policy>]
-
-Creates a new cluster.
-
-**Positional arguments:**
-
-``<name>``
- Name of the cluster.
-
-``<datastore>``
- A datastore name or ID.
-
-``<datastore_version>``
- A datastore version name or ID.
-
-**Optional arguments:**
-
-``--instance "opt=<value>[,opt=<value> ...] "``
- Add an instance to the cluster. Specify
- multiple times to create multiple instances.
- Valid options are:
- flavor=<flavor_name_or_id>,
- volume=<disk_size_in_GB>,
- volume_type=<type>, nic='<net-id=<net-uuid>,
- v4-fixed-ip=<ip-addr>, port-id=<port-uuid>>'
- (where net-id=network_id, v4-fixed-ip=IPv4r_fixed_address, port-id=port_id),
- availability_zone=<AZ_hint_for_Nova>,
- module=<module_name_or_id>,
- type=<type_of_cluster_node>.
-
-``--locality <policy>``
- Locality policy to use when creating
- cluster. Choose one of affinity, anti-affinity.
-
-.. _trove_cluster-delete:
-
-trove cluster-delete
---------------------
-
-.. code-block:: console
-
- usage: trove cluster-delete <cluster>
-
-Deletes a cluster.
-
-**Positional arguments:**
-
-``<cluster>``
- ID or name of the cluster.
-
-.. _trove_cluster-force-delete:
-
-trove cluster-force-delete
---------------------------
-
-.. code-block:: console
-
- usage: trove cluster-force-delete <cluster>
-
-Force delete a cluster
-
-**Positional arguments:**
-
-``<cluster>``
- ID or name of the cluster.
-
-.. _trove_cluster-grow:
-
-trove cluster-grow
-------------------
-
-.. code-block:: console
-
- usage: trove cluster-grow <cluster>
- [--instance "opt=<value>[,opt=<value> ...] "]
-
-Adds more instances to a cluster.
-
-**Positional arguments:**
-
-``<cluster>``
- ID or name of the cluster.
-
-**Optional arguments:**
-
-``--instance "opt=<value>[,opt=<value> ...] "``
- Add an instance to the cluster. Specify
- multiple times to create multiple instances.
- Valid options are:
- flavor=<flavor_name_or_id>,
- volume=<disk_size_in_GB>,
- volume_type=<type>, nic='<net-id=<net-uuid>,
- v4-fixed-ip=<ip-addr>, port-id=<port-uuid>>'
- (where net-id=network_id, v4-fixed-ip=IPv4r_fixed_address, port-id=port_id),
- availability_zone=<AZ_hint_for_Nova>,
- module=<module_name_or_id>,
- type=<type_of_cluster_node>.
-
-.. _trove_cluster-instances:
-
-trove cluster-instances
------------------------
-
-.. code-block:: console
-
- usage: trove cluster-instances <cluster>
-
-Lists all instances of a cluster.
-
-**Positional arguments:**
-
-``<cluster>``
- ID or name of the cluster.
-
-.. _trove_cluster-list:
-
-trove cluster-list
-------------------
-
-.. code-block:: console
-
- usage: trove cluster-list [--limit <limit>] [--marker <ID>]
-
-Lists all the clusters.
-
-**Optional arguments:**
-
-``--limit <limit>``
- Limit the number of results displayed.
-
-``--marker <ID>``
- Begin displaying the results for IDs greater than the
- specified marker. When used with --limit, set this to the
- last ID displayed in the previous run.
-
-.. _trove_cluster-modules:
-
-trove cluster-modules
----------------------
-
-.. code-block:: console
-
- usage: trove cluster-modules <cluster>
-
-Lists all modules for each instance of a cluster.
-
-**Positional arguments:**
-
-``<cluster>``
- ID or name of the cluster.
-
-.. _trove_cluster-reset-status:
-
-trove cluster-reset-status
---------------------------
-
-.. code-block:: console
-
- usage: trove cluster-reset-status <cluster>
-
-Set the cluster task to NONE.
-
-**Positional arguments:**
-
-``<cluster>``
- ID or name of the cluster.
-
-.. _trove_cluster-show:
-
-trove cluster-show
-------------------
-
-.. code-block:: console
-
- usage: trove cluster-show <cluster>
-
-Shows details of a cluster.
-
-**Positional arguments:**
-
-``<cluster>``
- ID or name of the cluster.
-
-.. _trove_cluster-shrink:
-
-trove cluster-shrink
---------------------
-
-.. code-block:: console
-
- usage: trove cluster-shrink <cluster> <instance> [<instance> ...]
-
-Drops instances from a cluster.
-
-**Positional arguments:**
-
-``<cluster>``
- ID or name of the cluster.
-
-``<instance>``
- Drop instance(s) from the cluster. Specify multiple ids to drop
- multiple instances.
-
-.. _trove_cluster-upgrade:
-
-trove cluster-upgrade
----------------------
-
-.. code-block:: console
-
- usage: trove cluster-upgrade <cluster> <datastore_version>
-
-Upgrades a cluster to a new datastore version.
-
-**Positional arguments:**
-
-``<cluster>``
- ID or name of the cluster.
-
-``<datastore_version>``
- A datastore version name or ID.
-
-.. _trove_configuration-attach:
-
-trove configuration-attach
---------------------------
-
-.. code-block:: console
-
- usage: trove configuration-attach <instance> <configuration>
-
-Attaches a configuration group to an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-``<configuration>``
- ID or name of the configuration group to attach to the
- instance.
-
-.. _trove_configuration-create:
-
-trove configuration-create
---------------------------
-
-.. code-block:: console
-
- usage: trove configuration-create <name> <values>
- [--datastore <datastore>]
- [--datastore_version <datastore_version>]
- [--description <description>]
-
-Creates a configuration group.
-
-**Positional arguments:**
-
-``<name>``
- Name of the configuration group.
-
-``<values>``
- Dictionary of the values to set.
-
-**Optional arguments:**
-
-``--datastore <datastore>``
- Datastore assigned to the configuration
- group. Required if default datastore is not
- configured.
-
-``--datastore_version <datastore_version>``
- Datastore version ID assigned to the
- configuration group.
-
-``--description <description>``
- An optional description for the
- configuration group.
-
-.. _trove_configuration-default:
-
-trove configuration-default
----------------------------
-
-.. code-block:: console
-
- usage: trove configuration-default <instance>
-
-Shows the default configuration of an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-.. _trove_configuration-delete:
-
-trove configuration-delete
---------------------------
-
-.. code-block:: console
-
- usage: trove configuration-delete <configuration_group>
-
-Deletes a configuration group.
-
-**Positional arguments:**
-
-``<configuration_group>``
- ID or name of the configuration group.
-
-.. _trove_configuration-detach:
-
-trove configuration-detach
---------------------------
-
-.. code-block:: console
-
- usage: trove configuration-detach <instance>
-
-Detaches a configuration group from an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-.. _trove_configuration-instances:
-
-trove configuration-instances
------------------------------
-
-.. code-block:: console
-
- usage: trove configuration-instances <configuration_group>
- [--limit <limit>] [--marker <ID>]
-
-Lists all instances associated with a configuration group.
-
-**Positional arguments:**
-
-``<configuration_group>``
- ID or name of the configuration group.
-
-**Optional arguments:**
-
-``--limit <limit>``
- Limit the number of results displayed.
-
-``--marker <ID>``
- Begin displaying the results for IDs greater than the
- specified marker. When used with --limit, set this to
- the last ID displayed in the previous run.
-
-.. _trove_configuration-list:
-
-trove configuration-list
-------------------------
-
-.. code-block:: console
-
- usage: trove configuration-list [--limit <limit>] [--marker <ID>]
-
-Lists all configuration groups.
-
-**Optional arguments:**
-
-``--limit <limit>``
- Limit the number of results displayed.
-
-``--marker <ID>``
- Begin displaying the results for IDs greater than the
- specified marker. When used with --limit, set this to the
- last ID displayed in the previous run.
-
-.. _trove_configuration-parameter-list:
-
-trove configuration-parameter-list
-----------------------------------
-
-.. code-block:: console
-
- usage: trove configuration-parameter-list <datastore_version>
- [--datastore <datastore>]
-
-Lists available parameters for a configuration group.
-
-**Positional arguments:**
-
-``<datastore_version>``
- Datastore version name or ID assigned to the
- configuration group.
-
-**Optional arguments:**
-
-``--datastore <datastore>``
- ID or name of the datastore to list configuration
- parameters for. Optional if the ID of the
- datastore_version is provided.
-
-.. _trove_configuration-parameter-show:
-
-trove configuration-parameter-show
-----------------------------------
-
-.. code-block:: console
-
- usage: trove configuration-parameter-show <datastore_version> <parameter>
- [--datastore <datastore>]
-
-Shows details of a configuration parameter.
-
-**Positional arguments:**
-
-``<datastore_version>``
- Datastore version name or ID assigned to the
- configuration group.
-
-``<parameter>``
- Name of the configuration parameter.
-
-**Optional arguments:**
-
-``--datastore <datastore>``
- ID or name of the datastore to list configuration
- parameters for. Optional if the ID of the
- datastore_version is provided.
-
-.. _trove_configuration-patch:
-
-trove configuration-patch
--------------------------
-
-.. code-block:: console
-
- usage: trove configuration-patch <configuration_group> <values>
-
-Patches a configuration group.
-
-**Positional arguments:**
-
-``<configuration_group>``
- ID or name of the configuration group.
-
-``<values>``
- Dictionary of the values to set.
-
-.. _trove_configuration-show:
-
-trove configuration-show
-------------------------
-
-.. code-block:: console
-
- usage: trove configuration-show <configuration_group>
-
-Shows details of a configuration group.
-
-**Positional arguments:**
-
-``<configuration_group>``
- ID or name of the configuration group.
-
-.. _trove_configuration-update:
-
-trove configuration-update
---------------------------
-
-.. code-block:: console
-
- usage: trove configuration-update <configuration_group> <values>
- [--name <name>]
- [--description <description>]
-
-Updates a configuration group.
-
-**Positional arguments:**
-
-``<configuration_group>``
- ID or name of the configuration group.
-
-``<values>``
- Dictionary of the values to set.
-
-**Optional arguments:**
-
-``--name <name>``
- Name of the configuration group.
-
-``--description <description>``
- An optional description for the configuration
- group.
-
-.. _trove_create:
-
-trove create
-------------
-
-.. code-block:: console
-
- usage: trove create <name> <flavor>
- [--size <size>] [--volume_type <volume_type>]
- [--databases <database> [<database> ...]]
- [--users <user:password> [<user:password> ...]]
- [--backup <backup>]
- [--availability_zone <availability_zone>]
- [--datastore <datastore>]
- [--datastore_version <datastore_version>]
- [--nic <net-id=<net-uuid>,v4-fixed-ip=<ip-addr>,port-id=<port-uuid>>]
- [--configuration <configuration>]
- [--replica_of <source_instance>] [--replica_count <count>]
- [--module <module>] [--locality <policy>]
-
-Creates a new instance.
-
-**Positional arguments:**
-
-``<name>``
- Name of the instance.
-
-``<flavor>``
- A flavor name or ID.
-
-**Optional arguments:**
-
-``--size <size>``
- Size of the instance disk volume in GB.
- Required when volume support is enabled.
-
-``--volume_type <volume_type>``
- Volume type. Optional when volume support is
- enabled.
-
-``--databases <database> [<database> ...]``
- Optional list of databases.
-
-``--users <user:password> [<user:password> ...]``
- Optional list of users.
-
-``--backup <backup>``
- A backup name or ID.
-
-``--availability_zone <availability_zone>``
- The Zone hint to give to Nova.
-
-``--datastore <datastore>``
- A datastore name or ID.
-
-``--datastore_version <datastore_version>``
- A datastore version name or ID.
-
-``--nic <net-id=<net-uuid>,v4-fixed-ip=<ip-addr>,port-id=<port-uuid>>``
- Create a NIC on the instance. Specify option
- multiple
- times
- to
- create
- multiple
- NICs.
- net-id:
- attach
- NIC
- to
- network
- with
- this
- ID
- (either port-id or net-id must be
- specified), v4-fixed-ip: IPv4 fixed address
- for NIC (optional), port-id: attach NIC to
- port with this ID (either port-id or net-id
- must be specified).
-
-``--configuration <configuration>``
- ID of the configuration group to attach to
- the instance.
-
-``--replica_of <source_instance>``
- ID or name of an existing instance to
- replicate from.
-
-``--replica_count <count>``
- Number of replicas to create (defaults to 1
- if replica_of specified).
-
-``--module <module>``
- ID or name of the module to apply. Specify
- multiple times to apply multiple modules.
-
-``--locality <policy>``
- Locality policy to use when creating
- replicas. Choose one of affinity, anti-affinity.
-
-.. _trove_database-create:
-
-trove database-create
----------------------
-
-.. code-block:: console
-
- usage: trove database-create <instance> <name>
- [--character_set <character_set>]
- [--collate <collate>]
-
-Creates a database on an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-``<name>``
- Name of the database.
-
-**Optional arguments:**
-
-``--character_set <character_set>``
- Optional character set for database.
-
-``--collate <collate>``
- Optional collation type for database.
-
-.. _trove_database-delete:
-
-trove database-delete
----------------------
-
-.. code-block:: console
-
- usage: trove database-delete <instance> <database>
-
-Deletes a database from an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-``<database>``
- Name of the database.
-
-.. _trove_database-list:
-
-trove database-list
--------------------
-
-.. code-block:: console
-
- usage: trove database-list <instance>
-
-Lists available databases on an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-.. _trove_datastore-list:
-
-trove datastore-list
---------------------
-
-.. code-block:: console
-
- usage: trove datastore-list
-
-Lists available datastores.
-
-.. _trove_datastore-show:
-
-trove datastore-show
---------------------
-
-.. code-block:: console
-
- usage: trove datastore-show <datastore>
-
-Shows details of a datastore.
-
-**Positional arguments:**
-
-``<datastore>``
- ID of the datastore.
-
-.. _trove_datastore-version-list:
-
-trove datastore-version-list
-----------------------------
-
-.. code-block:: console
-
- usage: trove datastore-version-list <datastore>
-
-Lists available versions for a datastore.
-
-**Positional arguments:**
-
-``<datastore>``
- ID or name of the datastore.
-
-.. _trove_datastore-version-show:
-
-trove datastore-version-show
-----------------------------
-
-.. code-block:: console
-
- usage: trove datastore-version-show <datastore_version>
- [--datastore <datastore>]
-
-Shows details of a datastore version.
-
-**Positional arguments:**
-
-``<datastore_version>``
- ID or name of the datastore version.
-
-**Optional arguments:**
-
-``--datastore <datastore>``
- ID or name of the datastore. Optional if the ID of
- the datastore_version is provided.
-
-.. _trove_delete:
-
-trove delete
-------------
-
-.. code-block:: console
-
- usage: trove delete <instance>
-
-Deletes an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-.. _trove_detach-replica:
-
-trove detach-replica
---------------------
-
-.. code-block:: console
-
- usage: trove detach-replica <instance>
-
-Detaches a replica instance from its replication source.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-.. _trove_eject-replica-source:
-
-trove eject-replica-source
---------------------------
-
-.. code-block:: console
-
- usage: trove eject-replica-source <instance>
-
-Ejects a replica source from its set.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-.. _trove_execution-delete:
-
-trove execution-delete
-----------------------
-
-.. code-block:: console
-
- usage: trove execution-delete <execution>
-
-Deletes an execution.
-
-**Positional arguments:**
-
-``<execution>``
- Id of the execution to delete.
-
-.. _trove_execution-list:
-
-trove execution-list
---------------------
-
-.. code-block:: console
-
- usage: trove execution-list [--limit <limit>] [--marker <ID>] <schedule id>
-
-Lists executions of a scheduled backup of an instance.
-
-**Positional arguments:**
-
-``<schedule id>``
- Id of the schedule.
-
-**Optional arguments:**
-
-``--limit <limit>``
- Return up to N number of the most recent executions.
-
-``--marker <ID>``
- Begin displaying the results for IDs greater than the
- specified marker. When used with --limit, set this to the
- last ID displayed in the previous run.
-
-.. _trove_flavor-list:
-
-trove flavor-list
------------------
-
-.. code-block:: console
-
- usage: trove flavor-list [--datastore_type <datastore_type>]
- [--datastore_version_id <datastore_version_id>]
-
-Lists available flavors.
-
-**Optional arguments:**
-
-``--datastore_type <datastore_type>``
- Type of the datastore. For eg: mysql.
-
-``--datastore_version_id <datastore_version_id>``
- ID of the datastore version.
-
-.. _trove_flavor-show:
-
-trove flavor-show
------------------
-
-.. code-block:: console
-
- usage: trove flavor-show <flavor>
-
-Shows details of a flavor.
-
-**Positional arguments:**
-
-``<flavor>``
- ID or name of the flavor.
-
-.. _trove_force-delete:
-
-trove force-delete
-------------------
-
-.. code-block:: console
-
- usage: trove force-delete <instance>
-
-Force delete an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-.. _trove_limit-list:
-
-trove limit-list
-----------------
-
-.. code-block:: console
-
- usage: trove limit-list
-
-Lists the limits for a tenant.
-
-.. _trove_list:
-
-trove list
-----------
-
-.. code-block:: console
-
- usage: trove list [--limit <limit>] [--marker <ID>] [--include_clustered]
-
-Lists all the instances.
-
-**Optional arguments:**
-
-``--limit <limit>``
- Limit the number of results displayed.
-
-``--marker <ID>``
- Begin displaying the results for IDs greater
- than the specified marker. When used with
- --limit, set this to the last ID displayed
- in the previous run.
-
-``--include_clustered, --include-clustered``
- Include instances that are part of a cluster
- (default False). --include-clustered may be
- deprecated in the future, retaining just
- --include_clustered.
-
-.. _trove_log-disable:
-
-trove log-disable
------------------
-
-.. code-block:: console
-
- usage: trove log-disable [--discard] <instance> <log_name>
-
-Instructs Trove guest to stop collecting log details.
-
-**Positional arguments:**
-
-``<instance>``
- Id or Name of the instance.
-
-``<log_name>``
- Name of log to publish.
-
-**Optional arguments:**
-
-``--discard``
- Discard published contents of specified log.
-
-.. _trove_log-discard:
-
-trove log-discard
------------------
-
-.. code-block:: console
-
- usage: trove log-discard <instance> <log_name>
-
-Instructs Trove guest to discard the container of the published log.
-
-**Positional arguments:**
-
-``<instance>``
- Id or Name of the instance.
-
-``<log_name>``
- Name of log to publish.
-
-.. _trove_log-enable:
-
-trove log-enable
-----------------
-
-.. code-block:: console
-
- usage: trove log-enable <instance> <log_name>
-
-Instructs Trove guest to start collecting log details.
-
-**Positional arguments:**
-
-``<instance>``
- Id or Name of the instance.
-
-``<log_name>``
- Name of log to publish.
-
-.. _trove_log-list:
-
-trove log-list
---------------
-
-.. code-block:: console
-
- usage: trove log-list <instance>
-
-Lists the log files available for instance.
-
-**Positional arguments:**
-
-``<instance>``
- Id or Name of the instance.
-
-.. _trove_log-publish:
-
-trove log-publish
------------------
-
-.. code-block:: console
-
- usage: trove log-publish [--disable] [--discard] <instance> <log_name>
-
-Instructs Trove guest to publish latest log entries on instance.
-
-**Positional arguments:**
-
-``<instance>``
- Id or Name of the instance.
-
-``<log_name>``
- Name of log to publish.
-
-**Optional arguments:**
-
-``--disable``
- Stop collection of specified log.
-
-``--discard``
- Discard published contents of specified log.
-
-.. _trove_log-save:
-
-trove log-save
---------------
-
-.. code-block:: console
-
- usage: trove log-save [--publish] [--file <file>] <instance> <log_name>
-
-Save log file for instance.
-
-**Positional arguments:**
-
-``<instance>``
- Id or Name of the instance.
-
-``<log_name>``
- Name of log to publish.
-
-**Optional arguments:**
-
-``--publish``
- Publish latest entries from guest before display.
-
-``--file <file>``
- Path of file to save log to for instance.
-
-.. _trove_log-show:
-
-trove log-show
---------------
-
-.. code-block:: console
-
- usage: trove log-show <instance> <log_name>
-
-Instructs Trove guest to show details of log.
-
-**Positional arguments:**
-
-``<instance>``
- Id or Name of the instance.
-
-``<log_name>``
- Name of log to show.
-
-.. _trove_log-tail:
-
-trove log-tail
---------------
-
-.. code-block:: console
-
- usage: trove log-tail [--publish] [--lines <lines>] <instance> <log_name>
-
-Display log entries for instance.
-
-**Positional arguments:**
-
-``<instance>``
- Id or Name of the instance.
-
-``<log_name>``
- Name of log to publish.
-
-**Optional arguments:**
-
-``--publish``
- Publish latest entries from guest before display.
-
-``--lines <lines>``
- Publish latest entries from guest before display.
-
-.. _trove_metadata-create:
-
-trove metadata-create
----------------------
-
-.. code-block:: console
-
- usage: trove metadata-create <instance_id> <key> <value>
-
-Creates metadata in the database for instance <id>.
-
-**Positional arguments:**
-
-``<instance_id>``
- UUID for instance.
-
-``<key>``
- Key for assignment.
-
-``<value>``
- Value to assign to <key>.
-
-.. _trove_metadata-delete:
-
-trove metadata-delete
----------------------
-
-.. code-block:: console
-
- usage: trove metadata-delete <instance_id> <key>
-
-Deletes metadata for instance <id>.
-
-**Positional arguments:**
-
-``<instance_id>``
- UUID for instance.
-
-``<key>``
- Metadata key to delete.
-
-.. _trove_metadata-edit:
-
-trove metadata-edit
--------------------
-
-.. code-block:: console
-
- usage: trove metadata-edit <instance_id> <key> <value>
-
-Replaces metadata value with a new one, this is non-destructive.
-
-**Positional arguments:**
-
-``<instance_id>``
- UUID for instance.
-
-``<key>``
- Key to replace.
-
-``<value>``
- New value to assign to <key>.
-
-.. _trove_metadata-list:
-
-trove metadata-list
--------------------
-
-.. code-block:: console
-
- usage: trove metadata-list <instance_id>
-
-Shows all metadata for instance <id>.
-
-**Positional arguments:**
-
-``<instance_id>``
- UUID for instance.
-
-.. _trove_metadata-show:
-
-trove metadata-show
--------------------
-
-.. code-block:: console
-
- usage: trove metadata-show <instance_id> <key>
-
-Shows metadata entry for key <key> and instance <id>.
-
-**Positional arguments:**
-
-``<instance_id>``
- UUID for instance.
-
-``<key>``
- Key to display.
-
-.. _trove_metadata-update:
-
-trove metadata-update
----------------------
-
-.. code-block:: console
-
- usage: trove metadata-update <instance_id> <key> <newkey> <value>
-
-Updates metadata, this is destructive.
-
-**Positional arguments:**
-
-``<instance_id>``
- UUID for instance.
-
-``<key>``
- Key to update.
-
-``<newkey>``
- New key.
-
-``<value>``
- Value to assign to <newkey>.
-
-.. _trove_module-apply:
-
-trove module-apply
-------------------
-
-.. code-block:: console
-
- usage: trove module-apply <instance> <module> [<module> ...]
-
-Apply modules to an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-``<module>``
- ID or name of the module.
-
-.. _trove_module-create:
-
-trove module-create
--------------------
-
-.. code-block:: console
-
- usage: trove module-create <name> <type> <filename>
- [--description <description>]
- [--datastore <datastore>]
- [--datastore_version <version>] [--auto_apply]
- [--all_tenants] [--hidden] [--live_update]
- [--priority_apply]
- [--apply_order {0,1,2,3,4,5,6,7,8,9}]
- [--full_access]
-
-Create a module.
-
-**Positional arguments:**
-
-``<name>``
- Name of the module.
-
-``<type>``
- Type of the module. The type must be
- supported by a corresponding module plugin
- on the datastore it is applied to.
-
-``<filename>``
- File containing data contents for the
- module.
-
-**Optional arguments:**
-
-``--description <description>``
- Description of the module.
-
-``--datastore <datastore>``
- Name or ID of datastore this module can be
- applied to. If not specified, module can be
- applied to all datastores.
-
-``--datastore_version <version>``
- Name or ID of datastore version this module
- can be applied to. If not specified, module
- can be applied to all versions.
-
-``--auto_apply``
- Automatically apply this module when
- creating an instance or cluster. Admin only.
-
-``--all_tenants``
- Module is valid for all tenants. Admin only.
-
-``--hidden``
- Hide this module from non-Admin. Useful in
- creating auto-apply modules without
- cluttering up module lists. Admin only.
-
-``--live_update``
- Allow module to be updated even if it is
- already applied to a current instance or
- cluster.
-
-``--priority_apply``
- Sets a priority for applying the module. All
- priority modules will be applied before non-priority ones. Admin only.
-
-``--apply_order {0,1,2,3,4,5,6,7,8,9}``
- Sets an order for applying the module.
- Modules with a lower value will be applied
- before modules with a higher value. Modules
- having the same value may be applied in any
- order (default 5).
-
-``--full_access``
- Marks a module as 'non-admin', unless an
- admin-only option was specified. Admin only.
-
-.. _trove_module-delete:
-
-trove module-delete
--------------------
-
-.. code-block:: console
-
- usage: trove module-delete <module>
-
-Delete a module.
-
-**Positional arguments:**
-
-``<module>``
- ID or name of the module.
-
-.. _trove_module-instance-count:
-
-trove module-instance-count
----------------------------
-
-.. code-block:: console
-
- usage: trove module-instance-count [--include_clustered] <module>
-
-Lists a count of the instances for each module md5.
-
-**Positional arguments:**
-
-``<module>``
- ID or name of the module.
-
-**Optional arguments:**
-
-``--include_clustered``
- Include instances that are part of a cluster (default
- False).
-
-.. _trove_module-instances:
-
-trove module-instances
-----------------------
-
-.. code-block:: console
-
- usage: trove module-instances <module>
- [--include_clustered] [--limit <limit>]
- [--marker <ID>]
-
-Lists the instances that have a particular module applied.
-
-**Positional arguments:**
-
-``<module>``
- ID or name of the module.
-
-**Optional arguments:**
-
-``--include_clustered``
- Include instances that are part of a cluster (default
- False).
-
-``--limit <limit>``
- Return up to N number of the most recent results.
-
-``--marker <ID>``
- Begin displaying the results for IDs greater than the
- specified marker. When used with --limit, set this to
- the last ID displayed in the previous run.
-
-.. _trove_module-list:
-
-trove module-list
------------------
-
-.. code-block:: console
-
- usage: trove module-list [--datastore <datastore>]
-
-Lists the modules available.
-
-**Optional arguments:**
-
-``--datastore <datastore>``
- Name or ID of datastore to list modules for. Use
- 'all' to list modules that apply to all datastores.
-
-.. _trove_module-list-instance:
-
-trove module-list-instance
---------------------------
-
-.. code-block:: console
-
- usage: trove module-list-instance <instance>
-
-Lists the modules that have been applied to an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-.. _trove_module-query:
-
-trove module-query
-------------------
-
-.. code-block:: console
-
- usage: trove module-query <instance>
-
-Query the status of the modules on an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-.. _trove_module-reapply:
-
-trove module-reapply
---------------------
-
-.. code-block:: console
-
- usage: trove module-reapply <module>
- [--md5 <md5>] [--include_clustered]
- [--batch_size <batch_size>] [--delay <delay>]
- [--force]
-
-Reapply a module.
-
-**Positional arguments:**
-
-``<module>``
- Name or ID of the module.
-
-**Optional arguments:**
-
-``--md5 <md5>``
- Reapply the module only to instances applied with
- the specific md5.
-
-``--include_clustered``
- Include instances that are part of a cluster
- (default False).
-
-``--batch_size <batch_size>``
- Number of instances to reapply the module to
- before sleeping.
-
-``--delay <delay>``
- Time to sleep in seconds between applying
- batches.
-
-``--force``
- Force reapply even on modules already having the
- current MD5
-
-.. _trove_module-remove:
-
-trove module-remove
--------------------
-
-.. code-block:: console
-
- usage: trove module-remove <instance> <module>
-
-Remove a module from an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-``<module>``
- ID or name of the module.
-
-.. _trove_module-retrieve:
-
-trove module-retrieve
----------------------
-
-.. code-block:: console
-
- usage: trove module-retrieve <instance>
- [--directory <directory>]
- [--prefix <filename_prefix>]
-
-Retrieve module contents from an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-**Optional arguments:**
-
-``--directory <directory>``
- Directory to write module content files in. It
- will be created if it does not exist. Defaults
- to the current directory.
-
-``--prefix <filename_prefix>``
- Prefix to prepend to generated filename for each
- module.
-
-.. _trove_module-show:
-
-trove module-show
------------------
-
-.. code-block:: console
-
- usage: trove module-show <module>
-
-Shows details of a module.
-
-**Positional arguments:**
-
-``<module>``
- ID or name of the module.
-
-.. _trove_module-update:
-
-trove module-update
--------------------
-
-.. code-block:: console
-
- usage: trove module-update <module>
- [--name <name>] [--type <type>] [--file <filename>]
- [--description <description>]
- [--datastore <datastore>] [--all_datastores]
- [--datastore_version <version>]
- [--all_datastore_versions] [--auto_apply]
- [--no_auto_apply] [--all_tenants]
- [--no_all_tenants] [--hidden] [--no_hidden]
- [--live_update] [--no_live_update]
- [--priority_apply] [--no_priority_apply]
- [--apply_order {0,1,2,3,4,5,6,7,8,9}]
- [--full_access] [--no_full_access]
-
-Update a module.
-
-**Positional arguments:**
-
-``<module>``
- Name or ID of the module.
-
-**Optional arguments:**
-
-``--name <name>``
- Name of the module.
-
-``--type <type>``
- Type of the module. The type must be
- supported by a corresponding module driver
- plugin on the datastore it is applied to.
-
-``--file <filename>``
- File containing data contents for the
- module.
-
-``--description <description>``
- Description of the module.
-
-``--datastore <datastore>``
- Name or ID of datastore this module can be
- applied to. If not specified, module can be
- applied to all datastores.
-
-``--all_datastores``
- Module is valid for all datastores.
-
-``--datastore_version <version>``
- Name or ID of datastore version this module
- can be applied to. If not specified, module
- can be applied to all versions.
-
-``--all_datastore_versions``
- Module is valid for all datastore versions.
-
-``--auto_apply``
- Automatically apply this module when
- creating an instance or cluster. Admin only.
-
-``--no_auto_apply``
- Do not automatically apply this module when
- creating an instance or cluster. Admin only.
-
-``--all_tenants``
- Module is valid for all tenants. Admin only.
-
-``--no_all_tenants``
- Module is valid for current tenant only.
- Admin only.
-
-``--hidden``
- Hide this module from non-admin users.
- Useful in creating auto-apply modules
- without cluttering up module lists. Admin
- only.
-
-``--no_hidden``
- Allow all users to see this module. Admin
- only.
-
-``--live_update``
- Allow module to be updated or deleted even
- if it is already applied to a current
- instance or cluster.
-
-``--no_live_update``
- Restricts a module from being updated or
- deleted if it is already applied to a
- current instance or cluster.
-
-``--priority_apply``
- Sets a priority for applying the module. All
- priority modules will be applied before non-priority ones. Admin only.
-
-``--no_priority_apply``
- Removes apply priority from the module.
- Admin only.
-
-``--apply_order {0,1,2,3,4,5,6,7,8,9}``
- Sets an order for applying the module.
- Modules with a lower value will be applied
- before modules with a higher value. Modules
- having the same value may be applied in any
- order (default None).
-
-``--full_access``
- Marks a module as 'non-admin', unless an
- admin-only option was specified. Admin only.
-
-``--no_full_access``
- Restricts modification access for non-admin.
- Admin only.
-
-.. _trove_promote-to-replica-source:
-
-trove promote-to-replica-source
--------------------------------
-
-.. code-block:: console
-
- usage: trove promote-to-replica-source <instance>
-
-Promotes a replica to be the new replica source of its set.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-.. _trove_quota-show:
-
-trove quota-show
-----------------
-
-.. code-block:: console
-
- usage: trove quota-show <tenant_id>
-
-Show quotas for a tenant.
-
-**Positional arguments:**
-
-``<tenant_id>``
- Id of tenant for which to show quotas.
-
-.. _trove_quota-update:
-
-trove quota-update
-------------------
-
-.. code-block:: console
-
- usage: trove quota-update <tenant_id> <resource> <limit>
-
-Update quotas for a tenant.
-
-**Positional arguments:**
-
-``<tenant_id>``
- Id of tenant for which to update quotas.
-
-``<resource>``
- Id of resource to change.
-
-``<limit>``
- New limit to set for the named resource.
-
-.. _trove_reset-status:
-
-trove reset-status
-------------------
-
-.. code-block:: console
-
- usage: trove reset-status <instance>
-
-Set the status to NONE.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-.. _trove_resize-instance:
-
-trove resize-instance
----------------------
-
-.. code-block:: console
-
- usage: trove resize-instance <instance> <flavor>
-
-Resizes an instance with a new flavor.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-``<flavor>``
- New flavor of the instance.
-
-.. _trove_resize-volume:
-
-trove resize-volume
--------------------
-
-.. code-block:: console
-
- usage: trove resize-volume <instance> <size>
-
-Resizes the volume size of an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-``<size>``
- New size of the instance disk volume in GB.
-
-.. _trove_restart:
-
-trove restart
--------------
-
-.. code-block:: console
-
- usage: trove restart <instance>
-
-Restarts an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-.. _trove_root-disable:
-
-trove root-disable
-------------------
-
-.. code-block:: console
-
- usage: trove root-disable <instance>
-
-Disables root for an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-.. _trove_root-enable:
-
-trove root-enable
------------------
-
-.. code-block:: console
-
- usage: trove root-enable <instance_or_cluster>
- [--root_password <root_password>]
-
-Enables root for an instance and resets if already exists.
-
-**Positional arguments:**
-
-``<instance_or_cluster>``
- ID or name of the instance or cluster.
-
-**Optional arguments:**
-
-``--root_password <root_password>``
- Root password to set.
-
-.. _trove_root-show:
-
-trove root-show
----------------
-
-.. code-block:: console
-
- usage: trove root-show <instance_or_cluster>
-
-Gets status if root was ever enabled for an instance or cluster.
-
-**Positional arguments:**
-
-``<instance_or_cluster>``
- ID or name of the instance or cluster.
-
-.. _trove_schedule-create:
-
-trove schedule-create
----------------------
-
-.. code-block:: console
-
- usage: trove schedule-create <instance> <pattern> <name>
- [--description <description>] [--incremental]
-
-Schedules backups for an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-``<pattern>``
- Cron style pattern describing schedule
- occurrence.
-
-``<name>``
- Name of the backup.
-
-**Optional arguments:**
-
-``--description <description>``
- An optional description for the backup.
-
-``--incremental``
- Flag to select incremental backup based on most
- recent backup.
-
-.. _trove_schedule-delete:
-
-trove schedule-delete
----------------------
-
-.. code-block:: console
-
- usage: trove schedule-delete <schedule id>
-
-Deletes a schedule.
-
-**Positional arguments:**
-
-``<schedule id>``
- Id of the schedule.
-
-.. _trove_schedule-list:
-
-trove schedule-list
--------------------
-
-.. code-block:: console
-
- usage: trove schedule-list <instance>
-
-Lists scheduled backups for an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-.. _trove_schedule-show:
-
-trove schedule-show
--------------------
-
-.. code-block:: console
-
- usage: trove schedule-show <schedule id>
-
-Shows details of a schedule.
-
-**Positional arguments:**
-
-``<schedule id>``
- Id of the schedule.
-
-.. _trove_secgroup-add-rule:
-
-trove secgroup-add-rule
------------------------
-
-.. code-block:: console
-
- usage: trove secgroup-add-rule <security_group> <cidr>
-
-Creates a security group rule.
-
-**Positional arguments:**
-
-``<security_group>``
- Security group ID.
-
-``<cidr>``
- CIDR address.
-
-.. _trove_secgroup-delete-rule:
-
-trove secgroup-delete-rule
---------------------------
-
-.. code-block:: console
-
- usage: trove secgroup-delete-rule <security_group_rule>
-
-Deletes a security group rule.
-
-**Positional arguments:**
-
-``<security_group_rule>``
- Name of security group rule.
-
-.. _trove_secgroup-list:
-
-trove secgroup-list
--------------------
-
-.. code-block:: console
-
- usage: trove secgroup-list
-
-Lists all security groups.
-
-.. _trove_secgroup-list-rules:
-
-trove secgroup-list-rules
--------------------------
-
-.. code-block:: console
-
- usage: trove secgroup-list-rules <security_group>
-
-Lists all rules for a security group.
-
-**Positional arguments:**
-
-``<security_group>``
- Security group ID.
-
-.. _trove_secgroup-show:
-
-trove secgroup-show
--------------------
-
-.. code-block:: console
-
- usage: trove secgroup-show <security_group>
-
-Shows details of a security group.
-
-**Positional arguments:**
-
-``<security_group>``
- Security group ID.
-
-.. _trove_show:
-
-trove show
-----------
-
-.. code-block:: console
-
- usage: trove show <instance>
-
-Shows details of an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-.. _trove_update:
-
-trove update
-------------
-
-.. code-block:: console
-
- usage: trove update <instance>
- [--name <name>] [--configuration <configuration>]
- [--detach_replica_source] [--remove_configuration]
-
-Updates an instance: Edits name, configuration, or replica source.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-**Optional arguments:**
-
-``--name <name>``
- Name of the instance.
-
-``--configuration <configuration>``
- ID of the configuration reference to attach.
-
-``--detach_replica_source, --detach-replica-source``
- Detach the replica instance from its
- replication source. --detach-replica-source
- may be deprecated in the future in favor of
- just --detach_replica_source
-
-``--remove_configuration``
- Drops the current configuration reference.
-
-.. _trove_upgrade:
-
-trove upgrade
--------------
-
-.. code-block:: console
-
- usage: trove upgrade <instance> <datastore_version>
-
-Upgrades an instance to a new datastore version.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-``<datastore_version>``
- A datastore version name or ID.
-
-.. _trove_user-create:
-
-trove user-create
------------------
-
-.. code-block:: console
-
- usage: trove user-create <instance> <name> <password>
- [--host <host>]
- [--databases <databases> [<databases> ...]]
-
-Creates a user on an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-``<name>``
- Name of user.
-
-``<password>``
- Password of user.
-
-**Optional arguments:**
-
-``--host <host>``
- Optional host of user.
-
-``--databases <databases> [<databases> ...]``
- Optional list of databases.
-
-.. _trove_user-delete:
-
-trove user-delete
------------------
-
-.. code-block:: console
-
- usage: trove user-delete [--host <host>] <instance> <name>
-
-Deletes a user from an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-``<name>``
- Name of user.
-
-**Optional arguments:**
-
-``--host <host>``
- Optional host of user.
-
-.. _trove_user-grant-access:
-
-trove user-grant-access
------------------------
-
-.. code-block:: console
-
- usage: trove user-grant-access <instance> <name> <databases> [<databases> ...]
- [--host <host>]
-
-Grants access to a database(s) for a user.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-``<name>``
- Name of user.
-
-``<databases>``
- List of databases.
-
-**Optional arguments:**
-
-``--host <host>``
- Optional host of user.
-
-.. _trove_user-list:
-
-trove user-list
----------------
-
-.. code-block:: console
-
- usage: trove user-list <instance>
-
-Lists the users for an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-.. _trove_user-revoke-access:
-
-trove user-revoke-access
-------------------------
-
-.. code-block:: console
-
- usage: trove user-revoke-access [--host <host>] <instance> <name> <database>
-
-Revokes access to a database for a user.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-``<name>``
- Name of user.
-
-``<database>``
- A single database.
-
-**Optional arguments:**
-
-``--host <host>``
- Optional host of user.
-
-.. _trove_user-show:
-
-trove user-show
----------------
-
-.. code-block:: console
-
- usage: trove user-show [--host <host>] <instance> <name>
-
-Shows details of a user of an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-``<name>``
- Name of user.
-
-**Optional arguments:**
-
-``--host <host>``
- Optional host of user.
-
-.. _trove_user-show-access:
-
-trove user-show-access
-----------------------
-
-.. code-block:: console
-
- usage: trove user-show-access [--host <host>] <instance> <name>
-
-Shows access details of a user of an instance.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-``<name>``
- Name of user.
-
-**Optional arguments:**
-
-``--host <host>``
- Optional host of user.
-
-.. _trove_user-update-attributes:
-
-trove user-update-attributes
-----------------------------
-
-.. code-block:: console
-
- usage: trove user-update-attributes <instance> <name>
- [--host <host>] [--new_name <new_name>]
- [--new_password <new_password>]
- [--new_host <new_host>]
-
-Updates a user's attributes on an instance. At least one optional argument
-must be provided.
-
-**Positional arguments:**
-
-``<instance>``
- ID or name of the instance.
-
-``<name>``
- Name of user.
-
-**Optional arguments:**
-
-``--host <host>``
- Optional host of user.
-
-``--new_name <new_name>``
- Optional new name of user.
-
-``--new_password <new_password>``
- Optional new password of user.
-
-``--new_host <new_host>``
- Optional new host of user.
-
-.. _trove_volume-type-list:
-
-trove volume-type-list
-----------------------
-
-.. code-block:: console
-
- usage: trove volume-type-list [--datastore_type <datastore_type>]
- [--datastore_version_id <datastore_version_id>]
-
-Lists available volume types.
-
-**Optional arguments:**
-
-``--datastore_type <datastore_type>``
- Type of the datastore. For eg: mysql.
-
-``--datastore_version_id <datastore_version_id>``
- ID of the datastore version.
-
-.. _trove_volume-type-show:
-
-trove volume-type-show
-----------------------
-
-.. code-block:: console
-
- usage: trove volume-type-show <volume_type>
-
-Shows details of a volume type.
-
-**Positional arguments:**
-
-``<volume_type>``
- ID or name of the volume type.
-
diff --git a/doc/source/index.rst b/doc/source/index.rst
index 9b3e989..f2d2096 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -16,8 +16,7 @@
===========================================
This is a client for the OpenStack Trove API. There's a Python API (the
-``troveclient`` module), and a command-line script (``trove``). Each
-implements 100% of the OpenStack Trove API.
+``troveclient`` module), and an ``openstack`` command-line plugin.
Contents
--------
@@ -26,7 +25,6 @@ Contents
:maxdepth: 2
user/index
- cli/index
reference/index
Indices and tables
diff --git a/doc/source/user/index.rst b/doc/source/user/index.rst
index 2656e42..6eabb98 100644
--- a/doc/source/user/index.rst
+++ b/doc/source/user/index.rst
@@ -2,42 +2,16 @@
Trove Client User Guide
=========================
-Command-line API
-----------------
+Command-line Interface
+----------------------
-Installing this package gets you a shell command, ``trove``, that you
-can use to interact with any OpenStack cloud.
+Installing this package allows you to use ``openstack`` command to interact
+with Trove. Refer to
+https://docs.openstack.org/python-openstackclient/latest
+for how to install ``openstack`` command and configuration.
-You'll need to provide your OpenStack username and password. You can do this
-with the ``--os-username``, ``--os-password`` and ``--os-tenant-name``
-params, but it's easier to just set them as environment variables::
-
- export OS_USERNAME=openstack
- export OS_PASSWORD=yadayada
- export OS_TENANT_NAME=myproject
-
-You will also need to define the authentication url with ``--os-auth-url`` and
-the version of the API with ``--os-database-api-version`` (default is version
-1.0). Or set them as an environment variables as well::
-
- export OS_AUTH_URL=http://example.com:5000/v2.0/
- export OS_AUTH_URL=1.0
-
-If you are using Keystone, you need to set the OS_AUTH_URL to the keystone
-endpoint::
-
- export OS_AUTH_URL=http://example.com:5000/v2.0/
-
-Since Keystone can return multiple regions in the Service Catalog, you
-can specify the one you want with ``--os-region-name`` (or
-``export OS_REGION_NAME``). It defaults to the first in the list returned.
-
-Argument ``--profile`` is available only when the osprofiler lib is installed.
-
-You'll find complete documentation on the shell by running
-``trove help``.
-
-For more details, refer to :doc:`../cli/index`.
+You can find all supported Trove commands in ``openstack.database.v1``
+entry_points section in ``setup.cfg`` file of the repo.
Python API
----------
@@ -46,14 +20,11 @@ There's also a complete Python API.
Quick-start using keystone::
- # use v2.0 auth with http://example.com:5000/v2.0/
- >>> from troveclient.v1 import client
- >>> nt = client.Client(USERNAME, PASSWORD, TENANT_NAME, AUTH_URL)
- >>> nt.datastores.list()
- [...]
- >>> nt.flavors.list()
+ >>> from troveclient import client
+ >>> trove_client = client.Client('1.0', session=keystone_session, endpoint_type='public', service_type='database', region_name='RegionOne')
+ >>> trove_client.datastores.list()
[...]
- >>> nt.instances.list()
+ >>> trove_client.instances.list()
[...]
.. toctree::
diff --git a/setup.cfg b/setup.cfg
index dd78075..5d5c939 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -62,8 +62,6 @@ openstack.database.v1 =
database_db_create = troveclient.osc.v1.databases:CreateDatabase
database_db_delete = troveclient.osc.v1.databases:DeleteDatabase
database_db_list = troveclient.osc.v1.databases:ListDatabases
- database_flavor_list = troveclient.osc.v1.database_flavors:ListDatabaseFlavors
- database_flavor_show = troveclient.osc.v1.database_flavors:ShowDatabaseFlavor
database_instance_create = troveclient.osc.v1.database_instances:CreateDatabaseInstance
database_instance_delete = troveclient.osc.v1.database_instances:DeleteDatabaseInstance
database_instance_detach_replica = troveclient.osc.v1.database_instances:DetachDatabaseInstanceReplica
diff --git a/troveclient/compat/__init__.py b/troveclient/compat/__init__.py
index a08dcb8..1e9734d 100644
--- a/troveclient/compat/__init__.py
+++ b/troveclient/compat/__init__.py
@@ -21,11 +21,9 @@ from troveclient.v1.accounts import Accounts # noqa
from troveclient.v1.databases import Databases # noqa
from troveclient.v1.diagnostics import DiagnosticsInterrogator # noqa
from troveclient.v1.diagnostics import HwInfoInterrogator # noqa
-from troveclient.v1.flavors import Flavors # noqa
from troveclient.v1.hosts import Hosts # noqa
from troveclient.v1.instances import Instances # noqa
from troveclient.v1.management import Management # noqa
-from troveclient.v1.management import MgmtFlavors # noqa
from troveclient.v1.management import RootHistory # noqa
from troveclient.v1.root import Root # noqa
from troveclient.v1.storage import StorageInfo # noqa
diff --git a/troveclient/compat/cli.py b/troveclient/compat/cli.py
index 8d82ab7..6f6199e 100644
--- a/troveclient/compat/cli.py
+++ b/troveclient/compat/cli.py
@@ -129,16 +129,6 @@ class InstanceCommands(common.AuthedCommandsBase):
self._pretty_print(self.dbaas.instances.configuration, self.id)
-class FlavorsCommands(common.AuthedCommandsBase):
- """Command for listing Flavors."""
-
- params = []
-
- def list(self):
- """List the available flavors."""
- self._pretty_list(self.dbaas.flavors.list)
-
-
class DatabaseCommands(common.AuthedCommandsBase):
"""Database CRUD operations on an instance."""
@@ -436,7 +426,6 @@ class MetadataCommands(common.AuthedCommandsBase):
COMMANDS = {
'auth': common.Auth,
'instance': InstanceCommands,
- 'flavor': FlavorsCommands,
'database': DatabaseCommands,
'limit': LimitsCommands,
'backup': BackupsCommands,
diff --git a/troveclient/compat/client.py b/troveclient/compat/client.py
index 9dfa284..1daa129 100644
--- a/troveclient/compat/client.py
+++ b/troveclient/compat/client.py
@@ -309,7 +309,6 @@ class Dbaas(object):
from troveclient.v1 import databases
from troveclient.v1 import datastores
from troveclient.v1 import diagnostics
- from troveclient.v1 import flavors
from troveclient.v1 import hosts
from troveclient.v1 import instances
from troveclient.v1 import limits
@@ -331,7 +330,6 @@ class Dbaas(object):
region_name=region_name)
self.versions = versions.Versions(self)
self.databases = databases.Databases(self)
- self.flavors = flavors.Flavors(self)
self.instances = instances.Instances(self)
self.limits = limits.Limits(self)
self.users = users.Users(self)
@@ -349,7 +347,6 @@ class Dbaas(object):
self.storage = storage.StorageInfo(self)
self.management = management.Management(self)
self.mgmt_cluster = management.MgmtClusters(self)
- self.mgmt_flavor = management.MgmtFlavors(self)
self.accounts = accounts.Accounts(self)
self.diagnostics = diagnostics.DiagnosticsInterrogator(self)
self.hwinfo = diagnostics.HwInfoInterrogator(self)
diff --git a/troveclient/compat/mcli.py b/troveclient/compat/mcli.py
index e3efbae..f151ab7 100644
--- a/troveclient/compat/mcli.py
+++ b/troveclient/compat/mcli.py
@@ -181,31 +181,6 @@ class StorageCommands(common.AuthedCommandsBase):
self._pretty_list(self.dbaas.storage.index)
-class FlavorsCommands(common.AuthedCommandsBase):
- """Commands for managing Flavors."""
-
- params = [
- 'name',
- 'ram',
- 'disk',
- 'vcpus',
- 'flavor_id',
- 'ephemeral',
- 'swap',
- 'rxtx_factor',
- 'service_type'
- ]
-
- def create(self):
- """Create a new flavor."""
- self._require('name', 'ram', 'disk', 'vcpus',
- 'flavor_id', 'service_type')
- self._pretty_print(self.dbaas.mgmt_flavor.create, self.name,
- self.ram, self.disk, self.vcpus, self.flavor_id,
- self.ephemeral, self.swap, self.rxtx_factor,
- self.service_type)
-
-
def config_options(oparser):
oparser.add_option("-u", "--url", default="http://localhost:5000/v1.1",
help="Auth API endpoint URL with port and version. \
@@ -219,7 +194,6 @@ COMMANDS = {
'root': RootCommands,
'storage': StorageCommands,
'quota': QuotaCommands,
- 'flavor': FlavorsCommands,
}
diff --git a/troveclient/osc/v1/database_flavors.py b/troveclient/osc/v1/database_flavors.py
deleted file mode 100644
index 5fb513e..0000000
--- a/troveclient/osc/v1/database_flavors.py
+++ /dev/null
@@ -1,97 +0,0 @@
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-"""Database v1 Flavors action implementations"""
-
-from osc_lib.command import command
-from osc_lib import utils
-import six
-
-from troveclient import exceptions
-from troveclient.i18n import _
-
-
-def set_attributes_for_print_detail(flavor):
- info = flavor._info.copy()
- # Get rid of those ugly links
- if info.get('links'):
- del(info['links'])
-
- # Fallback to str_id for flavors, where necessary
- if hasattr(flavor, 'str_id'):
- info['id'] = flavor.id
- del(info['str_id'])
- return info
-
-
-class ListDatabaseFlavors(command.Lister):
-
- _description = _("List database flavors")
- columns = ['ID', 'Name', 'RAM', 'vCPUs', 'Disk', 'Ephemeral']
-
- def get_parser(self, prog_name):
- parser = super(ListDatabaseFlavors, self).get_parser(prog_name)
- parser.add_argument(
- '--datastore-type',
- dest='datastore_type',
- metavar='<datastore-type>',
- help=_('Type of the datastore. For eg: mysql.')
- )
- parser.add_argument(
- '--datastore-version-id',
- dest='datastore_version_id',
- metavar='<datastore-version-id>',
- help=_('ID of the datastore version.')
- )
- return parser
-
- def take_action(self, parsed_args):
- db_flavors = self.app.client_manager.database.flavors
- if parsed_args.datastore_type and parsed_args.datastore_version_id:
- flavors = db_flavors.list_datastore_version_associated_flavors(
- datastore=parsed_args.datastore_type,
- version_id=parsed_args.datastore_version_id)
- elif (not parsed_args.datastore_type and not
- parsed_args.datastore_version_id):
- flavors = db_flavors.list()
- else:
- raise exceptions.MissingArgs(['datastore-type',
- 'datastore-version-id'])
-
- # Fallback to str_id where necessary.
- _flavors = []
- for f in flavors:
- if not f.id and hasattr(f, 'str_id'):
- f.id = f.str_id
- _flavors.append(utils.get_item_properties(f, self.columns))
-
- return self.columns, _flavors
-
-
-class ShowDatabaseFlavor(command.ShowOne):
- _description = _("Shows details of a database flavor")
-
- def get_parser(self, prog_name):
- parser = super(ShowDatabaseFlavor, self).get_parser(prog_name)
- parser.add_argument(
- 'flavor',
- metavar='<flavor>',
- help=_('ID or name of the flavor'),
- )
- return parser
-
- def take_action(self, parsed_args):
- db_flavors = self.app.client_manager.database.flavors
- flavor = utils.find_resource(db_flavors,
- parsed_args.flavor)
- flavor = set_attributes_for_print_detail(flavor)
- return zip(*sorted(six.iteritems(flavor)))
diff --git a/troveclient/osc/v1/database_instances.py b/troveclient/osc/v1/database_instances.py
index 9595ac1..9eecb18 100644
--- a/troveclient/osc/v1/database_instances.py
+++ b/troveclient/osc/v1/database_instances.py
@@ -225,7 +225,7 @@ class CreateDatabaseInstance(command.ShowOne):
'flavor',
metavar='<flavor>',
type=str,
- help=_("A flavor name or ID."),
+ help=_("A flavor ID."),
)
parser.add_argument(
'--size',
@@ -348,8 +348,8 @@ class CreateDatabaseInstance(command.ShowOne):
def take_action(self, parsed_args):
database = self.app.client_manager.database
db_instances = database.instances
- flavor_id = osc_utils.find_resource(database.flavors,
- parsed_args.flavor).id
+ flavor_id = parsed_args.flavor
+
volume = None
if parsed_args.size is not None and parsed_args.size <= 0:
raise exceptions.ValidationError(
diff --git a/troveclient/tests/osc/v1/fakes.py b/troveclient/tests/osc/v1/fakes.py
index fde9237..7002c3c 100644
--- a/troveclient/tests/osc/v1/fakes.py
+++ b/troveclient/tests/osc/v1/fakes.py
@@ -20,7 +20,6 @@ from troveclient.v1 import clusters
from troveclient.v1 import configurations
from troveclient.v1 import databases
from troveclient.v1 import datastores
-from troveclient.v1 import flavors
from troveclient.v1 import instances
from troveclient.v1 import limits
from troveclient.v1 import modules
@@ -34,13 +33,6 @@ class TestDatabasev1(utils.TestCommand):
self.app.client_manager.database = mock.MagicMock()
-class FakeFlavors(object):
- fake_flavors = fakes.FakeHTTPClient().get_flavors()[2]['flavors']
-
- def get_flavors_1(self):
- return flavors.Flavor(None, self.fake_flavors[0])
-
-
class FakeBackups(object):
fake_backups = fakes.FakeHTTPClient().get_backups()[2]['backups']
diff --git a/troveclient/tests/osc/v1/test_database_flavors.py b/troveclient/tests/osc/v1/test_database_flavors.py
deleted file mode 100644
index 6b87f06..0000000
--- a/troveclient/tests/osc/v1/test_database_flavors.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from troveclient.osc.v1 import database_flavors
-from troveclient.tests.osc.v1 import fakes
-
-
-class TestFlavors(fakes.TestDatabasev1):
- fake_flavors = fakes.FakeFlavors()
-
- def setUp(self):
- super(TestFlavors, self).setUp()
- self.mock_client = self.app.client_manager.database
- self.flavor_client = self.app.client_manager.database.flavors
-
-
-class TestFlavorList(TestFlavors):
- columns = database_flavors.ListDatabaseFlavors.columns
- values = (1, 'm1.tiny', 512, '', '', '')
-
- def setUp(self):
- super(TestFlavorList, self).setUp()
- self.cmd = database_flavors.ListDatabaseFlavors(self.app, None)
- self.data = [self.fake_flavors.get_flavors_1()]
- self.flavor_client.list.return_value = self.data
- self.flavor_client.list_datastore_version_associated_flavors. \
- return_value = self.data
-
- def test_flavor_list_defaults(self):
- parsed_args = self.check_parser(self.cmd, [], [])
- columns, values = self.cmd.take_action(parsed_args)
- self.flavor_client.list.assert_called_once_with()
- self.assertEqual(self.columns, columns)
- self.assertEqual([self.values], values)
-
- def test_flavor_list_with_optional_args(self):
- args = ['--datastore-type', 'mysql',
- '--datastore-version-id', '5.6']
- parsed_args = self.check_parser(self.cmd, args, [])
- list_flavor_dict = {'datastore': 'mysql',
- 'version_id': '5.6'}
- columns, values = self.cmd.take_action(parsed_args)
- self.flavor_client.list_datastore_version_associated_flavors. \
- assert_called_once_with(**list_flavor_dict)
- self.assertEqual(self.columns, columns)
- self.assertEqual([self.values], values)
-
-
-class TestFlavorShow(TestFlavors):
-
- values = (1, 'm1.tiny', 512)
-
- def setUp(self):
- super(TestFlavorShow, self).setUp()
- self.cmd = database_flavors.ShowDatabaseFlavor(self.app, None)
- self.data = self.fake_flavors.get_flavors_1()
- self.flavor_client.get.return_value = self.data
- self.columns = (
- 'id',
- 'name',
- 'ram',
- )
-
- def test_flavor_show_defaults(self):
- args = ['m1.tiny']
- parsed_args = self.check_parser(self.cmd, args, [])
- columns, data = self.cmd.take_action(parsed_args)
- self.assertEqual(self.columns, columns)
- self.assertEqual(self.values, data)
diff --git a/troveclient/tests/osc/v1/test_database_instances.py b/troveclient/tests/osc/v1/test_database_instances.py
index 43b076c..dbe6f3f 100644
--- a/troveclient/tests/osc/v1/test_database_instances.py
+++ b/troveclient/tests/osc/v1/test_database_instances.py
@@ -197,7 +197,7 @@ class TestDatabaseInstanceCreate(TestInstances):
@mock.patch.object(utils, 'find_resource')
def test_instance_create(self, mock_find):
- mock_find.id.side_effect = ['103', 'test', 'mod_id']
+ mock_find.id.side_effect = ['test', 'mod_id']
args = ['test-name', '103',
'--size', '1',
'--databases', 'db1', 'db2',
diff --git a/troveclient/tests/test_management.py b/troveclient/tests/test_management.py
index 73d0a7c..23401b9 100644
--- a/troveclient/tests/test_management.py
+++ b/troveclient/tests/test_management.py
@@ -165,38 +165,6 @@ class ManagementTest(testtools.TestCase):
self.assertEqual({'reset-task-status': {}}, self.body_)
-class MgmtFlavorsTest(testtools.TestCase):
-
- def setUp(self):
- super(MgmtFlavorsTest, self).setUp()
- self.orig__init = management.MgmtFlavors.__init__
- management.MgmtFlavors.__init__ = mock.Mock(return_value=None)
- self.flavors = management.MgmtFlavors()
- self.flavors.api = mock.Mock()
- self.flavors.api.client = mock.Mock()
- self.flavors.resource_class = mock.Mock(return_value="flavor-1")
- self.orig_base_getid = base.getid
- base.getid = mock.Mock(return_value="flavor1")
-
- def tearDown(self):
- super(MgmtFlavorsTest, self).tearDown()
- management.MgmtFlavors.__init__ = self.orig__init
- base.getid = self.orig_base_getid
-
- def test_create(self):
- def side_effect_func(path, body, inst):
- return path, body, inst
-
- self.flavors._create = mock.Mock(side_effect=side_effect_func)
- p, b, i = self.flavors.create("test-name", 1024, 30, 2, 1)
- self.assertEqual("/mgmt/flavors", p)
- self.assertEqual("flavor", i)
- self.assertEqual("test-name", b["flavor"]["name"])
- self.assertEqual(1024, b["flavor"]["ram"])
- self.assertEqual(2, b["flavor"]["vcpu"])
- self.assertEqual(1, b["flavor"]["flavor_id"])
-
-
class MgmtDatastoreVersionsTest(testtools.TestCase):
def setUp(self):
diff --git a/troveclient/tests/test_v1_shell.py b/troveclient/tests/test_v1_shell.py
index 6bb1e23..fc26e66 100644
--- a/troveclient/tests/test_v1_shell.py
+++ b/troveclient/tests/test_v1_shell.py
@@ -209,41 +209,6 @@ class ShellTest(utils.TestCase):
self.run_command('eject-replica-source 1234')
self.assert_called('POST', '/instances/1234/action')
- def test_flavor_list(self):
- self.run_command('flavor-list')
- self.assert_called('GET', '/flavors')
-
- def test_flavor_list_with_datastore(self):
- cmd = ('flavor-list --datastore_type mysql '
- '--datastore_version_id some-version-id')
- self.run_command(cmd)
- self.assert_called(
- 'GET', '/datastores/mysql/versions/some-version-id/flavors')
-
- def test_flavor_list_error(self):
- cmd = 'flavor-list --datastore_type mysql'
- exepcted_error_msg = (r'Missing argument\(s\): '
- 'datastore_type, datastore_version_id')
- self.assertRaisesRegex(
- exceptions.MissingArgs, exepcted_error_msg, self.run_command,
- cmd)
-
- def test_flavor_show(self):
- self.run_command('flavor-show 1')
- self.assert_called('GET', '/flavors/1')
-
- def test_flavor_show_leading_zero(self):
- self.run_command('flavor-show 02')
- self.assert_called('GET', '/flavors/02')
-
- def test_flavor_show_by_name(self):
- self.run_command('flavor-show m1.tiny') # defined in fakes.py
- self.assert_called('GET', '/flavors/m1.tiny')
-
- def test_flavor_show_uuid(self):
- self.run_command('flavor-show m1.uuid')
- self.assert_called('GET', '/flavors/m1.uuid')
-
def test_volume_type_list(self):
self.run_command('volume-type-list')
self.assert_called('GET', '/volume-types')
@@ -301,7 +266,7 @@ class ShellTest(utils.TestCase):
'POST', '/instances',
{'instance': {
'volume': {'size': 1, 'type': 'lvm'},
- 'flavorRef': 1,
+ 'flavorRef': '1',
'name': 'test-member-1'
}})
@@ -312,19 +277,19 @@ class ShellTest(utils.TestCase):
'POST', '/instances',
{'instance': {
'volume': {'size': 1, 'type': 'lvm'},
- 'flavorRef': 1,
+ 'flavorRef': '1',
'name': 'test-member-1',
'modules': [{'id': '4321'}, {'id': '8765'}]
}})
def test_boot_by_flavor_name(self):
self.run_command(
- 'create test-member-1 m1.tiny --size 1 --volume_type lvm')
+ 'create test-member-1 1 --size 1 --volume_type lvm')
self.assert_called_anytime(
'POST', '/instances',
{'instance': {
'volume': {'size': 1, 'type': 'lvm'},
- 'flavorRef': 1,
+ 'flavorRef': '1',
'name': 'test-member-1'
}})
@@ -346,7 +311,7 @@ class ShellTest(utils.TestCase):
'POST', '/instances',
{'instance': {
'volume': {'size': 1, 'type': None},
- 'flavorRef': 1,
+ 'flavorRef': '1',
'name': 'repl-1',
'replica_count': 4,
'locality': 'anti-affinity'
@@ -358,7 +323,7 @@ class ShellTest(utils.TestCase):
'POST', '/instances',
{'instance': {
'volume': {'size': 1, 'type': None},
- 'flavorRef': 1,
+ 'flavorRef': '1',
'name': 'slave-1',
'replica_of': 'myid',
'replica_count': 1
@@ -371,7 +336,7 @@ class ShellTest(utils.TestCase):
'POST', '/instances',
{'instance': {
'volume': {'size': 1, 'type': None},
- 'flavorRef': 1,
+ 'flavorRef': '1',
'name': 'slave-1',
'replica_of': 'myid',
'replica_count': 3
@@ -383,7 +348,7 @@ class ShellTest(utils.TestCase):
'POST', '/instances',
{'instance': {
'volume': {'size': 1, 'type': None},
- 'flavorRef': 1,
+ 'flavorRef': '1',
'name': 'master-1',
'locality': 'affinity'
}})
@@ -411,7 +376,7 @@ class ShellTest(utils.TestCase):
'POST', '/instances',
{'instance': {
'volume': {'size': 1, 'type': None},
- 'flavorRef': 1,
+ 'flavorRef': '1',
'name': 'test-restore-1',
'restorePoint': {'backupRef': 'bk-1234'},
}})
@@ -422,7 +387,7 @@ class ShellTest(utils.TestCase):
'POST', '/instances',
{'instance': {
'volume': {'size': 1, 'type': None},
- 'flavorRef': 1,
+ 'flavorRef': '1',
'name': 'test-restore-1',
'restorePoint': {'backupRef': 'bk-1234'},
}})
@@ -454,8 +419,8 @@ class ShellTest(utils.TestCase):
def test_cluster_create_by_flavor_name(self):
cmd = ('cluster-create test-clstr vertica 7.1 '
- '--instance flavor=m1.small,volume=2 '
- '--instance flavor=m1.leading-zero,volume=1')
+ '--instance flavor=2,volume=2 '
+ '--instance flavor=02,volume=1')
self.run_command(cmd)
self.assert_called_anytime(
'POST', '/clusters',
diff --git a/troveclient/v1/client.py b/troveclient/v1/client.py
index 685a5cd..97af857 100644
--- a/troveclient/v1/client.py
+++ b/troveclient/v1/client.py
@@ -20,7 +20,6 @@ from troveclient.v1 import clusters
from troveclient.v1 import configurations
from troveclient.v1 import databases
from troveclient.v1 import datastores
-from troveclient.v1 import flavors
from troveclient.v1 import instances
from troveclient.v1 import limits
from troveclient.v1 import management
@@ -64,7 +63,6 @@ class Client(object):
# self.limits = limits.LimitsManager(self)
# extensions
- self.flavors = flavors.Flavors(self)
self.volume_types = volume_types.VolumeTypes(self)
self.users = users.Users(self)
self.databases = databases.Databases(self)
diff --git a/troveclient/v1/flavors.py b/troveclient/v1/flavors.py
deleted file mode 100644
index 7b1d72f..0000000
--- a/troveclient/v1/flavors.py
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright 2011 OpenStack Foundation
-# Copyright 2013 Rackspace Hosting
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-from troveclient import base
-
-
-class Flavor(base.Resource):
- """A Flavor is an Instance type, specifying other things, like RAM size."""
-
- def __init__(self, manager, info, loaded=False):
- super(Flavor, self).__init__(manager, info, loaded)
- if self.id is None and self.str_id is not None:
- self.id = self.str_id
-
- def __repr__(self):
- return "<Flavor: %s>" % self.name
-
-
-class Flavors(base.ManagerWithFind):
- """Manage :class:`Flavor` resources."""
- resource_class = Flavor
-
- def list(self):
- """Get a list of all flavors.
- :rtype: list of :class:`Flavor`.
- """
- return self._list("/flavors", "flavors")
-
- def list_datastore_version_associated_flavors(self, datastore,
- version_id):
- """Get a list of all flavors for the specified datastore type
- and datastore version .
- :rtype: list of :class:`Flavor`.
- """
- return self._list("/datastores/%s/versions/%s/flavors" %
- (datastore, version_id),
- "flavors")
-
- def get(self, flavor):
- """Get a specific flavor.
-
- :rtype: :class:`Flavor`
- """
- return self._get("/flavors/%s" % base.getid(flavor),
- "flavor")
diff --git a/troveclient/v1/management.py b/troveclient/v1/management.py
index fc38504..bb1711c 100644
--- a/troveclient/v1/management.py
+++ b/troveclient/v1/management.py
@@ -21,7 +21,6 @@ from troveclient import common
from troveclient.v1 import clusters
from troveclient.v1 import configurations
from troveclient.v1 import datastores
-from troveclient.v1 import flavors
from troveclient.v1 import instances
@@ -145,44 +144,6 @@ class MgmtClusters(base.ManagerWithFind):
self._action(cluster_id, body)
-class MgmtFlavors(base.ManagerWithFind):
- """Manage :class:`Flavor` resources."""
- resource_class = flavors.Flavor
-
- def __repr__(self):
- return "<Flavors Manager at %s>" % id(self)
-
- # Appease the abc gods
- def list(self):
- pass
-
- def create(self, name, ram, disk, vcpus,
- flavorid="auto", ephemeral=None, swap=None, rxtx_factor=None,
- service_type=None):
- """Create a new flavor."""
- body = {"flavor": {
- "flavor_id": flavorid,
- "name": name,
- "ram": ram,
- "disk": disk,
- "vcpu": vcpus,
- "ephemeral": 0,
- "swap": 0,
- "rxtx_factor": "1.0",
- "is_public": "True"
- }}
- if ephemeral:
- body["flavor"]["ephemeral"] = ephemeral
- if swap:
- body["flavor"]["swap"] = swap
- if rxtx_factor:
- body["flavor"]["rxtx_factor"] = rxtx_factor
- if service_type:
- body["flavor"]["service_type"] = service_type
-
- return self._create("/mgmt/flavors", body, "flavor")
-
-
class MgmtConfigurationParameters(configurations.ConfigurationParameters):
def create(self, version, name, restart_required, data_type,
max_size=None, min_size=None):
diff --git a/troveclient/v1/shell.py b/troveclient/v1/shell.py
index 1b72d31..9c8014c 100644
--- a/troveclient/v1/shell.py
+++ b/troveclient/v1/shell.py
@@ -189,11 +189,6 @@ def _find_cluster(cs, cluster):
return utils.find_resource(cs.clusters, cluster)
-def _find_flavor(cs, flavor):
- """Get a flavor by ID."""
- return utils.find_resource(cs.flavors, flavor)
-
-
def _find_volume_type(cs, volume_type):
"""Get a volume type by ID."""
return utils.find_resource(cs.volume_types, volume_type)
@@ -224,46 +219,6 @@ def _find_configuration(cs, configuration):
return utils.find_resource(cs.configurations, configuration)
-# Flavor related calls
-@utils.arg('--datastore_type', metavar='<datastore_type>',
- default=None,
- help=_('Type of the datastore. For eg: mysql.'))
-@utils.arg("--datastore_version_id", metavar="<datastore_version_id>",
- default=None, help=_("ID of the datastore version."))
-@utils.service_type('database')
-def do_flavor_list(cs, args):
- """Lists available flavors."""
- if args.datastore_type and args.datastore_version_id:
- flavors = cs.flavors.list_datastore_version_associated_flavors(
- args.datastore_type, args.datastore_version_id)
- elif not args.datastore_type and not args.datastore_version_id:
- flavors = cs.flavors.list()
- else:
- raise exceptions.MissingArgs(['datastore_type',
- 'datastore_version_id'])
-
- # Fallback to str_id where necessary.
- _flavors = []
- for f in flavors:
- if not f.id and hasattr(f, 'str_id'):
- f.id = f.str_id
- _flavors.append(f)
-
- utils.print_list(_flavors, ['id', 'name', 'ram', 'vcpus', 'disk',
- 'ephemeral'],
- labels={'ram': 'RAM', 'vcpus': 'vCPUs', 'disk': 'Disk'},
- order_by='ram')
-
-
-@utils.arg('flavor', metavar='<flavor>', type=str,
- help=_('ID or name of the flavor.'))
-@utils.service_type('database')
-def do_flavor_show(cs, args):
- """Shows details of a flavor."""
- flavor = _find_flavor(cs, args.flavor)
- _print_object(flavor)
-
-
# Volume type related calls
@utils.arg('--datastore_type', metavar='<datastore_type>',
default=None,
@@ -555,7 +510,7 @@ def do_update(cs, args):
@utils.arg('flavor',
metavar='<flavor>',
type=str,
- help=_('A flavor name or ID.'))
+ help=_('A flavor ID.'))
@utils.arg('--databases', metavar='<database>',
help=_('Optional list of databases.'),
nargs="+", default=[])
@@ -623,7 +578,7 @@ def do_update(cs, args):
@utils.service_type('database')
def do_create(cs, args):
"""Creates a new instance."""
- flavor_id = _find_flavor(cs, args.flavor).id
+ flavor_id = args.flavor
volume = None
if args.size is not None and args.size <= 0:
raise exceptions.ValidationError(
@@ -686,8 +641,7 @@ def _validate_nic_info(nic_info, nic_str):
def _get_flavor(cs, opts_str):
- flavor_name, opts_str = _strip_option(opts_str, 'flavor', True)
- flavor_id = _find_flavor(cs, flavor_name).id
+ flavor_id, opts_str = _strip_option(opts_str, 'flavor', True)
return str(flavor_id), opts_str
@@ -929,12 +883,12 @@ def do_cluster_create(cs, args):
@utils.arg('flavor',
metavar='<flavor>',
type=str,
- help=_('New flavor of the instance.'))
+ help=_('New flavor ID for the instance.'))
@utils.service_type('database')
def do_resize_instance(cs, args):
"""Resizes an instance with a new flavor."""
instance = _find_instance(cs, args.instance)
- flavor_id = _find_flavor(cs, args.flavor).id
+ flavor_id = args.flavor
cs.instances.resize_instance(instance, flavor_id)