Skip to content

Commit

Permalink
Version 1.6.1 - adds support for Backups for Cloud Databases.
Browse files Browse the repository at this point in the history
  • Loading branch information
EdLeafe committed Oct 31, 2013
1 parent da5f2d6 commit 2c431e0
Show file tree
Hide file tree
Showing 93 changed files with 2,844 additions and 565 deletions.
11 changes: 11 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Release Notes for pyrax

###2013.10.31 - Version 1.6.1
- Cloud Databases:
- Added support for Backups. GitHub #216
- Added ability to specify 'host' parameter for users. GitHub #229
- Added ability to update users.
- Queues:
- Removed default TTL for messages. GitHub #234
- Cloud Files:
- Fixed large file upload bug. GitHub #231
- Fixed file naming bug. GitHub #232

###2013.10.24 - Version 1.6.0
- New:
- Added support for **Cloud Queues** (Marconi).
Expand Down
64 changes: 63 additions & 1 deletion docs/cloud_databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To get a list of all your instances, just run:
This returns a list of `CloudDatabaseInstance` objects. Assuming that you are just starting out and have not yet created any instances, you get back an empty list. A good first step, then, would be to create an instance.


## Create the Instance
## Create an Instance
To create an instance, you need to specify the flavor and volume size for that instance. 'Flavor' refers to the amount of RAM allocated to your instance. Volume size is the disk space available to your instance for storing its data. The volume size is in GB, and must be a whole number between 1 and 50.


Expand Down Expand Up @@ -131,6 +131,68 @@ which outputs:
User: <CloudDatabaseUser databases=[{u'name': u'db_name'}], name=groucho>


## Backups
You can create a backup of your instance that can be used to re-create that instance at a later date. The backup is created asynchronously. During the backup process, database writes on MyISAM Databases will be disabled. InnoDB Databases will continue to allow all operations.

While the instance is being backed up you will not be able to add/delete databases, add/delete users, or delete/stop/reboot the instance. Users can only run one backup at a time. Duplicate requests will receive a 422 error.

