Difference between revisions of "OpenStack-SDK-DotNet"
Wayne-foley (talk | contribs) (→Quick Start) |
|||
(9 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | + | __NOTOC__ | |
− | '' | + | {| style="color:#000000; border:solid 1px #A8A8A8; padding:0.5em; margin:0.5em 0; background-color:#FFFFFF;font-size:95%; vertical-align:middle;" |
+ | | style="padding:1em;width: 40px" | [[Image:Warning.svg|40px]] | ||
+ | | <big>'''This project is no longer maintained.'''</big> | ||
+ | This SDK is no longer being developed | ||
+ | Please look at the OpenStack.NET project https://github.com/openstacknetsdk/openstack.net instead. | ||
+ | |} | ||
== Quick Start == | == Quick Start == | ||
+ | Get the latest Nuget package [https://www.nuget.org/packages/OpenStack-SDK-DotNet here], or by running the following command in the [http://docs.nuget.org/docs/start-here/using-the-package-manager-console Package Manager Console]: | ||
+ | |||
+ | PM> Install-Package OpenStack-SDK-DotNet | ||
+ | |||
The following code will connect to Openstack, and print out all of the containers in the default storage account. | The following code will connect to Openstack, and print out all of the containers in the default storage account. | ||
using System; | using System; | ||
− | |||
− | |||
− | |||
using Openstack; | using Openstack; | ||
using Openstack.Identity; | using Openstack.Identity; | ||
using Openstack.Storage; | using Openstack.Storage; | ||
− | var authUri = new Uri("https://region.identity.host.com:12345/v2.0 | + | var authUri = new Uri("https://region.identity.host.com:12345/v2.0"); |
var userName = "user name"; | var userName = "user name"; | ||
var password = "password"; | var password = "password"; | ||
var tenantId = "XXXXXXXXXXXXXX-Project"; | var tenantId = "XXXXXXXXXXXXXX-Project"; | ||
− | + | var credential = new OpenStackCredential(authUri, userName, password, tenantId); | |
− | + | var client = OpenStackClientFactory.CreateClient(credential); | |
− | |||
− | var credential = new | ||
− | var client = | ||
await client.Connect(); | await client.Connect(); | ||
Line 54: | Line 57: | ||
== Design Decisions == | == Design Decisions == | ||
− | # .NET 4. | + | # [[OpenStack-SDK-DotNet/.NetFrameworkSupport|.NET 4.0 is the minimum supported version of the .NET Framework]]. |
# The entire SDK will be in one project. A project for each service isn't something we can easily do on the OpenStack infrastructure. | # The entire SDK will be in one project. A project for each service isn't something we can easily do on the OpenStack infrastructure. | ||
# 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. | # 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. |
Latest revision as of 03:13, 30 December 2015
This project is no longer maintained.
This SDK is no longer being developed Please look at the OpenStack.NET project https://github.com/openstacknetsdk/openstack.net instead. |
Quick Start
Get the latest Nuget package here, or by running the following command in the Package Manager Console:
PM> Install-Package OpenStack-SDK-DotNet
The following code will connect to Openstack, and print out all of the containers in the default storage account.
using System; using Openstack; using Openstack.Identity; using Openstack.Storage;
var authUri = new Uri("https://region.identity.host.com:12345/v2.0"); var userName = "user name"; var password = "password"; var tenantId = "XXXXXXXXXXXXXX-Project";
var credential = new OpenStackCredential(authUri, userName, password, tenantId); var client = OpenStackClientFactory.CreateClient(credential);
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
- Feel native to developers working with the Microsoft .NET Framework.
- Support multiple API versions for each service (e.g., Nova API v1 and v2).
Todo
- 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
- .NET 4.0 is the minimum supported version of the .NET Framework.
- The entire SDK will be in one project. A project for each service isn't something we can easily do on the OpenStack infrastructure.
- 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
IRC
The developers use IRC in #openstack-sdks on freenode for development discussion.