I didn’t find straight-forward instructions for using .NET with XIPCloud on Internap’s portal, so I’ll pass along what I learned. This article assumes you are using Visual Studio 2010 and that you have already acquired an Internap account for XIPCloud.
- Acquire & Build OpenStack C# SDK
- Download the Rackspace C# library for OpenStack. Go to the Rackspace / csharp-cloud page on GitHub, push the Downloads button and click on the zip file to download (this article is based on csharp-cloudfiles-22.214.171.124)
- Extract the zip files into your preferred location (where you typically keep external or 3rd party code or assemblies)
- Using Visual Studio open the solution file, com.mosso.cloudfiles.sln, from the extracted files location.
- Build the solution – I batch built all configs. Assuming the builds completed successfully, you now have the OpenStack C# assemblies in <Sln file location>csharp-cloudfiles-126.96.36.199com.mosso.cloudfilesbin[Debug|Release]
- Close the solution
- Create A OpenStack Client Application
- Create a new .NET application – this article uses a C# console application.
- Right-click the References folder under your new project and select Add Reference…
- Push the Browse button, navigate to the csharp-cloudfiles assemblies (see #4 above), select com.mosso.cloudfiles.dll and log4net.dll, push the Add button and then Close
- Now, change Program.cs to:
static void Main(string args)
Uri uriAuth = new Uri(“https://auth.storage.santa-clara.internapcloud.net/v1.0”);
string userName = “<your user name goes here>”;
string apiKey = “<your user password goes here>”;
UserCredentials userCreds = new UserCredentials(uriAuth, userName, apiKey, string.Empty, string.Empty);
Connection connection = new Connection(userCreds);
/* Add more code here. For example, to create a container and copy a file to it…
Now you’re ready to build and run your app! If you have trouble, use Fiddler to diagnose what’s going across in requests, headers, responses, etc.
Somewhere on Internap’s portal or in the developer guide I found the note about using your portal username (email address) and password for X-Auth-User and X-Auth-Key. Hopefully they’ll provide actual API keys like all the other storage providers do.
I hope this helped you get started. Feel free to leave a comment if you have any questions.