Jump to: navigation, search

Difference between revisions of "OpenStack-SDK-DotNet"

(Quick Start)
Line 8: Line 8:
 
     using System;
 
     using System;
 
     using System.Linq;
 
     using System.Linq;
    using System.Security;
 
 
     using System.Threading;
 
     using System.Threading;
 
     using Openstack;
 
     using Openstack;

Revision as of 18:22, 21 April 2014

Note: This SDK is currently being developed. It's not ready to be used in application development as the API will be changing.

Quick Start

The following code will connect to Openstack, and print out all of the containers in the default storage account.

   using System;
   using System.Linq;
   using System.Threading;
   using Openstack;
   using Openstack.Identity;
   using Openstack.Storage;
   var authUri = new Uri("https://region.identity.host.com:12345/v2.0/tokens");
   var userName = "user name";
   var password = "password";
   var tenantId = "XXXXXXXXXXXXXX-Project";
   var credential = new OpenstackCredential(authUri, userName, password, tenantId);
   var client = new OpenstackClient(credential, CancellationToken.None);
   await client.Connect();
   var storageServiceClient = client.CreateServiceClient<IStorageServiceClient>();
   var storageAccount = await storageServiceClient.GetStorageAccount();
   foreach(var container in storageAccount.Containers)
   {
       Console.WriteLine(container.Name);
   }

Summary

This is a proposed OpenStack project that is designed to improve the experience of OpenStack end-users who are using the Microsoft .NET Framework by providing them with everything they need to develop applications against OpenStack.

What's in an SDK?: An SDK is more than just a set of APIs provided to you. A complete SDK provides a consumer focused API for interacting with the system, and it additionally includes:

  • Documentation aimed at users consuming the SDK and system.
  • Clear examples of usage, including functioning, executable examples.

Audience

The primary target for this package is application developers who develop against OpenStack. This does not include those who develop OpenStack itself or operate it. These are developers looking to consume a feature-rich OpenStack Cloud with its many services. These Developers require a consistent API ("Application Programming Interface") that allows them to build and deploy their application with minimal dependencies.

Requirements

  1. Feel native to developers working with the Microsoft .NET Framework.
  2. Support multiple API versions for each service (e.g., Nova API v1 and v2).

Todo

  1. Expand the number of services and features that are offered by the API (currently only a subset of the Storage service is supported).

Design Decisions

  1. .NET 4.5 is the minimum supported version of the .NET Framework.
  2. The entire SDK will be in one project. A project for each service isn't something we can easily do on the OpenStack infrastructure.
  3. Vendor extensions will have a different top level namespace rather than be inside the OpenStack namespace. This will allow them to easily live as separate projects that depend on the OpenStack project (via composer). If vendor extensions can be part of the OpenStack .NET SDK they could be easily moved in.

Resources

Source code https://github.com/stackforge/openstack-sdk-dotnet
Bug tracker https://bugs.launchpad.net/openstack-sdk-dotnet
Blueprints https://blueprints.launchpad.net/openstack-sdk-dotnet
Gerrit Reviews https://review.openstack.org/#/q/status:open+project:stackforge/openstack-sdk-dotnet,n,z

IRC

The developers use IRC in #openstack-sdks on freenode for development discussion.