troveclient(1)
| PYTHON-TROVECLIENT(1) | python-troveclient | PYTHON-TROVECLIENT(1) |
NAME
python-troveclient - python-troveclient 3.3.1
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.
CONTENTS
Trove Client User Guide
Command-line API
Installing this package gets you a shell command, trove, that you can use to interact with any OpenStack cloud.
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 ../cli/index.
Python API
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() [...] >>> nt.instances.list() [...]
Using the Client Programmatically
Authentication
Authenticating is necessary to use every feature of the client.
To create the client, create an instance of the Client class. The auth url, username, password, and project name must be specified in the call to the constructor.
from troveclient.v1 import client tc = client.Client(username="testuser",
password="PASSWORD",
project_id="test_project",
region_name="EAST",
auth_url="http://api-server:5000/v2.0")
The default authentication strategy assumes a keystone compliant auth system.
Once you have an authenticated client object you can make calls with it, for example:
flavors = tc.flavors.list() datastores = tc.datastores.list()
Instances
The following example creates a 512 MB instance with a 1 GB volume:
from troveclient.v1 import client tc = client.Client(username="testuser",
password="PASSWORD",
project_id="test_project",
region_name="EAST",
auth_url="http://api-server:5000/v2.0") flavor_id = '1' volume = {'size':1} databases = [{"name": "my_db",
"character_set": "latin2", # These two fields
"collate": "latin2_general_ci"}] # are optional. datastore = 'mysql' datastore_version = '5.6-104' users = [{"name": "jsmith", "password": "12345",
"databases": [{"name": "my_db"}]
}] instance = client.instances.create("My Instance", flavor_id, volume,
databases, users, datastore=datastore,
datastore_version=datastore_version)
To retrieve the instance, use the "get" method of "instances":
updated_instance = client.instances.get(instance.id)
print(updated_instance.name)
print(" Status=%s Flavor=%s" %
(updated_instance.status, updated_instance.flavor['id']))
My Instance
Status=BUILD Flavor=1
You can delete an instance by calling "delete" on the instance object itself, or by using the delete method on "instances."
# Wait for the instance to be ready before we delete it. import time from troveclient.exceptions import NotFound while instance.status == "BUILD":
instance.get()
time.sleep(1) print("Ready in an %s state." % instance.status) instance.delete() # Delete and wait for the instance to go away. while True:
try:
instance = client.instances.get(instance.id)
assert instance.status == "SHUTDOWN"
except NotFound:
break
Ready in an ACTIVE state.
Listing Items and Pagination
Lists paginate after twenty items, meaning you'll only get twenty items back even if there are more. To see the next set of items, send a marker. The marker is a key value (in the case of instances, the ID) which is the non-inclusive starting point for all returned items.
The lists returned by the client always include a "next" property. This can be used as the "marker" argument to get the next section of the list back from the server. If no more items are available, then the next property is None.
Pagination applies to all listed objects, like instances, datastores, etc. The example below is for instances.
# There are currently 30 instances. instances = client.instances.list() print(len(instances)) print(instances.next is None) instances2 = client.instances.list(marker=instances.next) print(len(instances2)) print(instances2.next is None)
20 False 10 True
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 trove version 2.10.0.
For help on a specific trove command, enter:
$ trove help COMMAND
trove usage
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 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
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
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
usage: trove backup-delete <backup>
Deletes a backup.
Positional arguments:
- <backup>
- ID or name of the backup.
trove backup-list
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
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
usage: trove backup-show <backup>
Shows details of a backup.
Positional arguments:
- <backup>
- ID or name of the backup.
trove cluster-create
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
usage: trove cluster-delete <cluster>
Deletes a cluster.
Positional arguments:
- <cluster>
- ID or name of the cluster.
trove cluster-force-delete
usage: trove cluster-force-delete <cluster>
Force delete a cluster
Positional arguments:
- <cluster>
- ID or name of the cluster.
trove cluster-grow
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
usage: trove cluster-instances <cluster>
Lists all instances of a cluster.
Positional arguments:
- <cluster>
- ID or name of the cluster.
trove cluster-list
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
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
usage: trove cluster-reset-status <cluster>
Set the cluster task to NONE.
Positional arguments:
- <cluster>
- ID or name of the cluster.
trove cluster-show
usage: trove cluster-show <cluster>
Shows details of a cluster.
Positional arguments:
- <cluster>
- ID or name of the cluster.
trove cluster-shrink
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
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
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
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
usage: trove configuration-default <instance>
Shows the default configuration of an instance.
Positional arguments:
- <instance>
- ID or name of the instance.
trove configuration-delete
usage: trove configuration-delete <configuration_group>
Deletes a configuration group.
Positional arguments:
- <configuration_group>
- ID or name of the configuration group.
trove configuration-detach
usage: trove configuration-detach <instance>
Detaches a configuration group from an instance.
Positional arguments:
- <instance>
- ID or name of the instance.
trove configuration-instances
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
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
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
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
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
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
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
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
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
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
usage: trove database-list <instance>
Lists available databases on an instance.
Positional arguments:
- <instance>
- ID or name of the instance.
trove datastore-list
usage: trove datastore-list
Lists available datastores.
trove datastore-show
usage: trove datastore-show <datastore>
Shows details of a datastore.
Positional arguments:
- <datastore>
- ID of the datastore.
trove datastore-version-list
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
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
usage: trove delete <instance>
Deletes an instance.
Positional arguments:
- <instance>
- ID or name of the instance.
trove detach-replica
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
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
usage: trove execution-delete <execution>
Deletes an execution.
Positional arguments:
- <execution>
- Id of the execution to delete.
trove execution-list
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
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
usage: trove flavor-show <flavor>
Shows details of a flavor.
Positional arguments:
- <flavor>
- ID or name of the flavor.
trove force-delete
usage: trove force-delete <instance>
Force delete an instance.
Positional arguments:
- <instance>
- ID or name of the instance.
trove limit-list
usage: trove limit-list
Lists the limits for a tenant.
trove list
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
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
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
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
usage: trove log-list <instance>
Lists the log files available for instance.
Positional arguments:
- <instance>
- Id or Name of the instance.
trove log-publish
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
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
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
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
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
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
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
usage: trove metadata-list <instance_id>
Shows all metadata for instance <id>.
Positional arguments:
- <instance_id>
- UUID for instance.
trove metadata-show
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
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
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
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.
- 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
usage: trove module-delete <module>
Delete a module.
Positional arguments:
- <module>
- ID or name of the module.
trove module-instance-count
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
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
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
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
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
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
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
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
usage: trove module-show <module>
Shows details of a module.
Positional arguments:
- <module>
- ID or name of the module.
trove module-update
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.
- Hide this module from non-admin users. Useful in creating auto-apply modules without cluttering up module lists. Admin only.
- 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
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
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
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
usage: trove reset-status <instance>
Set the status to NONE.
Positional arguments:
- <instance>
- ID or name of the instance.
trove resize-instance
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
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
usage: trove restart <instance>
Restarts an instance.
Positional arguments:
- <instance>
- ID or name of the instance.
trove root-disable
usage: trove root-disable <instance>
Disables root for an instance.
Positional arguments:
- <instance>
- ID or name of the instance.
trove root-enable
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
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
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
usage: trove schedule-delete <schedule id>
Deletes a schedule.
Positional arguments:
- <schedule id>
- Id of the schedule.
trove schedule-list
usage: trove schedule-list <instance>
Lists scheduled backups for an instance.
Positional arguments:
- <instance>
- ID or name of the instance.
trove schedule-show
usage: trove schedule-show <schedule id>
Shows details of a schedule.
Positional arguments:
- <schedule id>
- Id of the schedule.
trove secgroup-add-rule
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
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
usage: trove secgroup-list
Lists all security groups.
trove secgroup-list-rules
usage: trove secgroup-list-rules <security_group>
Lists all rules for a security group.
Positional arguments:
- <security_group>
- Security group ID.
trove secgroup-show
usage: trove secgroup-show <security_group>
Shows details of a security group.
Positional arguments:
- <security_group>
- Security group ID.
trove show
usage: trove show <instance>
Shows details of an instance.
Positional arguments:
- <instance>
- ID or name of the instance.
trove update
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
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
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
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
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
usage: trove user-list <instance>
Lists the users for an instance.
Positional arguments:
- <instance>
- ID or name of the instance.
trove user-revoke-access
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
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
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
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
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
usage: trove volume-type-show <volume_type>
Shows details of a volume type.
Positional arguments:
- <volume_type>
- ID or name of the volume type.
troveclient Reference Guide
troveclient
troveclient package
Subpackages
troveclient.apiclient package
Submodules
troveclient.apiclient.auth module
- class troveclient.apiclient.auth.BaseAuthPlugin(auth_system=None, **kwargs)
- Bases: object
Base class for authentication plugins.
An authentication plugin needs to override at least the authenticate method to be a valid plugin.
- classmethod add_common_opts(parser)
- Add options that are common for several plugins.
- classmethod add_opts(parser)
- Populate the parser with the options for this plugin.
- auth_system = None
- authenticate(http_client)
- Authenticate using plugin defined method.
The method usually analyses self.opts and performs a request to authentication server.
- Parameters
- http_client (troveclient.client.HTTPClient) -- client object that needs authentication
- Raises
- AuthorizationFailure
- common_opt_names = ['auth_system', 'username', 'password', 'tenant_name', 'token', 'auth_url']
- static get_opt(opt_name, args)
- Return option name and value.
- Parameters
- opt_name -- name of the option, e.g., "username"
- args -- parsed arguments
- opt_names = []
- parse_opts(args)
- Parse the actual auth-system options if any.
This method is expected to populate the attribute self.opts with a dict containing the options and values needed to make authentication.
- sufficient_options()
- Check if all required options are present.
- Raises
- AuthPluginOptionsMissing
- abstract token_and_endpoint(endpoint_type, service_type)
- Return token and endpoint.
- Parameters
- service_type (string) -- Service type of the endpoint
- endpoint_type (string) -- Type of endpoint. Possible values: public or publicURL, internal or internalURL, admin or adminURL
- Returns
- tuple of token and endpoint strings
- Raises
- EndpointException
- troveclient.apiclient.auth.discover_auth_systems()
- Discover the available auth-systems.
This won't take into account the old style auth-systems.
- troveclient.apiclient.auth.load_auth_system_opts(parser)
- Load options needed by the available auth-systems into a parser.
This function will try to populate the parser with options from the available plugins.
- troveclient.apiclient.auth.load_plugin(auth_system)
- troveclient.apiclient.auth.load_plugin_from_args(args)
- Load required plugin and populate it with options.
Try to guess auth system if it is not specified. Systems are tried in alphabetical order.
- Raises
- AuthPluginOptionsMissing
troveclient.apiclient.base module
Base utilities to build API operation managers and objects on top of.
- class troveclient.apiclient.base.BaseManager(client)
- Bases: troveclient.apiclient.base.HookableMixin
Basic manager type providing common operations.
Managers interact with a particular type of API (servers, flavors, images, etc.) and provide CRUD operations for them.
- resource_class = None
- class troveclient.apiclient.base.CrudManager(client)
- Bases: troveclient.apiclient.base.BaseManager
Base manager class for manipulating entities.
Children of this class are expected to define a collection_key and key.
- collection_key: Usually a plural noun by convention (e.g. entities); used to refer collections in both URL's (e.g. /v3/entities) and JSON objects containing a list of member resources (e.g. {'entities': [{}, {}, {}]}).
- key: Usually a singular noun by convention (e.g. entity); used to refer to an individual member of the collection.
- build_url(base_url=None, **kwargs)
- Builds a resource URL for the given kwargs.
Given an example collection where collection_key = 'entities' and key = 'entity', the following URL's could be generated.
By default, the URL will represent a collection of entities, e.g.:
/entities
If kwargs contains an entity_id, then the URL will represent a specific member, e.g.:
/entities/{entity_id}
- Parameters
- base_url -- if provided, the generated URL will be appended to it
- collection_key = None
- create(**kwargs)
- delete(**kwargs)
- find(base_url=None, **kwargs)
- Find a single item with attributes matching **kwargs.
- Parameters
- base_url -- if provided, the generated URL will be appended to it
- get(**kwargs)
- head(**kwargs)
- key = None
- list(base_url=None, **kwargs)
- List the collection.
- Parameters
- base_url -- if provided, the generated URL will be appended to it
- put(base_url=None, **kwargs)
- Update an element.
- Parameters
- base_url -- if provided, the generated URL will be appended to it
- update(**kwargs)
- class troveclient.apiclient.base.Extension(name, module)
- Bases: troveclient.apiclient.base.HookableMixin
Extension descriptor.
- SUPPORTED_HOOKS = ('__pre_parse_args__', '__post_parse_args__')
- manager_class = None
- class troveclient.apiclient.base.HookableMixin
- Bases: object
Mixin so classes can register and run hooks.
- classmethod add_hook(hook_type, hook_func)
- Add a new hook of specified type.
- Parameters
- cls -- class that registers hooks
- hook_type -- hook type, e.g., '__pre_parse_args__'
- hook_func -- hook function
- classmethod run_hooks(hook_type, *args, **kwargs)
- Run all hooks of specified type.
- Parameters
- cls -- class that registers hooks
- hook_type -- hook type, e.g., '__pre_parse_args__'
- args -- args to be passed to every hook function
- kwargs -- kwargs to be passed to every hook function
- class troveclient.apiclient.base.ManagerWithFind(client)
- Bases: troveclient.apiclient.base.BaseManager
Manager with additional find()/findall() methods.
- find(**kwargs)
- Find a single item with attributes matching **kwargs.
This isn't very efficient: it loads the entire list then filters on the Python side.
- findall(**kwargs)
- Find all items with attributes matching **kwargs.
This isn't very efficient: it loads the entire list then filters on the Python side.
- abstract list()
- class troveclient.apiclient.base.Resource(manager, info, loaded=False)
- Bases: object
Base class for OpenStack resources (tenant, user, etc.).
This is pretty much just a bag for attributes.
- HUMAN_ID = False
- NAME_ATTR = 'name'
- property human_id
- Human-readable ID which can be used for bash completion.
- property is_loaded
- to_dict()
- troveclient.apiclient.base.getid(obj)
- Return id if argument is a Resource.
Abstracts the common pattern of allowing both an object or an object's ID (UUID) as a parameter when dealing with relationships.
troveclient.apiclient.client module
OpenStack Client interface. Handles the REST calls and responses.
- class troveclient.apiclient.client.BaseClient(http_client, extensions=None)
- Bases: object
Top-level object to access the OpenStack API.
This client uses HTTPClient to send requests. HTTPClient will handle a bunch of issues such as authentication.
- cached_endpoint = None
- client_request(method, url, **kwargs)
- delete(url, **kwargs)
- endpoint_type = None
- get(url, **kwargs)
- static get_class(api_name, version, version_map)
- Returns the client class for the requested API version
- Parameters
- api_name -- the name of the API, e.g. 'compute', 'image', etc
- version -- the requested API version
- version_map -- a dict of client classes keyed by version
- Return type
- a client class for the requested API version
- head(url, **kwargs)
- patch(url, **kwargs)
- post(url, **kwargs)
- put(url, **kwargs)
- service_type = None
- class troveclient.apiclient.client.HTTPClient(auth_plugin, region_name=None, endpoint_type='publicURL', original_ip=None, verify=True, cert=None, timeout=None, timings=False, keyring_saver=None, debug=False, user_agent=None, http=None)
- Bases: object
This client handles sending HTTP requests to OpenStack servers.
Features:
- share authentication information between several clients to different services (e.g., for compute and image clients);
- reissue authentication request for expired tokens;
- encode/decode JSON bodies;
- raise exceptions on HTTP errors;
- pluggable authentication;
- store authentication information in a keyring;
- store time spent for requests;
- register clients for particular services, so one can use http_client.identity or http_client.compute;
- log requests and responses in a format that is easy to copy-and-paste into terminal and send the same request with curl.
- add_client(base_client_instance)
- Add a new instance of BaseClient descendant.
self will store a reference to base_client_instance.
Example:
>>> def test_clients(): ... from keystoneclient.auth import keystone ... from openstack.common.apiclient import client ... auth = keystone.KeystoneAuthPlugin( ... username="user", password="pass", tenant_name="tenant", ... auth_url="http://auth:5000/v2.0") ... openstack_client = client.HTTPClient(auth) ... # create nova client ... from novaclient.v1_1 import client ... client.Client(openstack_client) ... # create keystone client ... from keystoneclient.v2_0 import client ... client.Client(openstack_client) ... # use them ... openstack_client.identity.tenants.list() ... openstack_client.compute.servers.list()
- authenticate()
- client_request(client, method, url, **kwargs)
- Send an http request using client's endpoint and specified
url.
If request was rejected as unauthorized (possibly because the token is expired), issue one authorization attempt and send the request once again.
- Parameters
- client -- instance of BaseClient descendant
- method -- method of HTTP request
- url -- URL of HTTP request
- kwargs -- any other parameter that can be passed to HTTPClient.request
- static concat_url(endpoint, url)
- Concatenate endpoint and final URL.
E.g., "http://keystone/v2.0/" and "/tokens" are concatenated to "http://keystone/v2.0/tokens".
- Parameters
- endpoint -- the base URL
- url -- the final URL
- get_timings()
- request(method, url, **kwargs)
- Send an http request with the specified characteristics.
Wrapper around requests.Session.request to handle tasks such as setting headers, JSON encoding/decoding, and error handling.
- Parameters
- method -- method of HTTP request
- url -- URL of HTTP request
- kwargs -- any other parameter that can be passed to requests.Session.request (such as headers) or json that will be encoded as JSON and used as data argument
- reset_timings()
- serialize(kwargs)
- user_agent = 'troveclient.apiclient'
troveclient.apiclient.exceptions module
Exception definitions.
- exception troveclient.apiclient.exceptions.AmbiguousEndpoints(endpoints=None)
- Bases: troveclient.apiclient.exceptions.EndpointException
Found more than one matching endpoint in Service Catalog.
- exception troveclient.apiclient.exceptions.AuthPluginOptionsMissing(opt_names)
- Bases: troveclient.apiclient.exceptions.AuthorizationFailure
Auth plugin misses some options.
- exception troveclient.apiclient.exceptions.AuthSystemNotFound(auth_system)
- Bases: troveclient.apiclient.exceptions.AuthorizationFailure
User has specified a AuthSystem that is not installed.
- exception troveclient.apiclient.exceptions.AuthorizationFailure
- Bases: troveclient.apiclient.exceptions.ClientException
Cannot authorize API client.
- exception troveclient.apiclient.exceptions.BadGateway(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HttpServerError
HTTP 502 - Bad Gateway.
The server was acting as a gateway or proxy and received an invalid response from the upstream server.
- http_status = 502
- message = 'Bad Gateway'
- exception troveclient.apiclient.exceptions.BadRequest(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HTTPClientError
HTTP 400 - Bad Request.
The request cannot be fulfilled due to bad syntax.
- http_status = 400
- message = 'Bad Request'
- exception troveclient.apiclient.exceptions.ClientException
- Bases: Exception
The base exception class for all exceptions this library raises.
- exception troveclient.apiclient.exceptions.CommandError
- Bases: troveclient.apiclient.exceptions.ClientException
Error in CLI tool.
- exception troveclient.apiclient.exceptions.Conflict(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HTTPClientError
HTTP 409 - Conflict.
Indicates that the request could not be processed because of conflict in the request, such as an edit conflict.
- http_status = 409
- message = 'Conflict'
- exception troveclient.apiclient.exceptions.ConnectionRefused
- Bases: troveclient.apiclient.exceptions.ClientException
Cannot connect to API service.
- exception troveclient.apiclient.exceptions.EndpointException
- Bases: troveclient.apiclient.exceptions.ClientException
Something is rotten in Service Catalog.
- exception troveclient.apiclient.exceptions.EndpointNotFound
- Bases: troveclient.apiclient.exceptions.EndpointException
Could not find requested endpoint in Service Catalog.
- exception troveclient.apiclient.exceptions.ExpectationFailed(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HTTPClientError
HTTP 417 - Expectation Failed.
The server cannot meet the requirements of the Expect request-header field.
- http_status = 417
- message = 'Expectation Failed'
- exception troveclient.apiclient.exceptions.Forbidden(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HTTPClientError
HTTP 403 - Forbidden.
The request was a valid request, but the server is refusing to respond to it.
- http_status = 403
- message = 'Forbidden'
- exception troveclient.apiclient.exceptions.GatewayTimeout(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HttpServerError
HTTP 504 - Gateway Timeout.
The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.
- http_status = 504
- message = 'Gateway Timeout'
- exception troveclient.apiclient.exceptions.Gone(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HTTPClientError
HTTP 410 - Gone.
Indicates that the resource requested is no longer available and will not be available again.
- http_status = 410
- message = 'Gone'
- exception troveclient.apiclient.exceptions.HTTPClientError(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HttpError
Client-side HTTP error.
Exception for cases in which the client seems to have erred.
- message = 'HTTP Client Error'
- exception troveclient.apiclient.exceptions.HttpError(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.ClientException
The base exception class for all HTTP exceptions.
- http_status = 0
- message = 'HTTP Error'
- exception troveclient.apiclient.exceptions.HttpNotImplemented(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HttpServerError
HTTP 501 - Not Implemented.
The server either does not recognize the request method, or it lacks the ability to fulfill the request.
- http_status = 501
- message = 'Not Implemented'
- exception troveclient.apiclient.exceptions.HttpServerError(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HttpError
Server-side HTTP error.
Exception for cases in which the server is aware that it has erred or is incapable of performing the request.
- message = 'HTTP Server Error'
- exception troveclient.apiclient.exceptions.HttpVersionNotSupported(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HttpServerError
HTTP 505 - HttpVersion Not Supported.
The server does not support the HTTP protocol version used in the request.
- http_status = 505
- message = 'HTTP Version Not Supported'
- exception troveclient.apiclient.exceptions.InternalServerError(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HttpServerError
HTTP 500 - Internal Server Error.
A generic error message, given when no more specific message is suitable.
- http_status = 500
- message = 'Internal Server Error'
- exception troveclient.apiclient.exceptions.LengthRequired(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HTTPClientError
HTTP 411 - Length Required.
The request did not specify the length of its content, which is required by the requested resource.
- http_status = 411
- message = 'Length Required'
- exception troveclient.apiclient.exceptions.MethodNotAllowed(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HTTPClientError
HTTP 405 - Method Not Allowed.
A request was made of a resource using a request method not supported by that resource.
- http_status = 405
- message = 'Method Not Allowed'
- exception troveclient.apiclient.exceptions.MissingArgs(missing, message=None)
- Bases: troveclient.apiclient.exceptions.ClientException
Supplied arguments are not sufficient for calling a function.
- exception troveclient.apiclient.exceptions.NoUniqueMatch
- Bases: troveclient.apiclient.exceptions.ClientException
Multiple entities found instead of one.
- exception troveclient.apiclient.exceptions.NotAcceptable(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HTTPClientError
HTTP 406 - Not Acceptable.
The requested resource is only capable of generating content not acceptable according to the Accept headers sent in the request.
- http_status = 406
- message = 'Not Acceptable'
- exception troveclient.apiclient.exceptions.NotFound(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HTTPClientError
HTTP 404 - Not Found.
The requested resource could not be found but may be available again in the future.
- http_status = 404
- message = 'Not Found'
- exception troveclient.apiclient.exceptions.PaymentRequired(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HTTPClientError
HTTP 402 - Payment Required.
Reserved for future use.
- http_status = 402
- message = 'Payment Required'
- exception troveclient.apiclient.exceptions.PreconditionFailed(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HTTPClientError
HTTP 412 - Precondition Failed.
The server does not meet one of the preconditions that the requester put on the request.
- http_status = 412
- message = 'Precondition Failed'
- exception troveclient.apiclient.exceptions.ProxyAuthenticationRequired(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HTTPClientError
HTTP 407 - Proxy Authentication Required.
The client must first authenticate itself with the proxy.
- http_status = 407
- message = 'Proxy Authentication Required'
- exception troveclient.apiclient.exceptions.RequestEntityTooLarge(*args, **kwargs)
- Bases: troveclient.apiclient.exceptions.HTTPClientError
HTTP 413 - Request Entity Too Large.
The request is larger than the server is willing or able to process.
- http_status = 413
- message = 'Request Entity Too Large'
- exception troveclient.apiclient.exceptions.RequestTimeout(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HTTPClientError
HTTP 408 - Request Timeout.
The server timed out waiting for the request.
- http_status = 408
- message = 'Request Timeout'
- exception troveclient.apiclient.exceptions.RequestUriTooLong(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HTTPClientError
HTTP 414 - Request-URI Too Long.
The URI provided was too long for the server to process.
- http_status = 414
- message = 'Request-URI Too Long'
- exception troveclient.apiclient.exceptions.RequestedRangeNotSatisfiable(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HTTPClientError
HTTP 416 - Requested Range Not Satisfiable.
The client has asked for a portion of the file, but the server cannot supply that portion.
- http_status = 416
- message = 'Requested Range Not Satisfiable'
- exception troveclient.apiclient.exceptions.ServiceUnavailable(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HttpServerError
HTTP 503 - Service Unavailable.
The server is currently unavailable.
- http_status = 503
- message = 'Service Unavailable'
- exception troveclient.apiclient.exceptions.Unauthorized(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HTTPClientError
HTTP 401 - Unauthorized.
Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet been provided.
- http_status = 401
- message = 'Unauthorized'
- exception troveclient.apiclient.exceptions.UnprocessableEntity(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HTTPClientError
HTTP 422 - Unprocessable Entity.
The request was well-formed but was unable to be followed due to semantic errors.
- http_status = 422
- message = 'Unprocessable Entity'
- exception troveclient.apiclient.exceptions.UnsupportedMediaType(message=None, details=None, response=None, request_id=None, url=None, method=None, http_status=None)
- Bases: troveclient.apiclient.exceptions.HTTPClientError
HTTP 415 - Unsupported Media Type.
The request entity has a media type which the server or resource does not support.
- http_status = 415
- message = 'Unsupported Media Type'
- exception troveclient.apiclient.exceptions.UnsupportedVersion
- Bases: troveclient.apiclient.exceptions.ClientException
User is trying to use an unsupported version of the API.
- exception troveclient.apiclient.exceptions.ValidationError
- Bases: troveclient.apiclient.exceptions.ClientException
Error in validation on API client side.
- troveclient.apiclient.exceptions.from_response(response, method, url)
- Returns an instance of HttpError or subclass based on response.
- Parameters
- response -- instance of requests.Response class
- method -- HTTP method used for request
- url -- URL used for request
Module contents
troveclient.compat package
Submodules
troveclient.compat.auth module
- class troveclient.compat.auth.Auth1_1(client, type, url, username, password, tenant, region=None, service_type=None, service_name=None, service_url=None)
- Bases: troveclient.compat.auth.Authenticator
- authenticate()
- Authenticate against a v2.0 auth service.
- class troveclient.compat.auth.Authenticator(client, type, url, username, password, tenant, region=None, service_type=None, service_name=None, service_url=None)
- Bases: object
Helper class to perform Keystone or other miscellaneous authentication.
The "authenticate" method returns a ServiceCatalog, which can be used to obtain a token.
- URL_REQUIRED = True
- authenticate()
- class troveclient.compat.auth.FakeAuth(client, type, url, username, password, tenant, region=None, service_type=None, service_name=None, service_url=None)
- Bases: troveclient.compat.auth.Authenticator
Useful for faking auth.
- authenticate()
- class troveclient.compat.auth.KeyStoneV2Authenticator(client, type, url, username, password, tenant, region=None, service_type=None, service_name=None, service_url=None)
- Bases: troveclient.compat.auth.Authenticator
- authenticate()
- class troveclient.compat.auth.KeyStoneV3Authenticator(client, type, url, username, password, tenant, region=None, service_type=None, service_name=None, service_url=None)
- Bases: troveclient.compat.auth.Authenticator
- authenticate()
- class troveclient.compat.auth.ServiceCatalog(resource_dict, region=None, service_type=None, service_name=None, service_url=None, root_key='access')
- Bases: object
Represents a Keystone Service Catalog which describes a service.
This class has methods to obtain a valid token as well as a public service url and a management url.
- get_management_url()
- get_public_url()
- get_token()
- class troveclient.compat.auth.ServiceCatalog3(resource_dict, region=None, service_type=None, service_name=None, service_url=None, token=None)
- Bases: object
Represents a Keystone Service Catalog which describes a service.
This class has methods to obtain a valid token as well as a public service url and a management url.
- get_management_url()
- get_public_url()
- get_token()
- troveclient.compat.auth.get_authenticator_cls(cls_or_name)
- Factory method to retrieve Authenticator class.
troveclient.compat.base module
Base utilities to build API operation managers and objects on top of.
- class troveclient.compat.base.Manager(api)
- Bases: troveclient.compat.utils.HookableMixin
Manager defining CRUD operations for API.
Managers interact with a particular type of API (servers, flavors, images, etc.) and provide CRUD operations for them.
- completion_cache(cache_type, obj_class, mode)
- Bash-completion cache.
The completion cache store items that can be used for bash autocompletion, like UUIDs or human-friendly IDs.
A resource listing will clear and repopulate the cache.
A resource create will append to the cache.
Delete is not handled because listings are assumed to be performed often enough to keep the cache reasonably up-to-date.
- resource_class = None
- write_to_completion_cache(cache_type, val)
- class troveclient.compat.base.ManagerWithFind(api)
- Bases: troveclient.compat.base.Manager
Like a Manager, but with additional find()/findall() methods.
- find(**kwargs)
- Find a single item with attributes matching **kwargs.
This isn't very efficient: it loads the entire list then filters on the Python side.
- findall(**kwargs)
- Find all items with attributes matching **kwargs.
This isn't very efficient: it loads the entire list then filters on the Python side.
- list()
- class troveclient.compat.base.Resource(manager, info, loaded=False)
- Bases: object
A resource represents a particular instance of an object like server.
This is pretty much just a bag for attributes. :param manager: Manager object :param info: dictionary representing resource attributes :param loaded: prevent lazy-loading if set to True
- HUMAN_ID = False
- get()
- property human_id
- Provides a pretty ID which can be used for bash completion.
- is_loaded()
- set_loaded(val)
- troveclient.compat.base.getid(obj)
- Retrives an id from object or integer.
Abstracts the common pattern of allowing both an object or an object's ID as a parameter when dealing with relationships.
troveclient.compat.cli module
Trove Command line tool
- class troveclient.compat.cli.BackupsCommands(parser)
- Bases: troveclient.compat.common.AuthedCommandsBase
Command to manage and show backups.
- create()
- Create a new backup.
- delete()
- Delete a backup.
- get()
- Get details for the specified backup.
- list()
- List backups.
- params = ['name', 'instance', 'description']
- class troveclient.compat.cli.ConfigurationsCommands(parser)
- Bases: troveclient.compat.common.AuthedCommandsBase
Command to manage and show configurations.
- create()
- Create a new configuration.
- delete()
- Delete a configuration.
- edit()
- Edit an existing configuration values.
- get()
- Get details for the specified configuration.
- list()
- List configurations.
- list_instances()
- Get details for the specified configuration.
- params = ['name', 'instances', 'values', 'description', 'parameter']
- update()
- Update an existing configuration.
- class troveclient.compat.cli.DatabaseCommands(parser)
- Bases: troveclient.compat.common.AuthedCommandsBase
Database CRUD operations on an instance.
- create()
- Create a database.
- delete()
- Delete a database.
- list()
- List the databases.
- params = ['name', 'id', 'limit', 'marker']
- class troveclient.compat.cli.DatastoreConfigurationParameters(parser)
- Bases: troveclient.compat.common.AuthedCommandsBase
Command to show configuration parameters for a datastore.
- get_parameter()
- List parameters that can be set.
- parameters()
- List parameters that can be set.
- params = ['datastore', 'parameter']
- class troveclient.compat.cli.FlavorsCommands(parser)
- Bases: troveclient.compat.common.AuthedCommandsBase
Command for listing Flavors.
- list()
- List the available flavors.
- params = []
- class troveclient.compat.cli.InstanceCommands(parser)
- Bases: troveclient.compat.common.AuthedCommandsBase
Commands to perform various instance operations and actions.
- backups()
- Get a list of backups for the specified instance.
- configuration()
- Get configuration for the specified instance.
- create()
- Create a new instance.
- delete()
- Delete the specified instance.
- get()
- Get details for the specified instance.
- list()
- List all instances for account.
- modify()
- Modify an instance.
- params = ['flavor', 'id', 'limit', 'marker', 'name', 'size', 'backup', 'availability_zone', 'configuration_id']
- resize_instance()
- Resize an instance flavor
- resize_volume()
- Resize an instance volume.
- restart()
- Restart the database.
- class troveclient.compat.cli.LimitsCommands(parser)
- Bases: troveclient.compat.common.AuthedCommandsBase
Show the rate limits and absolute limits.
- list()
- List the rate limits and absolute limits.
- class troveclient.compat.cli.MetadataCommands(parser)
- Bases: troveclient.compat.common.AuthedCommandsBase
Commands to create/update/replace/delete/show metadata for an instance
- params = ['instance_id', 'metadata']
- show()
- Show instance metadata.
- class troveclient.compat.cli.RootCommands(parser)
- Bases: troveclient.compat.common.AuthedCommandsBase
Root user related operations on an instance.
- create()
- Enable the instance's root user.
- delete()
- Disable the instance's root user.
- enabled()
- Check the instance for root access.
- params = ['id']
- class troveclient.compat.cli.SecurityGroupCommands(parser)
- Bases: troveclient.compat.common.AuthedCommandsBase
Commands to list and show Security Groups For an Instance and create and delete security group rules for them.
- add_rule()
- Add a security group rule.
- delete_rule()
- Delete a security group rule.
- get()
- Get a security group associated with an instance.
- list()
- List all the Security Groups and the rules.
- params = ['id', 'secgroup_id', 'protocol', 'from_port', 'to_port', 'cidr']
- class troveclient.compat.cli.UserCommands(parser)
- Bases: troveclient.compat.common.AuthedCommandsBase
User CRUD operations on an instance.
- access()
- Show all databases the user has access to.
- change_password()
- Change the password of a single user.
- create()
- Create a user in instance, with access to one or more databases.
- delete()
- Delete the specified user
- get()
- Get a single user.
- grant()
- Allow an existing user permissions to access one or more databases.
- list()
- List all the users for an instance.
- params = ['id', 'database', 'databases', 'hostname', 'name', 'password', 'new_name', 'new_host', 'new_password']
- revoke()
- Revoke from an existing user access permissions to a database.
- update_attributes()
- Update attributes of a single user.
- class troveclient.compat.cli.VersionCommands(parser)
- Bases: troveclient.compat.common.AuthedCommandsBase
List available versions.
- list()
- List all the supported versions.
- params = ['url']
- troveclient.compat.cli.main()
troveclient.compat.client module
- class troveclient.compat.client.Dbaas(username, api_key, tenant=None, auth_url=None, service_type='database', service_name=None, service_url=None, insecure=False, auth_strategy='keystone', region_name=None, client_cls=<class 'troveclient.compat.client.TroveHTTPClient'>)
- Bases: object
Top-level object to access the Rackspace Database as a Service API.
Create an instance with your creds:
>> red = Dbaas(USERNAME, API_KEY, TENANT, AUTH_URL, SERVICE_NAME, SERVICE_URL)
Then call methods on its managers:
>> red.instances.list() ... >> red.flavors.list() ...
&c.
- authenticate()
- Authenticate against the server.
This is called to perform an authentication to retrieve a token.
Returns on success; raises exceptions.Unauthorized if the credentials are wrong.
- get_timings()
- set_management_url(url)
- class troveclient.compat.client.TroveHTTPClient(user, password, tenant, auth_url, service_name, service_url=None, auth_strategy=None, insecure=False, timeout=None, proxy_tenant_id=None, proxy_token=None, region_name=None, endpoint_type='publicURL', service_type=None, timings=False)
- Bases: httplib2.Http
- USER_AGENT = 'python-troveclient'
- authenticate()
- Auths the client and gets a token. May optionally set a service url.
The client will get auth errors until the authentication step occurs. Additionally, if a service_url was not explicitly given in the clients __init__ method, one will be obtained from the auth service.
- authenticate_with_token(token, service_url=None)
- delete(url, **kwargs)
- get(url, **kwargs)
- get_timings()
- http_log(args, kwargs, resp, body)
- morph_request(kwargs)
- morph_response_body(raw_body)
- patch(url, **kwargs)
- post(url, **kwargs)
- pretty_log(args, kwargs, resp, body)
- put(url, **kwargs)
- raise_error_from_status(resp, body)
- request(*args, **kwargs)
- Performs a single HTTP request. The 'uri' is the URI of the HTTP resource
and can begin with either 'http' or 'https'. The value of 'uri' must be an
absolute URI.
The 'method' is the HTTP method to perform, such as GET, POST, DELETE, etc. There is no restriction on the methods allowed.
The 'body' is the entity body to be sent with the request. It is a string object.
Any extra headers that are to be sent with the request should be provided in the 'headers' dictionary.
The maximum number of redirect to follow before raising an exception is 'redirections. The default is 5.
The return value is a tuple of (response, content), the first being and instance of the 'Response' class, the second being a string that contains the response entity body.
- simple_log(args, kwargs, resp, body)
- troveclient.compat.client.log_to_streamhandler(stream=None)
troveclient.compat.common module
- exception troveclient.compat.common.ArgumentRequired(param)
- Bases: Exception
- exception troveclient.compat.common.ArgumentsRequired(*params)
- Bases: troveclient.compat.common.ArgumentRequired
- class troveclient.compat.common.Auth(parser)
- Bases: troveclient.compat.common.CommandsBase
Authenticate with your username and api key.
- login()
- Login to retrieve an auth token to use for other api calls.
- params = ['apikey', 'auth_strategy', 'auth_type', 'auth_url', 'options', 'region', 'service_name', 'service_type', 'service_url', 'tenant_id', 'username']
- class troveclient.compat.common.AuthedCommandsBase(parser)
- Bases: troveclient.compat.common.CommandsBase
Commands that work only with an authenticated client.
- class troveclient.compat.common.CliOptions(**kwargs)
- Bases: object
A token object containing the user, apikey and token which is pickleable.
- APITOKEN = '/usr/src/.apitoken'
- DEFAULT_VALUES = {'apikey': None, 'auth_type': 'keystone', 'auth_url': None, 'debug': False, 'insecure': False, 'region': 'RegionOne', 'service_name': '', 'service_type': 'database', 'service_url': None, 'tenant_id': None, 'token': None, 'username': None, 'verbose': False}
- classmethod create_optparser(load_file)
- classmethod default()
- classmethod load_from_file()
- classmethod save_from_instance_fields(instance)
- class troveclient.compat.common.CommandsBase(parser)
- Bases: object
- params = []
- class troveclient.compat.common.Paginated(items=None, next_marker=None, links=None)
- Bases: object
Pretends to be a list if you iterate over it, but also keeps a next property you can use to get the next page of data.
- troveclient.compat.common.check_for_exceptions(resp, body)
- troveclient.compat.common.limit_url(url, limit=None, marker=None)
- troveclient.compat.common.methods_of(obj)
- Get all callable methods of an object that don't start with underscore returns a list of tuples of the form (method_name, method).
- troveclient.compat.common.print_actions(cmd, actions)
- Print help for the command with list of options and description.
- troveclient.compat.common.print_commands(commands)
- Print the list of available commands and description.
- troveclient.compat.common.quote_user_host(user, host)
troveclient.compat.exceptions module
- exception troveclient.compat.exceptions.AmbiguousEndpoints(endpoints=None)
- Bases: Exception
Found more than one matching endpoint in Service Catalog.
- exception troveclient.compat.exceptions.AuthUrlNotGiven
- Bases: troveclient.compat.exceptions.EndpointNotFound
The auth url was not given.
- exception troveclient.compat.exceptions.AuthorizationFailure
- Bases: Exception
- exception troveclient.compat.exceptions.BadRequest(code, message=None, details=None, request_id=None)
- Bases: troveclient.compat.exceptions.ClientException
HTTP 400 - Bad request: you sent some malformed data.
- http_status = 400
- message = 'Bad request'
- exception troveclient.compat.exceptions.ClientException(code, message=None, details=None, request_id=None)
- Bases: Exception
The base exception class for all exceptions this library raises.
- exception troveclient.compat.exceptions.CommandError
- Bases: Exception
- exception troveclient.compat.exceptions.Conflict(code, message=None, details=None, request_id=None)
- Bases: troveclient.compat.exceptions.ClientException
HTTP 409 - Conflict.
- http_status = 409
- message = 'Conflict'
- exception troveclient.compat.exceptions.EndpointNotFound
- Bases: Exception
Could not find Service or Region in Service Catalog.
- exception troveclient.compat.exceptions.Forbidden(code, message=None, details=None, request_id=None)
- Bases: troveclient.compat.exceptions.ClientException
HTTP 403 - Forbidden: your don't have access to this resource.
- http_status = 403
- message = 'Forbidden'
- exception troveclient.compat.exceptions.HTTPNotImplemented(code, message=None, details=None, request_id=None)
- Bases: troveclient.compat.exceptions.ClientException
HTTP 501 - Not Implemented: the server does not support this operation.
- http_status = 501
- message = 'Not Implemented'
- exception troveclient.compat.exceptions.NoTokenLookupException
- Bases: Exception
This form of authentication does not support looking up endpoints from an existing token.
- exception troveclient.compat.exceptions.NoUniqueMatch
- Bases: Exception
- exception troveclient.compat.exceptions.NotFound(code, message=None, details=None, request_id=None)
- Bases: troveclient.compat.exceptions.ClientException
HTTP 404 - Not found.
- http_status = 404
- message = 'Not found'
- exception troveclient.compat.exceptions.OverLimit(code, message=None, details=None, request_id=None)
- Bases: troveclient.compat.exceptions.ClientException
HTTP 413 - Over limit: you're over the API limits for this time period.
- http_status = 413
- message = 'Over limit'
- exception troveclient.compat.exceptions.ResponseFormatError
- Bases: Exception
Could not parse the response format.
- exception troveclient.compat.exceptions.ServiceUrlNotGiven
- Bases: troveclient.compat.exceptions.EndpointNotFound
The service url was not given.
- exception troveclient.compat.exceptions.Unauthorized(code, message=None, details=None, request_id=None)
- Bases: troveclient.compat.exceptions.ClientException
HTTP 401 - Unauthorized: bad credentials.
- http_status = 401
- message = 'Unauthorized'
- exception troveclient.compat.exceptions.UnprocessableEntity(code, message=None, details=None, request_id=None)
- Bases: troveclient.compat.exceptions.ClientException
HTTP 422 - Unprocessable Entity: The request cannot be processed.
- http_status = 422
- message = 'Unprocessable Entity'
- exception troveclient.compat.exceptions.UnsupportedVersion
- Bases: Exception
Indicates that the user is trying to use an unsupported version of the API.
- troveclient.compat.exceptions.from_response(response, body)
- Return an instance of an ClientException based on a request's response.
Usage:
resp, body = http.request(...) if resp.status != 200:
raise exception_from_response(resp, body)
troveclient.compat.mcli module
Trove Management Command line tool
- class troveclient.compat.mcli.AccountCommands(parser)
- Bases: troveclient.compat.common.AuthedCommandsBase
Commands to list account info.
- get()
- List details for the account provided.
- list()
- List all accounts with non-deleted instances.
- params = ['id']
- class troveclient.compat.mcli.FlavorsCommands(parser)
- Bases: troveclient.compat.common.AuthedCommandsBase
Commands for managing Flavors.
- create()
- Create a new flavor.
- params = ['name', 'ram', 'disk', 'vcpus', 'flavor_id', 'ephemeral', 'swap', 'rxtx_factor', 'service_type']
- class troveclient.compat.mcli.HostCommands(parser)
- Bases: troveclient.compat.common.AuthedCommandsBase
Commands to list info on hosts.
- get()
- List details for the specified host.
- list()
- List all compute hosts.
- params = ['name']
- update_all()
- Update all instances on a host.
- class troveclient.compat.mcli.InstanceCommands(parser)
- Bases: troveclient.compat.common.AuthedCommandsBase
List details about an instance.
- diagnostic()
- List diagnostic details about an instance.
- get()
- List details for the instance.
- hwinfo()
- Show hardware information details about an instance.
- list()
- List all instances for account.
- migrate()
- Migrate the instance.
- params = ['deleted', 'id', 'limit', 'marker', 'host']
- reboot()
- Reboot the instance.
- reset_task_status()
- Set the instance's task status to NONE.
- stop()
- Stop MySQL on the given instance.
- class troveclient.compat.mcli.QuotaCommands(parser)
- Bases: troveclient.compat.common.AuthedCommandsBase
List and update quota limits for a tenant.
- list()
- List all quotas for a tenant.
- params = ['id', 'instances', 'volumes', 'backups']
- update()
- Update quota limits for a tenant.
- class troveclient.compat.mcli.RootCommands(parser)
- Bases: troveclient.compat.common.AuthedCommandsBase
List details about the root info for an instance.
- history()
- List root history for the instance.
- params = ['id']
- class troveclient.compat.mcli.StorageCommands(parser)
- Bases: troveclient.compat.common.AuthedCommandsBase
Commands to list devices info.
- list()
- List details for the storage device.
- params = []
- troveclient.compat.mcli.config_options(oparser)
- troveclient.compat.mcli.main()
troveclient.compat.utils module
- class troveclient.compat.utils.HookableMixin
- Bases: object
Mixin so classes can register and run hooks.
- classmethod add_hook(hook_type, hook_func)
- classmethod run_hooks(hook_type, *args, **kwargs)
- troveclient.compat.utils.env(*vars, **kwargs)
- Returns environment variables.
Returns the first environment variable set if none are non-empty, defaults to '' or keyword arg default.
troveclient.compat.versions module
- class troveclient.compat.versions.Version(manager, info, loaded=False)
- Bases: troveclient.compat.base.Resource
Version is an opaque instance used to hold version information.
- class troveclient.compat.versions.Versions(api)
- Bases: troveclient.compat.base.ManagerWithFind
Manage Versions information.
- index(url)
- Get a list of all versions.
- Return type
- list of Versions.
- resource_class
- alias of Version
Module contents
troveclient.osc package
Subpackages
troveclient.osc.v1 package
Submodules
troveclient.osc.v1.base module
- class troveclient.osc.v1.base.TroveDeleter(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- delete_resources(ids)
- Delete one or more resources.
- log = <Logger troveclient.osc.v1.base.TroveDeleter (WARNING)>
troveclient.osc.v1.database_backups module
Database v1 Backups action implementations
- class troveclient.osc.v1.database_backups.CreateDatabaseBackup(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.ShowOne
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_backups.CreateDatabaseBackup (WARNING)>
- take_action(parsed_args)
- Return a two-part tuple with a tuple of column names and a tuple of values.
- class troveclient.osc.v1.database_backups.DeleteDatabaseBackup(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_backups.DeleteDatabaseBackup (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_backups.DeleteDatabaseBackupExecution(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_backups.DeleteDatabaseBackupExecution (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_backups.ListDatabaseBackups(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Lister
- columns = ['ID', 'Instance ID', 'Name', 'Status', 'Parent ID', 'Updated']
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_backups.ListDatabaseBackups (WARNING)>
- take_action(parsed_args)
- Return a tuple containing the column names and an iterable containing the data to be listed.
- class troveclient.osc.v1.database_backups.ListDatabaseInstanceBackups(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Lister
- columns = ['ID', 'Instance ID', 'Name', 'Status', 'Parent ID', 'Updated']
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_backups.ListDatabaseInstanceBackups (WARNING)>
- take_action(parsed_args)
- Return a tuple containing the column names and an iterable containing the data to be listed.
- class troveclient.osc.v1.database_backups.ShowDatabaseBackup(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.ShowOne
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_backups.ShowDatabaseBackup (WARNING)>
- take_action(parsed_args)
- Return a two-part tuple with a tuple of column names and a tuple of values.
- troveclient.osc.v1.database_backups.set_attributes_for_print_detail(backup)
troveclient.osc.v1.database_clusters module
Database v1 Clusters action implementations
- class troveclient.osc.v1.database_clusters.CreateDatabaseCluster(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.ShowOne
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_clusters.CreateDatabaseCluster (WARNING)>
- take_action(parsed_args)
- Return a two-part tuple with a tuple of column names and a tuple of values.
- class troveclient.osc.v1.database_clusters.DeleteDatabaseCluster(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_clusters.DeleteDatabaseCluster (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_clusters.ForceDeleteDatabaseCluster(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_clusters.ForceDeleteDatabaseCluster (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_clusters.GrowDatabaseCluster(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_clusters.GrowDatabaseCluster (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_clusters.ListDatabaseClusterInstances(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Lister
- columns = ['ID', 'Name', 'Flavor ID', 'Size', 'Status']
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_clusters.ListDatabaseClusterInstances (WARNING)>
- take_action(parsed_args)
- Return a tuple containing the column names and an iterable containing the data to be listed.
- class troveclient.osc.v1.database_clusters.ListDatabaseClusterModules(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Lister
- columns = ['instance_name', 'Module Name', 'Module Type', 'md5', 'created', 'updated']
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_clusters.ListDatabaseClusterModules (WARNING)>
- take_action(parsed_args)
- Return a tuple containing the column names and an iterable containing the data to be listed.
- class troveclient.osc.v1.database_clusters.ListDatabaseClusters(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Lister
- columns = ['ID', 'Name', 'Datastore', 'Datastore Version', 'Task Name']
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_clusters.ListDatabaseClusters (WARNING)>
- take_action(parsed_args)
- Return a tuple containing the column names and an iterable containing the data to be listed.
- class troveclient.osc.v1.database_clusters.ResetDatabaseClusterStatus(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_clusters.ResetDatabaseClusterStatus (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_clusters.ShowDatabaseCluster(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.ShowOne
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_clusters.ShowDatabaseCluster (WARNING)>
- take_action(parsed_args)
- Return a two-part tuple with a tuple of column names and a tuple of values.
- class troveclient.osc.v1.database_clusters.ShrinkDatabaseCluster(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_clusters.ShrinkDatabaseCluster (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_clusters.UpgradeDatabaseCluster(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_clusters.UpgradeDatabaseCluster (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- troveclient.osc.v1.database_clusters.set_attributes_for_print_detail(cluster)
troveclient.osc.v1.database_configurations module
Database v1 Configurations action implementations
- class troveclient.osc.v1.database_configurations.AttachDatabaseConfiguration(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_configurations.AttachDatabaseConfiguration (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_configurations.CreateDatabaseConfiguration(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.ShowOne
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_configurations.CreateDatabaseConfiguration (WARNING)>
- take_action(parsed_args)
- Return a two-part tuple with a tuple of column names and a tuple of values.
- class troveclient.osc.v1.database_configurations.DefaultDatabaseConfiguration(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.ShowOne
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_configurations.DefaultDatabaseConfiguration (WARNING)>
- take_action(parsed_args)
- Return a two-part tuple with a tuple of column names and a tuple of values.
- class troveclient.osc.v1.database_configurations.DeleteDatabaseConfiguration(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_configurations.DeleteDatabaseConfiguration (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_configurations.DetachDatabaseConfiguration(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_configurations.DetachDatabaseConfiguration (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_configurations.ListDatabaseConfigurationInstances(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Lister
- columns = ['ID', 'Name']
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_configurations.ListDatabaseConfigurationInstances (WARNING)>
- take_action(parsed_args)
- Return a tuple containing the column names and an iterable containing the data to be listed.
- class troveclient.osc.v1.database_configurations.ListDatabaseConfigurationParameters(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Lister
- columns = ['Name', 'Type', 'Min Size', 'Max Size', 'Restart Required']
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_configurations.ListDatabaseConfigurationParameters (WARNING)>
- take_action(parsed_args)
- Return a tuple containing the column names and an iterable containing the data to be listed.
- class troveclient.osc.v1.database_configurations.ListDatabaseConfigurations(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Lister
- columns = ['ID', 'Name', 'Description', 'Datastore Name', 'Datastore Version Name']
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_configurations.ListDatabaseConfigurations (WARNING)>
- take_action(parsed_args)
- Return a tuple containing the column names and an iterable containing the data to be listed.
- class troveclient.osc.v1.database_configurations.ShowDatabaseConfiguration(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.ShowOne
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_configurations.ShowDatabaseConfiguration (WARNING)>
- take_action(parsed_args)
- Return a two-part tuple with a tuple of column names and a tuple of values.
- class troveclient.osc.v1.database_configurations.ShowDatabaseConfigurationParameter(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.ShowOne
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_configurations.ShowDatabaseConfigurationParameter (WARNING)>
- take_action(parsed_args)
- Return a two-part tuple with a tuple of column names and a tuple of values.
- troveclient.osc.v1.database_configurations.set_attributes_for_print_detail(configuration)
troveclient.osc.v1.database_flavors module
Database v1 Flavors action implementations
- class troveclient.osc.v1.database_flavors.ListDatabaseFlavors(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Lister
- columns = ['ID', 'Name', 'RAM', 'vCPUs', 'Disk', 'Ephemeral']
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_flavors.ListDatabaseFlavors (WARNING)>
- take_action(parsed_args)
- Return a tuple containing the column names and an iterable containing the data to be listed.
- class troveclient.osc.v1.database_flavors.ShowDatabaseFlavor(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.ShowOne
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_flavors.ShowDatabaseFlavor (WARNING)>
- take_action(parsed_args)
- Return a two-part tuple with a tuple of column names and a tuple of values.
- troveclient.osc.v1.database_flavors.set_attributes_for_print_detail(flavor)
troveclient.osc.v1.database_instances module
Database v1 Instances action implementations
- class troveclient.osc.v1.database_instances.CreateDatabaseInstance(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.ShowOne
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_instances.CreateDatabaseInstance (WARNING)>
- take_action(parsed_args)
- Return a two-part tuple with a tuple of column names and a tuple of values.
- class troveclient.osc.v1.database_instances.DeleteDatabaseInstance(app, app_args, cmd_name=None)
- Bases: troveclient.osc.v1.base.TroveDeleter
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_instances.DeleteDatabaseInstance (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_instances.DetachDatabaseInstanceReplica(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_instances.DetachDatabaseInstanceReplica (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_instances.EjectDatabaseInstanceReplicaSource(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_instances.EjectDatabaseInstanceReplicaSource (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_instances.ForceDeleteDatabaseInstance(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_instances.ForceDeleteDatabaseInstance (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_instances.ListDatabaseInstances(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Lister
- admin_columns = ['ID', 'Name', 'Tenant ID', 'Datastore', 'Datastore Version', 'Status', 'Addresses', 'Flavor ID', 'Size']
- columns = ['ID', 'Name', 'Datastore', 'Datastore Version', 'Status', 'Addresses', 'Flavor ID', 'Size', 'Region']
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_instances.ListDatabaseInstances (WARNING)>
- take_action(parsed_args)
- Return a tuple containing the column names and an iterable containing the data to be listed.
- class troveclient.osc.v1.database_instances.PromoteDatabaseInstanceToReplicaSource(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_instances.PromoteDatabaseInstanceToReplicaSource (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_instances.RebootDatabaseInstance(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_instances.RebootDatabaseInstance (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_instances.ResetDatabaseInstanceStatus(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_instances.ResetDatabaseInstanceStatus (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_instances.ResizeDatabaseInstanceFlavor(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_instances.ResizeDatabaseInstanceFlavor (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_instances.ResizeDatabaseInstanceVolume(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_instances.ResizeDatabaseInstanceVolume (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_instances.RestartDatabaseInstance(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_instances.RestartDatabaseInstance (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_instances.ShowDatabaseInstance(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.ShowOne
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_instances.ShowDatabaseInstance (WARNING)>
- take_action(parsed_args)
- Return a two-part tuple with a tuple of column names and a tuple of values.
- class troveclient.osc.v1.database_instances.UpdateDatabaseInstance(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_instances.UpdateDatabaseInstance (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_instances.UpgradeDatabaseInstance(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_instances.UpgradeDatabaseInstance (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- troveclient.osc.v1.database_instances.set_attributes_for_print(instances)
- troveclient.osc.v1.database_instances.set_attributes_for_print_detail(instance)
troveclient.osc.v1.database_limits module
Database v1 Limits action implementations
- class troveclient.osc.v1.database_limits.ListDatabaseLimits(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Lister
- columns = ['Value', 'Verb', 'Remaining', 'Unit']
- log = <Logger troveclient.osc.v1.database_limits.ListDatabaseLimits (WARNING)>
- take_action(parsed_args)
- Return a tuple containing the column names and an iterable containing the data to be listed.
troveclient.osc.v1.database_logs module
- class troveclient.osc.v1.database_logs.ListDatabaseLogs(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Lister
- columns = ['Name', 'Type', 'Status', 'Published', 'Pending', 'Container', 'Prefix']
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_logs.ListDatabaseLogs (WARNING)>
- take_action(parsed_args)
- Return a tuple containing the column names and an iterable containing the data to be listed.
- class troveclient.osc.v1.database_logs.SaveDatabaseInstanceLog(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_logs.SaveDatabaseInstanceLog (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_logs.SetDatabaseInstanceLog(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.ShowOne
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_logs.SetDatabaseInstanceLog (WARNING)>
- take_action(parsed_args)
- Return a two-part tuple with a tuple of column names and a tuple of values.
- class troveclient.osc.v1.database_logs.ShowDatabaseInstanceLog(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.ShowOne
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_logs.ShowDatabaseInstanceLog (WARNING)>
- take_action(parsed_args)
- Return a two-part tuple with a tuple of column names and a tuple of values.
- class troveclient.osc.v1.database_logs.ShowDatabaseInstanceLogContents(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_logs.ShowDatabaseInstanceLogContents (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
troveclient.osc.v1.database_quota module
Database v1 Quota action implementations
- class troveclient.osc.v1.database_quota.ShowDatabaseQuota(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Lister
- columns = ['Resource', 'In Use', 'Reserved', 'Limit']
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_quota.ShowDatabaseQuota (WARNING)>
- take_action(parsed_args)
- Return a tuple containing the column names and an iterable containing the data to be listed.
- class troveclient.osc.v1.database_quota.UpdateDatabaseQuota(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.ShowOne
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_quota.UpdateDatabaseQuota (WARNING)>
- take_action(parsed_args)
- Return a two-part tuple with a tuple of column names and a tuple of values.
troveclient.osc.v1.database_root module
Database v1 Root action implementations
- class troveclient.osc.v1.database_root.DisableDatabaseRoot(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_root.DisableDatabaseRoot (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_root.EnableDatabaseRoot(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.ShowOne
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_root.EnableDatabaseRoot (WARNING)>
- take_action(parsed_args)
- Return a two-part tuple with a tuple of column names and a tuple of values.
- class troveclient.osc.v1.database_root.ShowDatabaseRoot(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.ShowOne
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_root.ShowDatabaseRoot (WARNING)>
- take_action(parsed_args)
- Return a two-part tuple with a tuple of column names and a tuple of values.
- troveclient.osc.v1.database_root.find_instance_or_cluster(database_client_manager, instance_or_cluster)
- Returns an instance or cluster, found by ID or name, along with the type of resource, instance or cluster. Raises CommandError if none is found.
troveclient.osc.v1.database_users module
Database v1 Users action implementations
- class troveclient.osc.v1.database_users.CreateDatabaseUser(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_users.CreateDatabaseUser (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_users.DeleteDatabaseUser(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_users.DeleteDatabaseUser (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_users.GrantDatabaseUserAccess(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_users.GrantDatabaseUserAccess (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_users.ListDatabaseUsers(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Lister
- columns = ['Name', 'Host', 'Databases']
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_users.ListDatabaseUsers (WARNING)>
- take_action(parsed_args)
- Return a tuple containing the column names and an iterable containing the data to be listed.
- class troveclient.osc.v1.database_users.RevokeDatabaseUserAccess(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_users.RevokeDatabaseUserAccess (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.database_users.ShowDatabaseUser(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.ShowOne
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_users.ShowDatabaseUser (WARNING)>
- take_action(parsed_args)
- Return a two-part tuple with a tuple of column names and a tuple of values.
- class troveclient.osc.v1.database_users.ShowDatabaseUserAccess(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Lister
- columns = ['Name']
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_users.ShowDatabaseUserAccess (WARNING)>
- take_action(parsed_args)
- Return a tuple containing the column names and an iterable containing the data to be listed.
- class troveclient.osc.v1.database_users.UpdateDatabaseUserAttributes(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.database_users.UpdateDatabaseUserAttributes (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
troveclient.osc.v1.databases module
Database v1 Databases action implementations
- class troveclient.osc.v1.databases.CreateDatabase(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.databases.CreateDatabase (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.databases.DeleteDatabase(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.databases.DeleteDatabase (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.databases.ListDatabases(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Lister
- columns = ['Name']
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.databases.ListDatabases (WARNING)>
- take_action(parsed_args)
- Return a tuple containing the column names and an iterable containing the data to be listed.
troveclient.osc.v1.datastores module
Database v1 Datastores action implementations
- class troveclient.osc.v1.datastores.DeleteDatastore(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.datastores.DeleteDatastore (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.datastores.DeleteDatastoreVersion(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Command
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.datastores.DeleteDatastoreVersion (WARNING)>
- take_action(parsed_args)
- Override to do something useful.
The returned value will be returned by the program.
- class troveclient.osc.v1.datastores.ListDatastoreVersions(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Lister
- columns = ['ID', 'Name']
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.datastores.ListDatastoreVersions (WARNING)>
- take_action(parsed_args)
- Return a tuple containing the column names and an iterable containing the data to be listed.
- class troveclient.osc.v1.datastores.ListDatastores(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.Lister
- columns = ['ID', 'Name']
- log = <Logger troveclient.osc.v1.datastores.ListDatastores (WARNING)>
- take_action(parsed_args)
- Return a tuple containing the column names and an iterable containing the data to be listed.
- class troveclient.osc.v1.datastores.ShowDatastore(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.ShowOne
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.datastores.ShowDatastore (WARNING)>
- take_action(parsed_args)
- Return a two-part tuple with a tuple of column names and a tuple of values.
- class troveclient.osc.v1.datastores.ShowDatastoreVersion(app, app_args, cmd_name=None)
- Bases: osc_lib.command.command.ShowOne
- get_parser(prog_name)
- Return an argparse.ArgumentParser.
- log = <Logger troveclient.osc.v1.datastores.ShowDatastoreVersion (WARNING)>
- take_action(parsed_args)
- Return a two-part tuple with a tuple of column names and a tuple of values.
- troveclient.osc.v1.datastores.set_attributes_for_print_detail(datastore)
Module contents
Submodules
troveclient.osc.plugin module
- troveclient.osc.plugin.build_option_parser(parser)
- Hook to add global options
- troveclient.osc.plugin.make_client(instance)
- Returns a database service client
Module contents
troveclient.v1 package
Submodules
troveclient.v1.accounts module
- class troveclient.v1.accounts.Account(manager, info, loaded=False)
- Bases: troveclient.base.Resource
Account is an opaque instance used to hold account information.
- class troveclient.v1.accounts.Accounts(api)
- Bases: troveclient.base.ManagerWithFind
Manage Account information.
- index()
- Get a list of all accounts with non-deleted instances.
- list()
- resource_class
- alias of Account
- show(account)
- Get details of one account.
- Return type
- Account.
troveclient.v1.backups module
- class troveclient.v1.backups.Backup(manager, info, loaded=False)
- Bases: troveclient.base.Resource
Backup is a resource used to hold backup information.
- class troveclient.v1.backups.Backups(api)
- Bases: troveclient.base.ManagerWithFind
Manage Backups information.
- backup_create_workflow = 'trove.backup_create'
- create(name, instance, description=None, parent_id=None, incremental=False)
- Create a new backup from the given instance.
- Parameters
- name -- name for backup.
- instance -- instance to backup.
- description -- (optional).
- parent_id -- base for incremental backup (optional).
- incremental -- flag to indicate incremental backup based on last backup
- Returns
- Backups
- delete(backup)
- Delete the specified backup.
- Parameters
- backup -- The backup to delete
- execution_delete(execution, mistral_client=None)
- Remove a given schedule execution.
- Parameters
- id -- id of execution to remove.
- execution_list(schedule, mistral_client=None, marker='', limit=None)
- Get a list of all executions of a scheduled backup.
- Param
- schedule for which to list executions.
- Return type
- list of ScheduleExecution.
- get(backup)
- Get a specific backup.
- Return type
- Backups
- list(limit=None, marker=None, datastore=None, instance_id=None, all_projects=False)
- Get a list of all backups.
- resource_class
- alias of Backup
- schedule_create(instance, pattern, name, description=None, incremental=None, mistral_client=None)
- Create a new schedule to backup the given instance.
- Parameters
- instance -- instance to backup.
- name -- name for backup.
- description -- (optional).
- incremental -- flag for incremental backup (optional).
- Param
- pattern: cron pattern for schedule.
- Returns
- Backups
- schedule_delete(schedule, mistral_client=None)
- Remove a given backup schedule.
- Parameters
- schedule -- schedule to delete.
- schedule_list(instance, mistral_client=None)
- Get a list of all backup schedules for an instance.
- Param
- instance for which to list schedules.
- Return type
- list of Schedule.
- schedule_show(schedule, mistral_client=None)
- Get details of a backup schedule.
- Param
- schedule to show.
- Return type
- Schedule.
- class troveclient.v1.backups.Schedule(manager, info, loaded=False)
- Bases: troveclient.base.Resource
Schedule is a resource used to hold information about scheduled backups.
- class troveclient.v1.backups.ScheduleExecution(manager, info, loaded=False)
- Bases: troveclient.base.Resource
ScheduleExecution is a resource used to hold information about the execution of a scheduled backup.
troveclient.v1.client module
- class troveclient.v1.client.Client(username=None, password=None, project_id=None, auth_url='', insecure=False, timeout=None, tenant_id=None, proxy_tenant_id=None, proxy_token=None, region_name=None, endpoint_type='publicURL', extensions=None, service_type='database', service_name=None, database_service_name=None, retries=None, http_log_debug=False, cacert=None, bypass_url=None, auth_system='keystone', auth_plugin=None, session=None, auth=None, **kwargs)
- Bases: object
Top-level object to access the OpenStack Database API.
Create an instance with your creds:
>> client = Client(USERNAME,
PASSWORD,
project_id=TENANT_NAME,
auth_url=AUTH_URL)
Then call methods on its managers:
>> client.instances.list() ...
- authenticate()
- Authenticate against the server.
Normally this is called automatically when you first access the API, but you can call this method to force authentication right now.
Returns on success; raises exceptions.Unauthorized if the credentials are wrong.
- get_database_api_version_from_endpoint()
troveclient.v1.clusters module
- class troveclient.v1.clusters.Cluster(manager, info, loaded=False)
- Bases: troveclient.base.Resource
A Cluster is an opaque cluster used to store Database clusters.
- delete()
- Delete the cluster.
- force_delete()
- Force delete the cluster
- class troveclient.v1.clusters.ClusterStatus
- Bases: object
- ACTIVE = 'ACTIVE'
- BUILD = 'BUILD'
- FAILED = 'FAILED'
- SHUTDOWN = 'SHUTDOWN'
- class troveclient.v1.clusters.Clusters(api)
- Bases: troveclient.base.ManagerWithFind
Manage Cluster resources.
- add_shard(cluster)
- Adds a shard to the specified cluster.
- Parameters
- cluster -- The cluster to add a shard to
- create(name, datastore, datastore_version, instances=None, locality=None, extended_properties=None, configuration=None)
- Create (boot) a new cluster.
- delete(cluster)
- Delete the specified cluster.
- Parameters
- cluster -- The cluster to delete
- get(cluster)
- Get a specific cluster.
- Return type
- Cluster
- grow(cluster, instances=None)
- Grow a cluster.
- Parameters
- cluster -- The cluster to grow
- instances -- List of instances to add
- list(limit=None, marker=None)
- Get a list of all clusters.
- Return type
- list of Cluster.
- reset_status(cluster)
- Reset the status of a cluster
- Parameters
- cluster -- The cluster to reset
- resource_class
- alias of Cluster
- shrink(cluster, instances=None)
- Shrink a cluster.
- Parameters
- cluster -- The cluster to shrink
- instances -- List of instances to drop
- upgrade(cluster, datastore_version)
- Upgrades a cluster to a new datastore version.
- Parameters
- cluster -- The cluster to upgrade
- datastore_version -- Datastore version to which to upgrade
troveclient.v1.configurations module
- class troveclient.v1.configurations.Configuration(manager, info, loaded=False)
- Bases: troveclient.base.Resource
Configuration is a resource used to hold configuration information.
- class troveclient.v1.configurations.ConfigurationParameter(manager, info, loaded=False)
- Bases: troveclient.base.Resource
Configuration Parameter.
- class troveclient.v1.configurations.ConfigurationParameters(api)
- Bases: troveclient.base.ManagerWithFind
Manage ConfigurationParameters information.
- get_parameter(datastore, version, key)
- Get a list of valid parameters that can be changed.
- get_parameter_by_version(version, key)
- Get a list of valid parameters that can be changed.
- list()
- parameters(datastore, version)
- Get a list of valid parameters that can be changed.
- parameters_by_version(version)
- Get a list of valid parameters that can be changed.
- resource_class
- alias of ConfigurationParameter
- class troveclient.v1.configurations.Configurations(api)
- Bases: troveclient.base.ManagerWithFind
Manage Configurations information.
- create(name, values, description=None, datastore=None, datastore_version=None)
- Create a new configuration.
- delete(configuration)
- Delete the specified configuration.
- Parameters
- configuration -- The configuration id to delete
- edit(configuration, values)
- Update an existing configuration.
- get(configuration)
- Get a specific configuration.
- Return type
- Configurations
- instances(configuration, limit=None, marker=None)
- Get a list of instances on a configuration.
- Return type
- Configurations
- list(limit=None, marker=None)
- Get a list of all configurations.
- Return type
- list of Configurations.
- resource_class
- alias of Configuration
- update(configuration, values, name=None, description=None)
- Update an existing configuration.
troveclient.v1.databases module
- class troveclient.v1.databases.Database(manager, info, loaded=False)
- Bases: troveclient.base.Resource
Wikipedia definition for database.
"A database is a system intended to organize, store, and retrieve large amounts of data easily."
- class troveclient.v1.databases.Databases(api)
- Bases: troveclient.base.ManagerWithFind
Manage Databases resources.
- create(instance, databases)
- Create new databases within the specified instance.
- delete(instance, dbname)
- Delete an existing database in the specified instance.
- list(instance, limit=None, marker=None)
- Get a list of all Databases from the instance.
- Return type
- list of Database.
- resource_class
- alias of Database
troveclient.v1.datastores module
- class troveclient.v1.datastores.Datastore(manager, info, loaded=False)
- Bases: troveclient.base.Resource
- class troveclient.v1.datastores.DatastoreVersion(manager, info, loaded=False)
- Bases: troveclient.base.Resource
- update(visibility=None)
- Change something in a datastore version.
- class troveclient.v1.datastores.DatastoreVersionMember(manager, info, loaded=False)
- Bases: troveclient.base.Resource
- class troveclient.v1.datastores.DatastoreVersionMembers(api)
- Bases: troveclient.base.ManagerWithFind
Manage DatastoreVersionMember resources.
- add(datastore, datastore_version, tenant)
- Add a member to a datastore version.
- delete(datastore, datastore_version, member_id)
- Delete a member from a datastore version.
- get(datastore, datastore_version, member_id)
- Get a datastore version member.
- get_by_tenant(datastore, tenant, limit=None, marker=None)
- List members by tenant id.
- list(datastore, datastore_version, limit=None, marker=None)
- List members of datastore version.
- resource_class
- alias of DatastoreVersionMember
- class troveclient.v1.datastores.DatastoreVersions(api)
- Bases: troveclient.base.ManagerWithFind
Manage DatastoreVersion resources.
- get(datastore, datastore_version)
- Get a specific datastore version.
- Return type
- DatastoreVersion
- get_by_uuid(datastore_version)
- Get a specific datastore version.
- Return type
- DatastoreVersion
- list(datastore, limit=None, marker=None)
- Get a list of all datastore versions.
- Return type
- list of DatastoreVersion.
- resource_class
- alias of DatastoreVersion
- update(datastore, datastore_version, visibility)
- Update a specific datastore version.
- class troveclient.v1.datastores.Datastores(api)
- Bases: troveclient.base.ManagerWithFind
Manage Datastore resources.
- delete(datastore)
- Delete a specific datastore.
- get(datastore)
- Get a specific datastore.
- Return type
- Datastore
- list(limit=None, marker=None)
- Get a list of all datastores.
- Return type
- list of Datastore.
- resource_class
- alias of Datastore
troveclient.v1.diagnostics module
- class troveclient.v1.diagnostics.Diagnostics(manager, info, loaded=False)
- Bases: troveclient.base.Resource
Account is an opaque instance used to hold account information.
- class troveclient.v1.diagnostics.DiagnosticsInterrogator(api)
- Bases: troveclient.base.ManagerWithFind
Manager class for Interrogator resource.
- get(instance)
- Get the diagnostics of the guest on the instance.
- list()
- resource_class
- alias of Diagnostics
- class troveclient.v1.diagnostics.HwInfo(manager, info, loaded=False)
- Bases: troveclient.base.Resource
- class troveclient.v1.diagnostics.HwInfoInterrogator(api)
- Bases: troveclient.base.ManagerWithFind
Manager class for HwInfo.
- get(instance)
- Get the hardware information of the instance.
- list()
- resource_class
- alias of HwInfo
troveclient.v1.flavors module
- class troveclient.v1.flavors.Flavor(manager, info, loaded=False)
- Bases: troveclient.base.Resource
A Flavor is an Instance type, specifying other things, like RAM size.
- class troveclient.v1.flavors.Flavors(api)
- Bases: troveclient.base.ManagerWithFind
Manage Flavor resources.
- get(flavor)
- Get a specific flavor.
- Return type
- Flavor
- list()
- Get a list of all flavors. :rtype: list of Flavor.
- list_datastore_version_associated_flavors(datastore, version_id)
- Get a list of all flavors for the specified datastore type and datastore version . :rtype: list of Flavor.
- resource_class
- alias of Flavor
troveclient.v1.hosts module
- class troveclient.v1.hosts.Host(manager, info, loaded=False)
- Bases: troveclient.base.Resource
A Hosts is an opaque instance used to store Host instances.
- class troveclient.v1.hosts.Hosts(api)
- Bases: troveclient.base.ManagerWithFind
Manage Host resources.
- get(host)
- Get a specific host.
- Return type
- host
- index()
- Get a list of all hosts.
- Return type
- list of Hosts.
- list()
- resource_class
- alias of Host
- update_all(host_id)
- Update all instances on a host.
troveclient.v1.instances module
- class troveclient.v1.instances.DatastoreLog(manager, info, loaded=False)
- Bases: troveclient.base.Resource
A DatastoreLog is a log on the database guest instance.
- class troveclient.v1.instances.Instance(manager, info, loaded=False)
- Bases: troveclient.base.Resource
An Instance is an opaque instance used to store Database instances.
- delete()
- Delete the instance.
- detach_replica()
- Stops the replica database from being replicated to.
- force_delete()
- Force delete the instance
- list_databases()
- restart()
- Restart the database instance.
- class troveclient.v1.instances.InstanceStatus
- Bases: object
- ACTIVE = 'ACTIVE'
- BLOCKED = 'BLOCKED'
- BUILD = 'BUILD'
- EJECTING = 'EJECTING'
- FAILED = 'FAILED'
- LOGGING = 'LOGGING'
- PROMOTING = 'PROMOTING'
- REBOOT = 'REBOOT'
- RESIZE = 'RESIZE'
- RESTART_REQUIRED = 'RESTART_REQUIRED'
- SHUTDOWN = 'SHUTDOWN'
- class troveclient.v1.instances.Instances(api)
- Bases: troveclient.base.ManagerWithFind
Manage Instance resources.
- backups(instance, limit=None, marker=None)
- Get the list of backups for a specific instance.
- Parameters
- instance -- instance for which to list backups
- limit -- max items to return
- marker -- marker start point
- Return type
- list of Backups.
- configuration(instance)
- Get a configuration on instances.
- Return type
- Instance
- create(name, flavor_id, volume=None, databases=None, users=None, restorePoint=None, availability_zone=None, datastore=None, datastore_version=None, nics=None, configuration=None, replica_of=None, replica_count=None, modules=None, locality=None, region_name=None, access=None, **kwargs)
- Create (boot) a new instance.
- delete(instance)
- Delete the specified instance.
- Parameters
- instance -- A reference to the instance to delete
- edit(instance, configuration=None, name=None, detach_replica_source=False, remove_configuration=False)
- eject_replica_source(instance)
- Eject a replica source from its set
- Parameters
- instance -- The Instance (or its ID) of the database instance to eject.
- force_delete(instance)
- Force delete the specified instance.
- Parameters
- instance -- A reference to the instance to force delete
- get(instance)
- Get a specific instances.
- Return type
- Instance
- list(limit=None, marker=None, include_clustered=False, detailed=False)
- Get a list of all instances.
- Return type
- list of Instance.
- log_action(instance, log_name, enable=None, disable=None, publish=None, discard=None)
- Perform action on guest log.
- Parameters
- instance -- The Instance (or its ID) of the database instance to get the log for.
- log_name -- The name of <log> to publish
- enable -- Turn on <log>
- disable -- Turn off <log>
- publish -- Publish log to associated container
- discard -- Delete the associated container
- Return type
- List of DatastoreLog.
- log_generator(instance, log_name, lines=50, swift=None)
- Return generator to yield the last <lines> lines of guest log.
- Parameters
- instance -- The Instance (or its ID) of the database instance to get the log for.
- log_name -- The name of <log> to publish
- lines -- Display last <lines> lines of log (0 for all lines)
- swift -- Connection to swift
- Return type
- generator function to yield log as chunks.
- log_list(instance)
- Get a list of all guest logs.
- Parameters
- instance -- The Instance (or its ID) of the database instance to get the log for.
- Return type
- list of DatastoreLog.
- log_save(instance, log_name, filename=None)
- Saves a guest log to a file.
- Parameters
- instance -- The Instance (or its ID) of the database instance to get the log for.
- log_name -- The name of <log> to publish
- Return type
- Filename to which log was saved
- log_show(instance, log_name)
- modify(instance, configuration=None)
- module_apply(instance, modules)
- Apply modules to an instance.
- module_query(instance)
- Query an instance about installed modules.
- module_remove(instance, module)
- Remove a module from an instance.
- module_retrieve(instance, directory=None, prefix=None)
- Retrieve the module data file from an instance. This includes the contents of the module data file.
- modules(instance)
- Get the list of modules for a specific instance.
- promote_to_replica_source(instance)
- Promote a replica to be the new replica_source of its set
- Parameters
- instance -- The Instance (or its ID) of the database instance to promote.
- reset_status(instance)
- Reset the status of an instance.
- Parameters
- instance -- A reference to the instance
- resize_instance(instance, flavor_id)
- Resizes an instance with a new flavor.
- resize_volume(instance, volume_size)
- Resize the volume on an existing instances.
- resource_class
- alias of Instance
- restart(instance)
- Restart the database instance.
- Parameters
- instance -- The Instance (or its ID) of the database instance to restart.
- upgrade(instance, datastore_version)
- Upgrades an instance with a new datastore version.
troveclient.v1.limits module
- class troveclient.v1.limits.Limit(manager, info, loaded=False)
- Bases: troveclient.base.Resource
- class troveclient.v1.limits.Limits(api)
- Bases: troveclient.base.ManagerWithFind
Manages :class Limit resources.
- list()
- Retrieve the limits.
- resource_class
- alias of Limit
troveclient.v1.management module
- class troveclient.v1.management.Management(api)
- Bases: troveclient.base.ManagerWithFind
Manage Instances resources.
- index(**kwargs)
- A wrapper for list method.
- list(limit=None, marker=None, deleted=False, **kwargs)
- Get all the database instances.
- migrate(instance_id, host=None)
- Migrate the instance.
- Parameters
- instance_id -- The Instance (or its ID) to share onto.
- reboot(instance_id)
- Reboot the underlying OS.
- Parameters
- instance_id -- The Instance (or its ID) to share onto.
- reset_task_status(instance_id)
- Set the task status to NONE.
- resource_class
- alias of troveclient.v1.instances.Instance
- root_enabled_history(instance)
- Get root access history of one instance.
- show(instance)
- Get details of one instance.
- Return type
- Instance.
- stop(instance_id)
- update(instance_id)
- Update the guest agent via apt-get.
- class troveclient.v1.management.MgmtClusters(api)
- Bases: troveclient.base.ManagerWithFind
Manage Cluster resources.
- index(deleted=None, limit=None, marker=None)
- Show an overview of all local clusters.
Optionally, filter by deleted status.
- Return type
- list of Cluster.
- list()
- reset_task(cluster_id)
- Reset the current cluster task to NONE.
- resource_class
- alias of troveclient.v1.clusters.Cluster
- show(cluster)
- Get details of one cluster.
- class troveclient.v1.management.MgmtConfigurationParameters(api)
- Bases: troveclient.v1.configurations.ConfigurationParameters
- create(version, name, restart_required, data_type, max_size=None, min_size=None)
- Mgmt call to create a new configuration parameter.
- delete(version, name)
- Mgmt call to delete a configuration parameter.
- get_any_parameter_by_version(version, key)
- Get any configuration parameter deleted or not.
- list_all_parameter_by_version(version)
- List all configuration parameters deleted or not.
- modify(version, name, restart_required, data_type, max_size=None, min_size=None)
- Mgmt call to modify an existing configuration parameter.
- class troveclient.v1.management.MgmtDatastoreVersions(api)
- Bases: troveclient.base.ManagerWithFind
Manage DatastoreVersion resources.
- create(name, datastore_name, datastore_manager, image, packages=None, active='true', default='false')
- delete(datastore_version_id)
- Delete a datastore version.
- edit(datastore_version_id, datastore_manager=None, image=None, packages=None, active=None, default=None)
- get(datastore_version_id)
- Get details of a datastore version.
- list(limit=None, marker=None)
- List all datastore versions.
- resource_class
- alias of troveclient.v1.datastores.DatastoreVersion
- class troveclient.v1.management.MgmtFlavors(api)
- Bases: troveclient.base.ManagerWithFind
Manage Flavor resources.
- create(name, ram, disk, vcpus, flavorid='auto', ephemeral=None, swap=None, rxtx_factor=None, service_type=None)
- Create a new flavor.
- list()
- resource_class
- alias of troveclient.v1.flavors.Flavor
- class troveclient.v1.management.RootHistory(manager, info, loaded=False)
- Bases: troveclient.base.Resource
troveclient.v1.metadata module
- class troveclient.v1.metadata.Metadata(api)
- Bases: troveclient.base.Manager
- create(instance_id, key, value)
- delete(instance_id, key)
- edit(instance_id, key, value)
- list(instance_id)
- resource_class
- alias of MetadataResource
- show(instance_id, key)
- update(instance_id, key, newkey, value)
- class troveclient.v1.metadata.MetadataResource(manager, info, loaded=False)
- Bases: troveclient.base.Resource
troveclient.v1.modules module
- class troveclient.v1.modules.Module(manager, info, loaded=False)
- Bases: troveclient.base.Resource
- ALL_KEYWORD = 'all'
- class troveclient.v1.modules.Modules(api)
- Bases: troveclient.base.ManagerWithFind
Manage Module resources.
- create(name, module_type, contents, description=None, all_tenants=None, datastore=None, datastore_version=None, auto_apply=None, visible=None, live_update=None, priority_apply=None, apply_order=None, full_access=None)
- Create a new module.
- delete(module)
- Delete the specified module.
- get(module)
- Get a specific module.
- instances(module, limit=None, marker=None, include_clustered=False, count_only=False)
- Get a list of all instances this module has been applied to.
- list(limit=None, marker=None, datastore=None)
- Get a list of all modules.
- reapply(module, md5=None, include_clustered=None, batch_size=None, delay=None, force=None)
- Reapplies the specified module.
- resource_class
- alias of Module
- update(module, name=None, module_type=None, contents=None, description=None, all_tenants=None, datastore=None, datastore_version=None, auto_apply=None, visible=None, live_update=None, all_datastores=None, all_datastore_versions=None, priority_apply=None, apply_order=None, full_access=None)
- Update an existing module. Passing in datastore=None or datastore_version=None has the effect of making it available for all datastores/versions.
troveclient.v1.quota module
- class troveclient.v1.quota.Quotas(api)
- Bases: troveclient.base.ManagerWithFind
Manage Quota information.
- list()
- resource_class
- alias of troveclient.base.Resource
- show(tenant_id)
- Get a list of all quotas for a tenant id.
- update(id, quotas)
- Set limits for quotas.
troveclient.v1.root module
- class troveclient.v1.root.Root(api)
- Bases: troveclient.base.ManagerWithFind
Manager class for Root resource.
- clusters_url = '/clusters/%s/root'
- create(instance)
- Implements root-enable API. Enable the root user and return the root password for the specified db instance.
- create_cluster_root(cluster, root_password=None)
- Implements root-enable for clusters.
- create_instance_root(instance, root_password=None)
- Implements root-enable for instances.
- delete(instance)
- Implements root-disable API. Disables access to the root user for the specified db instance. :param instance: The instance on which the root user is enabled
- disable_instance_root(instance)
- Implements root-disable for instances.
- instances_url = '/instances/%s/root'
- is_cluster_root_enabled(cluster)
- Returns whether root is enabled for the cluster.
- is_instance_root_enabled(instance)
- Returns whether root is enabled for the instance.
- is_root_enabled(instance)
- Return whether root is enabled for the instance.
- list()
- resource_class
- alias of troveclient.v1.users.User
troveclient.v1.security_groups module
- class troveclient.v1.security_groups.SecurityGroup(manager, info, loaded=False)
- Bases: troveclient.base.Resource
Security Group is a resource used to hold security group information.
- class troveclient.v1.security_groups.SecurityGroupRule(manager, info, loaded=False)
- Bases: troveclient.base.Resource
This resource is used to hold security group rule information.
- class troveclient.v1.security_groups.SecurityGroupRules(api)
- Bases: troveclient.base.ManagerWithFind
Manage SecurityGroupRules resources.
- create(group_id, cidr)
- Create a new security group rule.
- delete(security_group_rule)
- Delete the specified security group rule.
- Parameters
- security_group_rule -- The security group rule to delete
- list()
- resource_class
- alias of SecurityGroupRule
- class troveclient.v1.security_groups.SecurityGroups(api)
- Bases: troveclient.base.ManagerWithFind
Manage SecurityGroup resources.
- get(security_group)
- Get a specific security group.
- Return type
- SecurityGroup
- list(limit=None, marker=None)
- Get a list of all security groups.
- Return type
- list of SecurityGroup.
- resource_class
- alias of SecurityGroup
troveclient.v1.shell module
- troveclient.v1.shell.do_backup_create(cs, args)
- Creates a backup of an instance.
- troveclient.v1.shell.do_backup_delete(cs, args)
- Deletes a backup.
- troveclient.v1.shell.do_backup_list(cs, args)
- Lists available backups.
- troveclient.v1.shell.do_backup_list_instance(cs, args)
- Lists available backups for an instance.
- troveclient.v1.shell.do_backup_show(cs, args)
- Shows details of a backup.
- troveclient.v1.shell.do_cluster_create(cs, args)
- Creates a new cluster.
- troveclient.v1.shell.do_cluster_delete(cs, args)
- Delete specified cluster(s).
- troveclient.v1.shell.do_cluster_force_delete(cs, args)
- Force delete a cluster
- troveclient.v1.shell.do_cluster_grow(cs, args)
- Adds more instances to a cluster.
- troveclient.v1.shell.do_cluster_instances(cs, args)
- Lists all instances of a cluster.
- troveclient.v1.shell.do_cluster_list(cs, args)
- Lists all the clusters.
- troveclient.v1.shell.do_cluster_modules(cs, args)
- Lists all modules for each instance of a cluster.
- troveclient.v1.shell.do_cluster_reset_status(cs, args)
- Set the cluster task to NONE.
- troveclient.v1.shell.do_cluster_show(cs, args)
- Shows details of a cluster.
- troveclient.v1.shell.do_cluster_shrink(cs, args)
- Drops instances from a cluster.
- troveclient.v1.shell.do_cluster_upgrade(cs, args)
- Upgrades a cluster to a new datastore version.
- troveclient.v1.shell.do_configuration_attach(cs, args)
- Attaches a configuration group to an instance.
- troveclient.v1.shell.do_configuration_create(cs, args)
- Creates a configuration group.
- troveclient.v1.shell.do_configuration_default(cs, args)
- Shows the default configuration of an instance.
- troveclient.v1.shell.do_configuration_delete(cs, args)
- Deletes a configuration group.
- troveclient.v1.shell.do_configuration_detach(cs, args)
- Detaches a configuration group from an instance.
- troveclient.v1.shell.do_configuration_instances(cs, args)
- Lists all instances associated with a configuration group.
- troveclient.v1.shell.do_configuration_list(cs, args)
- Lists all configuration groups.
- troveclient.v1.shell.do_configuration_parameter_list(cs, args)
- Lists available parameters for a configuration group.
- troveclient.v1.shell.do_configuration_parameter_show(cs, args)
- Shows details of a configuration parameter.
- troveclient.v1.shell.do_configuration_patch(cs, args)
- Patches a configuration group.
- troveclient.v1.shell.do_configuration_show(cs, args)
- Shows details of a configuration group.
- troveclient.v1.shell.do_configuration_update(cs, args)
- Updates a configuration group.
- troveclient.v1.shell.do_create(cs, args)
- Creates a new instance.
- troveclient.v1.shell.do_database_create(cs, args)
- Creates a database on an instance.
- troveclient.v1.shell.do_database_delete(cs, args)
- Deletes a database from an instance.
- troveclient.v1.shell.do_database_list(cs, args)
- Lists available databases on an instance.
- troveclient.v1.shell.do_datastore_list(cs, args)
- Lists available datastores.
- troveclient.v1.shell.do_datastore_show(cs, args)
- Shows details of a datastore.
- troveclient.v1.shell.do_datastore_version_list(cs, args)
- Lists available versions for a datastore.
- troveclient.v1.shell.do_datastore_version_show(cs, args)
- Shows details of a datastore version.
- troveclient.v1.shell.do_delete(cs, args)
- Delete specified instance(s).
- troveclient.v1.shell.do_detach_replica(cs, args)
- Detaches a replica instance from its replication source.
- troveclient.v1.shell.do_eject_replica_source(cs, args)
- Ejects a replica source from its set.
- troveclient.v1.shell.do_execution_delete(cs, args)
- Deletes an execution.
- troveclient.v1.shell.do_execution_list(cs, args)
- Lists executions of a scheduled backup of an instance.
- troveclient.v1.shell.do_flavor_list(cs, args)
- Lists available flavors.
- troveclient.v1.shell.do_flavor_show(cs, args)
- Shows details of a flavor.
- troveclient.v1.shell.do_force_delete(cs, args)
- Force delete an instance.
- troveclient.v1.shell.do_limit_list(cs, args)
- Lists the limits for a tenant.
- troveclient.v1.shell.do_list(cs, args)
- Lists all the instances.
- troveclient.v1.shell.do_log_disable(cs, args)
- Instructs Trove guest to stop collecting log details.
- troveclient.v1.shell.do_log_discard(cs, args)
- Instructs Trove guest to discard the container of the published log.
- troveclient.v1.shell.do_log_enable(cs, args)
- Instructs Trove guest to start collecting log details.
- troveclient.v1.shell.do_log_list(cs, args)
- Lists the log files available for instance.
- troveclient.v1.shell.do_log_publish(cs, args)
- Instructs Trove guest to publish latest log entries on instance.
- troveclient.v1.shell.do_log_save(cs, args)
- Save log file for instance.
- troveclient.v1.shell.do_log_show(cs, args)
- Instructs Trove guest to show details of log.
- troveclient.v1.shell.do_log_tail(cs, args)
- Display log entries for instance.
- troveclient.v1.shell.do_metadata_create(cs, args)
- Creates metadata in the database for instance <id>.
- troveclient.v1.shell.do_metadata_delete(cs, args)
- Deletes metadata for instance <id>.
- troveclient.v1.shell.do_metadata_edit(cs, args)
- Replaces metadata value with a new one, this is non-destructive.
- troveclient.v1.shell.do_metadata_list(cs, args)
- Shows all metadata for instance <id>.
- troveclient.v1.shell.do_metadata_show(cs, args)
- Shows metadata entry for key <key> and instance <id>.
- troveclient.v1.shell.do_metadata_update(cs, args)
- Updates metadata, this is destructive.
- troveclient.v1.shell.do_module_apply(cs, args)
- Apply modules to an instance.
- troveclient.v1.shell.do_module_create(cs, args)
- Create a module.
- troveclient.v1.shell.do_module_delete(cs, args)
- Delete a module.
- troveclient.v1.shell.do_module_instance_count(cs, args)
- Lists a count of the instances for each module md5.
- troveclient.v1.shell.do_module_instances(cs, args)
- Lists the instances that have a particular module applied.
- troveclient.v1.shell.do_module_list(cs, args)
- Lists the modules available.
- troveclient.v1.shell.do_module_list_instance(cs, args)
- Lists the modules that have been applied to an instance.
- troveclient.v1.shell.do_module_query(cs, args)
- Query the status of the modules on an instance.
- troveclient.v1.shell.do_module_reapply(cs, args)
- Reapply a module.
- troveclient.v1.shell.do_module_remove(cs, args)
- Remove a module from an instance.
- troveclient.v1.shell.do_module_retrieve(cs, args)
- Retrieve module contents from an instance.
- troveclient.v1.shell.do_module_show(cs, args)
- Shows details of a module.
- troveclient.v1.shell.do_module_update(cs, args)
- Update a module.
- troveclient.v1.shell.do_promote_to_replica_source(cs, args)
- Promotes a replica to be the new replica source of its set.
- troveclient.v1.shell.do_quota_show(cs, args)
- Show quotas for a tenant.
- troveclient.v1.shell.do_quota_update(cs, args)
- Update quotas for a tenant.
- troveclient.v1.shell.do_reset_status(cs, args)
- Set the task status of an instance to NONE if the instance is in BUILD or ERROR state. Resetting task status of an instance in BUILD state will allow the instance to be deleted.
- troveclient.v1.shell.do_resize_instance(cs, args)
- Resizes an instance with a new flavor.
- troveclient.v1.shell.do_resize_volume(cs, args)
- Resizes the volume size of an instance.
- troveclient.v1.shell.do_restart(cs, args)
- Restarts an instance.
- troveclient.v1.shell.do_root_disable(cs, args)
- Disables root for an instance.
- troveclient.v1.shell.do_root_enable(cs, args)
- Enables root for an instance and resets if already exists.
- troveclient.v1.shell.do_root_show(cs, args)
- Gets status if root was ever enabled for an instance or cluster.
- troveclient.v1.shell.do_schedule_create(cs, args)
- Schedules backups for an instance.
- troveclient.v1.shell.do_schedule_delete(cs, args)
- Deletes a schedule.
- troveclient.v1.shell.do_schedule_list(cs, args)
- Lists scheduled backups for an instance.
- troveclient.v1.shell.do_schedule_show(cs, args)
- Shows details of a schedule.
- troveclient.v1.shell.do_secgroup_add_rule(cs, args)
- Creates a security group rule.
- troveclient.v1.shell.do_secgroup_delete_rule(cs, args)
- Deletes a security group rule.
- troveclient.v1.shell.do_secgroup_list(cs, args)
- Lists all security groups.
- troveclient.v1.shell.do_secgroup_list_rules(cs, args)
- Lists all rules for a security group.
- troveclient.v1.shell.do_secgroup_show(cs, args)
- Shows details of a security group.
- troveclient.v1.shell.do_show(cs, args)
- Shows details of an instance.
- troveclient.v1.shell.do_update(cs, args)
- Updates an instance: Edits name, configuration, or replica source.
- troveclient.v1.shell.do_upgrade(cs, args)
- Upgrades an instance to a new datastore version.
- troveclient.v1.shell.do_user_create(cs, args)
- Creates a user on an instance.
- troveclient.v1.shell.do_user_delete(cs, args)
- Deletes a user from an instance.
- troveclient.v1.shell.do_user_grant_access(cs, args)
- Grants access to a database(s) for a user.
- troveclient.v1.shell.do_user_list(cs, args)
- Lists the users for an instance.
- troveclient.v1.shell.do_user_revoke_access(cs, args)
- Revokes access to a database for a user.
- troveclient.v1.shell.do_user_show(cs, args)
- Shows details of a user of an instance.
- troveclient.v1.shell.do_user_show_access(cs, args)
- Shows access details of a user of an instance.
- troveclient.v1.shell.do_user_update_attributes(cs, args)
- Updates a user's attributes on an instance. At least one optional argument must be provided.
- troveclient.v1.shell.do_volume_type_list(cs, args)
- Lists available volume types.
- troveclient.v1.shell.do_volume_type_show(cs, args)
- Shows details of a volume type.
troveclient.v1.storage module
- class troveclient.v1.storage.Device(manager, info, loaded=False)
- Bases: troveclient.base.Resource
Storage is an opaque instance used to hold storage information.
- class troveclient.v1.storage.StorageInfo(api)
- Bases: troveclient.base.ManagerWithFind
Manage Storage resources.
- index()
- Get a list of all storages.
- Return type
- list of Storages.
- list()
- resource_class
- alias of Device
troveclient.v1.users module
- class troveclient.v1.users.User(manager, info, loaded=False)
- Bases: troveclient.base.Resource
A database user.
- class troveclient.v1.users.Users(api)
- Bases: troveclient.base.ManagerWithFind
Manage Users resources.
- change_passwords(instance, users)
- Change the password for one or more users.
- create(instance, users)
- Create users with permissions to the specified databases.
- delete(instance, username, hostname=None)
- Delete an existing user in the specified instance.
- get(instance, username, hostname=None)
- Get a single User from the instance's Database.
- Return type
- User.
- grant(instance, username, databases, hostname=None)
- Allow an existing user permissions to access a database.
- list(instance, limit=None, marker=None)
- Get a list of all Users from the instance's Database.
- Return type
- list of User.
- list_access(instance, username, hostname=None)
- Show all databases the given user has access to.
- resource_class
- alias of User
- revoke(instance, username, database, hostname=None)
- Revoke from an existing user access permissions to a database.
- update_attributes(instance, username, newuserattr=None, hostname=None)
- Update attributes of a single User in an instance.
- Return type
- User.
troveclient.v1.volume_types module
- class troveclient.v1.volume_types.VolumeType(manager, info, loaded=False)
- Bases: troveclient.base.Resource
A VolumeType is an Cinder volume type.
- class troveclient.v1.volume_types.VolumeTypes(api)
- Bases: troveclient.base.ManagerWithFind
Manage VolumeType resources.
- get(volume_type)
- Get a specific volume-type.
- Return type
- VolumeType
- list()
- Get a list of all volume-types. :rtype: list of VolumeType.
- list_datastore_version_associated_volume_types(datastore, version_id)
- Get a list of all volume-types for the specified datastore type and datastore version . :rtype: list of VolumeType.
- resource_class
- alias of VolumeType
Module contents
Submodules
troveclient.auth_plugin module
- class troveclient.auth_plugin.BaseAuthPlugin
- Bases: object
Base class for authentication plugins.
An authentication plugin needs to override at least the authenticate method to be a valid plugin.
- static add_opts(parser)
- Populate and return the parser with the options for this plugin.
If the plugin does not need any options, it should return the same parser untouched.
- authenticate(cls, auth_url)
- Authenticate using plugin defined method.
- get_auth_url()
- Return the auth url for the plugin (if any).
- parse_opts(args)
- Parse the actual auth-system options if any.
This method is expected to populate the attribute self.opts with a dict containing the options and values needed to make authentication. If the dict is empty, the client should assume that it needs the same options as the 'keystone' auth system (i.e. os_username and os_password).
Returns the self.opts dict.
- troveclient.auth_plugin.discover_auth_systems()
- Discover the available auth-systems.
This won't take into account the old style auth-systems.
- troveclient.auth_plugin.load_auth_system_opts(parser)
- Load options needed by the available auth-systems into a parser.
This function will try to populate the parser with options from the available plugins.
- troveclient.auth_plugin.load_plugin(auth_system)
troveclient.base module
Base utilities to build API operation managers and objects on top of.
- class troveclient.base.Manager(api)
- Bases: troveclient.utils.HookableMixin
Manager defining CRUD operations for API.
Managers interact with a particular type of API (servers, flavors, images, etc.) and provide CRUD operations for them.
- completion_cache(cache_type, obj_class, mode)
- Bash-completion cache.
The completion cache store items that can be used for bash autocompletion, like UUIDs or human-friendly IDs.
A resource listing will clear and repopulate the cache.
A resource create will append to the cache.
Delete is not handled because listings are assumed to be performed often enough to keep the cache reasonably up-to-date.
- resource_class = None
- write_to_completion_cache(cache_type, val)
- class troveclient.base.ManagerWithFind(api)
- Bases: troveclient.base.Manager
Like a Manager, but with additional find()/findall() methods.
- find(**kwargs)
- Find a single item with attributes matching **kwargs.
This isn't very efficient: it loads the entire list then filters on the Python side.
- findall(**kwargs)
- Find all items with attributes matching **kwargs.
This isn't very efficient: it loads the entire list then filters on the Python side.
- abstract list()
- class troveclient.base.Resource(manager, info, loaded=False)
- Bases: troveclient.apiclient.base.Resource
A resource represents a particular instance of an object like server.
This is pretty much just a bag for attributes. :param manager: Manager object :param info: dictionary representing resource attributes :param loaded: prevent lazy-loading if set to True
- HUMAN_ID = False
- troveclient.base.getid(obj)
- Retrieves an id from object or integer.
Abstracts the common pattern of allowing both an object or an object's ID as a parameter when dealing with relationships.
troveclient.client module
OpenStack Client interface. Handles the REST calls and responses.
- troveclient.client.Client(version, *args, **kwargs)
- class troveclient.client.HTTPClient(user, password, projectid, auth_url, insecure=False, timeout=None, tenant_id=None, proxy_tenant_id=None, proxy_token=None, region_name=None, endpoint_type='publicURL', service_type=None, service_name=None, database_service_name=None, retries=None, http_log_debug=False, cacert=None, bypass_url=None, auth_system='keystone', auth_plugin=None)
- Bases: troveclient.client.TroveClientMixin
- USER_AGENT = 'python-troveclient'
- authenticate()
- delete(url, **kwargs)
- get(url, **kwargs)
- http_log_req(args, kwargs)
- http_log_resp(resp)
- patch(url, **kwargs)
- post(url, **kwargs)
- put(url, **kwargs)
- request(url, method, **kwargs)
- class troveclient.client.SessionClient(session, auth, **kwargs)
- Bases: keystoneauth1.adapter.LegacyJsonAdapter, troveclient.client.TroveClientMixin
- request(url, method, **kwargs)
- class troveclient.client.TroveClientMixin
- Bases: object
- get_database_api_version_from_endpoint()
- troveclient.client.get_version_map()
troveclient.common module
- class troveclient.common.Paginated(items=None, next_marker=None, links=None)
- Bases: list
- troveclient.common.append_query_strings(url, **query_strings)
- troveclient.common.check_for_exceptions(resp, body, url)
- troveclient.common.quote_user_host(user, host)
troveclient.exceptions module
Exception definitions
- exception troveclient.exceptions.GuestLogNotFoundError
- Bases: Exception
The specified guest log does not exist.
- exception troveclient.exceptions.NoTokenLookupException
- Bases: Exception
This form of authentication does not support looking up endpoints from an existing token.
- exception troveclient.exceptions.ResponseFormatError
- Bases: Exception
Could not parse the response format.
troveclient.extension module
- class troveclient.extension.Extension(name, module)
- Bases: troveclient.utils.HookableMixin
Extension descriptor.
- SUPPORTED_HOOKS = ('__pre_parse_args__', '__post_parse_args__')
troveclient.i18n module
oslo.i18n integration module.
See https://docs.openstack.org/oslo.i18n/latest/user/index.html .
troveclient.service_catalog module
- class troveclient.service_catalog.ServiceCatalog(resource_dict)
- Bases: object
Helper methods for dealing with a Keystone Service Catalog.
- get_token()
- url_for(attr=None, filter_value=None, service_type=None, endpoint_type='publicURL', service_name=None, database_service_name=None)
- Fetch the public URL from the Compute service for a particular endpoint attribute. If none given, return the first. See tests for sample service catalog.
troveclient.shell module
Command-line interface to the OpenStack Trove API.
- class troveclient.shell.OpenStackHelpFormatter(prog, indent_increment=2, max_help_position=34, width=None)
- Bases: argparse.HelpFormatter
- start_section(heading)
- class troveclient.shell.OpenStackTroveShell
- Bases: object
- do_bash_completion(args)
- Prints arguments for bash_completion.
Prints all of the commands and options to stdout so that the trove.bash_completion script doesn't have to hard code them.
- do_help(args)
- Displays help about this program or one of its subcommands.
- get_base_parser(argv)
- get_subcommand_parser(version, argv)
- main(argv)
- setup_debugging(debug)
- class troveclient.shell.TroveClientArgumentParser(*args, **kwargs)
- Bases: argparse.ArgumentParser
- add_argument(dest, ..., name=value, ...)
- add_argument(option_string, option_string, ..., name=value, ...)
- error(message: string)
- Prints a usage message incorporating the message to stderr and exits.
- troveclient.shell.main()
troveclient.utils module
- class troveclient.utils.HookableMixin
- Bases: object
Mixin so classes can register and run hooks.
- classmethod add_hook(hook_type, hook_func)
- classmethod run_hooks(hook_type, *args, **kwargs)
- troveclient.utils.add_arg(f, *args, **kwargs)
- Bind CLI arguments to a shell.py do_foo function.
- troveclient.utils.arg(*args, **kwargs)
- Decorator for CLI args.
- troveclient.utils.decode_data(data)
- Encode the data using the base64 codec.
- troveclient.utils.do_action_on_many(action, resources, success_msg, error_msg)
- Helper to run an action on many resources.
- troveclient.utils.do_action_with_msg(action, success_msg)
- Helper to run an action with return message.
- troveclient.utils.encode_data(data)
- Encode the data using the base64 codec.
- troveclient.utils.env(*vars, **kwargs)
- Returns environment variables.
Returns the first environment variable set if none are non-empty, defaults to '' or keyword arg default
- troveclient.utils.find_resource(manager, name_or_id)
- Helper for the _find_* methods.
- troveclient.utils.get_resource_id_by_name(manager, name)
- troveclient.utils.get_service_type(f)
- Retrieves service type from function.
- troveclient.utils.is_admin(cs)
- troveclient.utils.is_uuid_like(val)
- Returns validation of a value as a UUID.
For our purposes, a UUID is a canonical form string: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
- troveclient.utils.isunauthenticated(f)
- Decorator to mark authentication-non-required.
Checks to see if the function is marked as not requiring authentication with the @unauthenticated decorator. Returns True if decorator is set to True, False otherwise.
- troveclient.utils.print_dict(d, property='Property')
- troveclient.utils.print_list(objs, fields, formatters={}, order_by=None, obj_is_dict=False, labels={})
- troveclient.utils.safe_issubclass(*args)
- Like issubclass, but will just return False if not a class.
- troveclient.utils.service_type(stype)
- Adds 'service_type' attribute to decorated function.
Usage:
@service_type('database')
def mymethod(f):
...
- troveclient.utils.translate_keys(collection, convert)
- troveclient.utils.unauthenticated(f)
- Adds 'unauthenticated' attribute to decorated function.
Usage:
@unauthenticated def mymethod(f):
...
Module contents
INDICES AND TABLES
- genindex
- search
AUTHOR
unknown
COPYRIGHT
2020, OpenStack Foundation
| June 19, 2020 | 3.3.1 |