Backups are not deleted when the instance is deleted. You must remove any backups created if you no longer wish to retain them. See the section below on [Deleting a Backup](#deleting-a-backup).

During backup the files will be streamed to your Cloud Files account. The process creates a container called z_CLOUDDB_BACKUPS and places all the files in it. In order for the restore and deletion of backups to work properly, you should not move, rename, or delete any of the files from this container. You will be charged the normal Cloud Files rate for storage of these files.

In the unlikely event that the backup fails to perform correctly and is in the state FAILED, there may be some files that were placed in the container. Deleting the failed backup will remove any such files. See the section below on [Deleting a Backup](#deleting-a-backup).

### Create a Backup
To create a backup, you must specify the instance and a name for the backup. You may optionally supply a text description. The name is limited to 64 characters. If you have a `CloudDatabaseInstance` object, you can make the call directly to its `create_backup()` method. The calls are:

backup = cdb.create_backup(instance, name[, description=None])
# - or -
backup = instance.create_backup(name[, description=None])

Both of these calls return a `CloudDatabaseBackup` object that represents the backup. You can query its status attribute to determine its progress:

Status | Description
---- | ----
NEW | A new backup task was created.
RUNNING | The backup task is currently running.
COMPLETED | The backup task was successfully completed.
FAILED | The backup task failed to complete successfully.

Like other objects that take time to finish being created, you can also use the `utils.wait_for_build(backup)` method call to either block until the build completes, or pass a callback to be triggered upon completion.


## List Backups
There are two ways to list backups: you can either list all the backups, or list just those backups for a particular instance. To get a list of all your backups, call:

cdb.list_backups()

To only list the backups for a particular instance, call:

cdb.list_backups(instance)

If you have a `CloudDatabaseInstance` object, you can also call its `list_backups()` method to get a listing of all backups for that instance:

instance.list_backups()


## Deleting a Backup
If you no longer wish to keep a backup, you can delete it. This will remove it from your list of available backups, and remove the files from your Cloud Files account. You will need either the backup's ID or the `CloudDatabaseBackup` object for the backup you wish to delete. The call is:

cdb.delete_backup(backup)
# - or -
backup.delete()


## Restoring From a Backup
If you need to create a new instance from one of your backups, you can call the `restore_backup()` method. The call is:

cdb.restore_backup(backup, name, flavor, volume)

The parameters are the same as the call to `create()`, with the exception of the `backup` parameter, which must be either a `CloudDatabaseBackup` object, or the ID of one of your backups. See the [Create an Instance](#create-an-instance) section above for the specifics of the other parameters.

All users/passwords/access that were on the instance at the time of the backup will be restored along with the databases. You can create new users or databases if you want, but they cannot be the same as the ones from the instance that was backed up.


## Working with `CloudDatabaseDatabase` and `CloudDatabaseUser` Objects
These objects are essentially read-only representations of the underlying MySQL database running in your instance. You cannot update the attributes of these objects and expect them to change anything in the instance. They are useful mostly to determine the state of your database. The one method they have is `delete()`, which causes them to be deleted from their instance.

Expand Down
6 changes: 5 additions & 1 deletion docs/html/annotated.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@
<tr><td class="indexkey"><a class="el" href="classpyrax_1_1cloudblockstorage_1_1CloudBlockStorageSnapshotManager.html">CloudBlockStorageSnapshotManager</a></td><td class="indexvalue">Manager class for Cloud Block Storage </td></tr>
<tr><td class="indexkey"><a class="el" href="classpyrax_1_1cloudblockstorage_1_1CloudBlockStorageVolume.html">CloudBlockStorageVolume</a></td><td class="indexvalue">This class represents a Block Storage volume </td></tr>
<tr><td class="indexkey"><a class="el" href="classpyrax_1_1cloudblockstorage_1_1CloudBlockStorageVolumeType.html">CloudBlockStorageVolumeType</a></td><td class="indexvalue">This class represents a Block Storage Volume Type </td></tr>
<tr><td class="indexkey"><a class="el" href="classpyrax_1_1clouddatabases_1_1CloudDatabaseBackup.html">CloudDatabaseBackup</a></td><td class="indexvalue">This class represents a database backup </td></tr>
<tr><td class="indexkey"><a class="el" href="classpyrax_1_1clouddatabases_1_1CloudDatabaseBackupManager.html">CloudDatabaseBackupManager</a></td><td class="indexvalue">This class handles operations on backups for a Cloud Database instance </td></tr>
<tr><td class="indexkey"><a class="el" href="classpyrax_1_1clouddatabases_1_1CloudDatabaseClient.html">CloudDatabaseClient</a></td><td class="indexvalue">This is the primary class for interacting with Cloud Databases </td></tr>
<tr><td class="indexkey"><a class="el" href="classpyrax_1_1clouddatabases_1_1CloudDatabaseDatabase.html">CloudDatabaseDatabase</a></td><td class="indexvalue">This class represents a database on a <a class="el" href="classpyrax_1_1clouddatabases_1_1CloudDatabaseInstance.html" title="This class represents a MySQL instance in the cloud.">CloudDatabaseInstance</a> </td></tr>
<tr><td class="indexkey"><a class="el" href="classpyrax_1_1clouddatabases_1_1CloudDatabaseDatabaseManager.html">CloudDatabaseDatabaseManager</a></td><td class="indexvalue">This class manages communication with databases on Cloud Database instances </td></tr>
Expand Down Expand Up @@ -142,6 +144,7 @@
<tr><td class="indexkey"><a class="el" href="classpyrax_1_1cloudnetworks_1_1CloudNetworkManager.html">CloudNetworkManager</a></td><td class="indexvalue">Does nothing special, but is used in testing </td></tr>
<tr><td class="indexkey"><a class="el" href="classpyrax_1_1cf__wrapper_1_1client_1_1Connection.html">Connection</a></td><td class="indexvalue">This class wraps the swiftclient connection, adding support for CDN </td></tr>
<tr><td class="indexkey"><a class="el" href="classpyrax_1_1cf__wrapper_1_1container_1_1Container.html">Container</a></td><td class="indexvalue">Represents a CloudFiles container </td></tr>
<tr><td class="indexkey"><a class="el" href="classpyrax_1_1exceptions_1_1DBUpdateUnchanged.html">DBUpdateUnchanged</a></td><td class="indexvalue"></td></tr>
<tr><td class="indexkey"><a class="el" href="classpyrax_1_1exceptions_1_1DNSCallTimedOut.html">DNSCallTimedOut</a></td><td class="indexvalue"></td></tr>
<tr><td class="indexkey"><a class="el" href="classpyrax_1_1exceptions_1_1DomainCreationFailed.html">DomainCreationFailed</a></td><td class="indexvalue"></td></tr>
<tr><td class="indexkey"><a class="el" href="classpyrax_1_1exceptions_1_1DomainDeletionFailed.html">DomainDeletionFailed</a></td><td class="indexvalue"></td></tr>
Expand Down Expand Up @@ -195,6 +198,7 @@
<tr><td class="indexkey"><a class="el" href="classpyrax_1_1identity_1_1keystone__identity_1_1KeystoneIdentity.html">KeystoneIdentity</a></td><td class="indexvalue">Implements the Keystone-specific behaviors for Identity </td></tr>
<tr><td class="indexkey"><a class="el" href="classpyrax_1_1exceptions_1_1MissingAuthSettings.html">MissingAuthSettings</a></td><td class="indexvalue"></td></tr>
<tr><td class="indexkey"><a class="el" href="classpyrax_1_1exceptions_1_1MissingClaimParameters.html">MissingClaimParameters</a></td><td class="indexvalue"></td></tr>
<tr><td class="indexkey"><a class="el" href="classpyrax_1_1exceptions_1_1MissingDBUserParameters.html">MissingDBUserParameters</a></td><td class="indexvalue"></td></tr>
<tr><td class="indexkey"><a class="el" href="classpyrax_1_1exceptions_1_1MissingDNSSettings.html">MissingDNSSettings</a></td><td class="indexvalue"></td></tr>
<tr><td class="indexkey"><a class="el" href="classpyrax_1_1exceptions_1_1MissingHealthMonitorSettings.html">MissingHealthMonitorSettings</a></td><td class="indexvalue"></td></tr>
<tr><td class="indexkey"><a class="el" href="classpyrax_1_1exceptions_1_1MissingLoadBalancerParameters.html">MissingLoadBalancerParameters</a></td><td class="indexvalue"></td></tr>
Expand Down Expand Up @@ -283,7 +287,7 @@


<hr class="footer"/><address class="footer"><small>
Generated on Thu Oct 24 2013 09:26:06 for pyrax by &#160;<a href="http://www.doxygen.org/index.html">
Generated on Thu Oct 31 2013 10:46:53 for pyrax by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
Expand Down
Loading

0 comments on commit 2c431e0

Please sign in to comment.