Skip to content

Commit

Permalink
Merged working branch
Browse files Browse the repository at this point in the history
  • Loading branch information
EdLeafe committed Nov 18, 2013
1 parent fb7be29 commit fcdb984
Show file tree
Hide file tree
Showing 107 changed files with 3,223 additions and 722 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ include README.md RELEASENOTES.md
recursive-include docs *.md
recursive-include samples *.py
recursive-include tests *.py
recursive-include tests *.png
27 changes: 27 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# Release Notes for pyrax

###2013.11.13 - Version 1.6.2
- Cloud Databases:
- Added missing 'host' parameter. GitHub #246
- Cloud Queues:
- Removed requirement for Client ID for non-message requests. GitHub #244
- Added support for ServiceNet queues. GitHub #240
- Added the `claim_id` parameter to message deletion calls. GitHub #243
- Fixed a bug when parsing message and claim IDs.
- Made several corrections in the docs. - Cloud DNS:
- Added handling for an occasional empty body when polling a running request.
GitHub #237
- General:
- Added support for Python Wheel distribution
- Fixed missing file spec in MANIFEST.in
- Removed unneeded files

###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
1 change: 1 addition & 0 deletions docs/cloud_blockstorage.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Parameter | Description | Required

When you create a volume from a snapshot, the new volume is a copy of the volume from which the snapshot was created. The new volume must be the same size as the original volume used to create the snapshot. If you create a new volume from scratch, it is the equivalent of an unformatted disk drive.

There are additional parameters in the response that are not described in the request parameter table above. **`status`** is typically available although it can be creating if the volume is from a snapshot operation. **`availability_zone`** is always "nova". **`bootable`** is currently always False. **`source_volid`** is currently not used by CBS.

Here is an example of the call to create a new 500 GB volume that uses SSD for high performance:

Expand Down
74 changes: 68 additions & 6 deletions 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 @@ -91,16 +91,16 @@ Both calls return an object representing the newly-created database:


## Create a User
You can create a user on an instance with its own username/password credentials, with access to one or more databases on that instance. Similar to database creation, you can call `create_user()` either on the instance object, or on the module. To simplify these examples, only the call on the instance is displayed.
You can create a user on an instance with its own username/password credentials, with access to one or more databases on that instance, and optionally restricted to connecting from particular host addresses. Similar to database creation, you can call `create_user()` either on the instance object, or on the module. To simplify these examples, only the call on the instance is displayed.

Assuming that you have the references `inst` and `db` from the previous examples, you can create a user like this:

user = inst.create_user(name="groucho", password="top secret", database_names=[db])
user = inst.create_user(name="groucho", password="top secret", database_names=[db], host="%")
print "User:", user

This prints out:

User: <CloudDatabaseUser databases=[{u'name': u'db_name'}], name=groucho>
User: <CloudDatabaseUser databases=[{u'name': u'db_name'}], name=groucho, host="%">


## List Databases or Users in an Instance
Expand All @@ -114,7 +114,7 @@ Instances have a `list_databases()` and a `list_users()` method:
which outputs:

DBs: [<CloudDatabaseDatabase name=db_name>]
Users: [<CloudDatabaseUser databases=[{u'name': u'db_name'}], name=groucho>]
Users: [<CloudDatabaseUser databases=[{u'name': u'db_name'}], name=groucho>, host="%"]


## Get a `CloudDatabaseDatabase` or `CloudDatabaseUser` Object
Expand All @@ -128,7 +128,69 @@ You can get a `CloudDatabaseDatabase` or `CloudDatabaseUser` object from an `Clo
which outputs:

DB: <CloudDatabaseDatabase name=db_name>
User: <CloudDatabaseUser databases=[{u'name': u'db_name'}], name=groucho>
User: <CloudDatabaseUser databases=[{u'name': u'db_name'}], name=groucho, host="%">


## 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
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 fcdb984

Please sign in to comment.