Rackspace .NET SDK

Automating all things Rackspace

View project on GitHub

RackConnect Public IP Support

September 3, 2015

Rackspace.NET v0.2 adds partial support for Rackspace's Hybrid Cloud, RackConnect. RackConnect enables you to connect your dedicated servers to our fully managed cloud, giving you the performance of traditional hosting plus increased security with single-tenant Cloud Networks.

With RackConnect Public IP support, you can spin up cloud servers on your private network and also make them available on the public internet. Download v0.2 on NuGet and checkout the RackConnect Samples to get started today!

var rackConnectService = new RackConnectService(identityService);

// Lookup your private network
var networks = await rackConnectService.ListNetworksAsync();
var myNetwork = networks.First();

// Create a cloud server on your private network
var serverService = new CloudServersProvider(null, "{region}", identityService, null);
var server = serverService.CreateServer("{server-name}", "{image-id}", "{flavor-id}",
    networks: new string[] { myNetwork.Id });
serverService.WaitForServerActive(server.Id);

// Allocate a public IP and assign it to your cloud server-name
var ip = await rackConnectService.CreatePublicIPAsync(
    new PublicIPCreateDefinition { ServerId = server.Id });
await ip.WaitUntilActiveAsync();