Trove is an OpenStack project to supply databases as a service. Rackspace’s Cloud Databases¬†API are based on this and so the trove Python client is compatible with your Rackspace provided Cloud Databases or your own implementation of Trove.

This example we’ll go over using this with Rackspaces’s Cloud Databases. I’m using OS X so my example will be for that OS, but the client should be compatible with most Linux distros.

Now we’ll setup some environment variables for the Trove client to use. Change <username> to your Cloud account username and <tenant_id> to your Cloud account number and <password> to your Cloud account users password. Also change the region (DFW, ORD, IAD, LON, SYD, HKG) to whichever data center you want to manage your Cloud Databases in.

Now you can interact with your Cloud Databases. Some of the things trove makes extremely simple are creating, deleting, resizing and restarting database instances, enabling root access on your Cloud Database, which is disabled by default with Cloud Databases, backups and user management. Here’s a few examples.

Create a new Cloud Database instance with 512MB RAM and 2GB disk space.

Enable root on your Cloud Database instance.

The Trove clients makes backing up and restoring your Cloud Databases really simple too. Here’s a list of the things the Trove client can do.

backup-create Creates a backup. backup-delete Deletes a backup. backup-list List available backups. backup-list-instance List available backups for an instance. backup-show Show details of a backup. create Creates a new instance. database-create Creates a database on an instance. database-delete Deletes a database. database-list Lists available databases on an instance. delete Deletes an instance. flavor-list Lists available flavors. flavor-show Show details of a flavor. limit-list Lists the limits for a tenant. list List all the instances. resize-flavor Resizes the flavor of an instance. resize-volume Resizes the volume size of an instance. restart Restarts the instance. root-enable Enables root for a instance. root-show Gets root enabled status for a instance. secgroup-add-rule Creates a security group rule. secgroup-delete-rule Deletes a security group rule. secgroup-list Lists all security groups. secgroup-show Shows details about a security group. show Show details of an instance. user-create Creates a user. user-delete Deletes a user from the instance. user-grant-access Grants access to a database(s) for a user. user-list Lists the users for a instance. user-revoke-access Revokes access to a database for a user. user-show Gets a user from the instance. user-show-access Gets a users access from the instance. user-update-attributes Updates a users attributes from the instance.