Skip to content

Rackspace Cloud Block Storage Code Samples

jasonmitschke edited this page Apr 12, 2013 · 8 revisions

#CloudBlockStorageProvider Here we will provide samples for basic operation on CloudFilesProvider.

CloudBlockStorageProvider requires we pass in CloudIdentity.

We can create CloudIdentity by passing any 2 combination. Username/Password or Username/APIKey.

var cloudIdentity = new CloudIdentity() { Username = "username", Password = "password" }; or var cloudIdentity = new CloudIdentity() { APIKey = "apikey", Username = "username" };

For more information on IdentityProvider

There are 2 ways to pass in the identity credentials to CloudBlockStorageProvider:

  1. In the constructor.

  2. Into each method individually.

Our samples below will assume the identity has been passed into the constructor.

##Volumes

Create Volume

              var provider = new CloudBlockStorageProvider();
              bool volumeCreatedResponse = provider.CreateVolume(100, "Test Volume Description", 
                                              "Test Volume", null, "SATA", null, cloudIdentity);

List Volumes

              var provider = new CloudBlockStorageProvider();
              IEnumerable volumeListResponse = provider.ListVolumes(null, cloudIdentity);

Show Volume

Coming Soon

Delete Volume

Coming Soon

Volume State Helper Methods

Wait For Volume To Be Available

Coming Soon

Wait For Volume To Be Deleted

Coming Soon

Wait For Volume Specific State

Coming Soon

##Volume Types

List Volume Types

Coming Soon

Describe Volume Type

Coming Soon

##Snapshots

Create Snapshot

Coming Soon

List Snapshots

Coming Soon

Show Snapshot

Coming Soon

Delete Snapshot

Coming Soon

Snapshot State Helper Methods

Wait For Snapshot To Be Available

Coming Soon

Wait For Snapshot To Be Deleted

Coming Soon

Wait For Specific Snapshot State

Coming Soon

Clone this wiki locally