简体   繁体   中英

Connecting to Rackspace Cloud using ASP.net

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM