Question

I am trying to connect to Rackspace Cloud using Asp.net.

I've downloaded Rackspace.CloudFiles assembly from NuGet, and i am trying to connect to the server:

UserCredentials userCred = new UserCredentials("username", "api_key");
Connection connection = new Connection(userCred);
var containers = connection.GetContainers();

This works, but it connects every time to only one storage location. In rackspace control panel, i have more locations where i have containers.

Is there a way to specify the Location when i connect to Rackspace?

Was it helpful?

Solution

You may want to get the entire OpenStack .NET SDK via NuGet; it allows you to connect to "the cloud" and then select containers based on region (or all regions, or course).

Such as this:

// Get a list of containers
CloudFilesProvider cfp = new CloudFilesProvider(_cloudIdentity);
IEnumerable<ContainerCDN> listOfContainers = cfp.ListCDNContainers(region: "DFW");

If you do decide to use the OpenStack .NET SDK, please don't hesitate to ask questions; I'm here to help.

-- Don Schenck, OpenStack .NET Developer Advocate, Rackspace

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top