[英]Connecting to Rackspace Cloud using ASP.net
I am trying to connect to Rackspace Cloud using Asp.net. 我正在尝试使用Asp.net连接到Rackspace Cloud。
I've downloaded Rackspace.CloudFiles assembly from NuGet, and i am trying to connect to the server: 我已经从NuGet下载了Rackspace.CloudFiles程序集,并且试图连接到服务器:
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? 当我连接到Rackspace时,是否可以指定位置?
You may want to get the entire OpenStack .NET SDK via NuGet; 您可能需要通过NuGet获取整个OpenStack .NET SDK; 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; 如果您确实决定使用OpenStack .NET SDK,请随时提出问题。 I'm here to help.
我是来帮忙的。
-- Don Schenck, OpenStack .NET Developer Advocate, Rackspace -Rackspace的OpenStack .NET开发人员Don Schenck
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.