├── src ├── Samples │ ├── CPPCodeSamples │ │ ├── app.rc │ │ ├── app.ico │ │ ├── resource.h │ │ ├── Stdafx.h │ │ ├── Stdafx.cpp │ │ └── AssemblyInfo.cpp │ ├── FSharpCodeSamples │ │ ├── packages.config │ │ ├── app.config │ │ └── ObjectStorageProviderExamples.fs │ ├── VBCodeSamples │ │ ├── packages.VBCodeSamples.config │ │ ├── My Project │ │ │ ├── Settings.settings │ │ │ ├── Application.Designer.vb │ │ │ ├── Application.myapp │ │ │ └── AssemblyInfo.vb │ │ └── app.config │ └── CSharpCodeSamples │ │ ├── packages.CSharpCodeSamples.config │ │ ├── app.config │ │ └── Properties │ │ └── AssemblyInfo.cs ├── corelib │ ├── Icons │ │ └── openstack_net_logo.png │ ├── Testing │ │ └── NamespaceDoc.cs │ ├── Core │ │ ├── NamespaceDoc.cs │ │ ├── Domain │ │ │ ├── NamespaceDoc.cs │ │ │ ├── Queues │ │ │ │ ├── NamespaceDoc.cs │ │ │ │ └── Message.cs │ │ │ ├── Mapping │ │ │ │ ├── NamespaceDoc.cs │ │ │ │ └── IJsonObjectMapper`1.cs │ │ │ ├── Metadata.cs │ │ │ ├── ObjectStore.cs │ │ │ ├── Converters │ │ │ │ ├── NamespaceDoc.cs │ │ │ │ └── IPAddressNoneIsNullSimpleConverter.cs │ │ │ ├── Tenant.cs │ │ │ ├── VolumeType.cs │ │ │ ├── ProviderStateBase`1.cs │ │ │ ├── SimpleServer.cs │ │ │ ├── CloudIdentityWithProject.cs │ │ │ └── HomeDocument.cs │ │ ├── Collections │ │ │ └── NamespaceDoc.cs │ │ ├── Exceptions │ │ │ ├── Response │ │ │ │ ├── NamespaceDoc.cs │ │ │ │ └── ItemNotFoundException.cs │ │ │ └── NamespaceDoc.cs │ │ ├── Compat │ │ │ └── ISafeSerializationData.cs │ │ ├── Caching │ │ │ └── NamespaceDoc.cs │ │ ├── Validators │ │ │ ├── NamespaceDoc.cs │ │ │ ├── INetworksValidator.cs │ │ │ ├── IBlockStorageValidator.cs │ │ │ ├── IHttpResponseCodeValidator.cs │ │ │ └── IObjectStorageValidator.cs │ │ ├── ParallelExtensionsExtras │ │ │ ├── TaskFactoryExtensions_Common.cs │ │ │ ├── TaskFactoryExtensions_From.cs │ │ │ └── TaskFactoryExtensions_ContinueWhenAllAny.cs │ │ ├── Providers │ │ │ └── NamespaceDoc.cs │ │ ├── Synchronous │ │ │ └── NamespaceDoc.cs │ │ ├── AsyncCompletionOption.cs │ │ ├── IBackoffPolicy.cs │ │ ├── IEncodeDecodeProvider.cs │ │ └── IStatusParser.cs │ ├── Networking │ │ ├── IPVersion.cs │ │ ├── NamespaceDoc.cs │ │ └── v2 │ │ │ ├── NamespaceDoc.cs │ │ │ ├── NetworkDefinition.cs │ │ │ ├── Serialization │ │ │ ├── PortDefinitionCollection.cs │ │ │ ├── SubnetDefinitionCollection.cs │ │ │ ├── NetworkDefinitionCollection.cs │ │ │ ├── PortCollection.cs │ │ │ ├── SubnetCollection.cs │ │ │ └── NetworkCollection.cs │ │ │ ├── NetworkStatus.cs │ │ │ ├── PortStatus.cs │ │ │ ├── Subnet.cs │ │ │ ├── Port.cs │ │ │ └── PortUpdateDefinition.cs │ ├── Authentication │ │ ├── NamespaceDoc.cs │ │ └── AuthenticatedHttpClientFactory.cs │ ├── Providers │ │ ├── Rackspace │ │ │ ├── Objects │ │ │ │ ├── NamespaceDoc.cs │ │ │ │ ├── Dns │ │ │ │ │ └── NamespaceDoc.cs │ │ │ │ ├── Queues │ │ │ │ │ ├── NamespaceDoc.cs │ │ │ │ │ ├── Request │ │ │ │ │ │ ├── NamespaceDoc.cs │ │ │ │ │ │ └── ClaimMessagesRequest.cs │ │ │ │ │ └── Response │ │ │ │ │ │ ├── NamespaceDoc.cs │ │ │ │ │ │ └── ListCloudQueuesResponse.cs │ │ │ │ ├── Request │ │ │ │ │ ├── NamespaceDoc.cs │ │ │ │ │ ├── RescueServerRequest.cs │ │ │ │ │ ├── UnrescueServerRequest.cs │ │ │ │ │ ├── RevertServerResizeRequest.cs │ │ │ │ │ ├── ConfirmServerResizeRequest.cs │ │ │ │ │ ├── AddUserRequest.cs │ │ │ │ │ ├── AddRoleRequest.cs │ │ │ │ │ ├── ServerResizeRequest.cs │ │ │ │ │ ├── ServerRebootRequest.cs │ │ │ │ │ ├── ServerRebuildRequest.cs │ │ │ │ │ ├── CreateCloudNetworkRequest.cs │ │ │ │ │ └── CreateServerImageRequest.cs │ │ │ │ ├── Response │ │ │ │ │ ├── NamespaceDoc.cs │ │ │ │ │ ├── MetaDataResponse.cs │ │ │ │ │ ├── ListCloudNetworksResponse.cs │ │ │ │ │ ├── CreateServerResponse.cs │ │ │ │ │ ├── UsersResponse.cs │ │ │ │ │ ├── ListAddressesResponse.cs │ │ │ │ │ ├── ListImagesResponse.cs │ │ │ │ │ ├── GetImageDetailsResponse.cs │ │ │ │ │ ├── ListFlavorsResponse.cs │ │ │ │ │ ├── FlavorDetailsResponse.cs │ │ │ │ │ ├── ListVolumeResponse.cs │ │ │ │ │ ├── TenantsResponse.cs │ │ │ │ │ ├── ListSnapshotResponse.cs │ │ │ │ │ ├── ListImagesDetailsResponse.cs │ │ │ │ │ ├── ListVolumeTypeResponse.cs │ │ │ │ │ ├── ListFlavorDetailsResponse.cs │ │ │ │ │ ├── RescueServerResponse.cs │ │ │ │ │ ├── GetCloudBlockStorageVolumeTypeResponse.cs │ │ │ │ │ ├── AuthenticationResponse.cs │ │ │ │ │ ├── NewUserResponse.cs │ │ │ │ │ ├── ServerVolumeListResponse.cs │ │ │ │ │ ├── MetadataItemResponse.cs │ │ │ │ │ ├── BulkDeleteResponse.cs │ │ │ │ │ ├── CloudNetworkResponse.cs │ │ │ │ │ ├── UserCredentialResponse.cs │ │ │ │ │ ├── GetCloudBlockStorageVolumeResponse.cs │ │ │ │ │ ├── GetCloudBlockStorageSnapshotResponse.cs │ │ │ │ │ ├── PasswordCredentialResponse.cs │ │ │ │ │ ├── RoleResponse.cs │ │ │ │ │ ├── ListServersResponse.cs │ │ │ │ │ ├── ServerVolumeResponse.cs │ │ │ │ │ ├── ListVirtualInterfacesResponse.cs │ │ │ │ │ ├── ServerDetailsResponse.cs │ │ │ │ │ ├── ListEndpointsResponse.cs │ │ │ │ │ └── RolesResponse.cs │ │ │ │ ├── Monitoring │ │ │ │ │ ├── NamespaceDoc.cs │ │ │ │ │ ├── CpuCheckDetails.cs │ │ │ │ │ ├── MemoryCheckDetails.cs │ │ │ │ │ └── LoadAverageCheckDetails.cs │ │ │ │ ├── LoadBalancers │ │ │ │ │ ├── NamespaceDoc.cs │ │ │ │ │ ├── Request │ │ │ │ │ │ ├── NamespaceDoc.cs │ │ │ │ │ │ ├── SetLoadBalancerErrorPageRequest.cs │ │ │ │ │ │ ├── UpdateLoadBalancerRequest.cs │ │ │ │ │ │ ├── SetLoadBalancerContentCachingRequest.cs │ │ │ │ │ │ ├── SetLoadBalancerConnectionLoggingRequest.cs │ │ │ │ │ │ ├── AddNodesRequest.cs │ │ │ │ │ │ ├── CreateLoadBalancerRequest.cs │ │ │ │ │ │ ├── CreateAccessListRequest.cs │ │ │ │ │ │ └── AddLoadBalancerMetadataRequest.cs │ │ │ │ │ ├── Response │ │ │ │ │ │ ├── NamespaceDoc.cs │ │ │ │ │ │ ├── GetLoadBalancerNodeResponse.cs │ │ │ │ │ │ ├── GetLoadBalancerResponse.cs │ │ │ │ │ │ ├── GetLoadBalancerSslConfigurationResponse.cs │ │ │ │ │ │ ├── GetAccessListResponse.cs │ │ │ │ │ │ ├── GetLoadBalancerContentCachingResponse.cs │ │ │ │ │ │ ├── GetLoadBalancerMetadataItemResponse.cs │ │ │ │ │ │ ├── GetLoadBalancerConnectionLoggingResponse.cs │ │ │ │ │ │ └── ListVirtualAddressesResponse.cs │ │ │ │ │ └── CustomHealthMonitor.cs │ │ │ │ ├── AutoScale │ │ │ │ │ └── NamespaceDoc.cs │ │ │ │ ├── Databases │ │ │ │ │ ├── NamespaceDoc.cs │ │ │ │ │ ├── DatabaseUser.cs │ │ │ │ │ └── Database.cs │ │ │ │ ├── Mapping │ │ │ │ │ └── NamespaceDoc.cs │ │ │ │ └── AuthDetails.cs │ │ │ ├── Exceptions │ │ │ │ ├── NamespaceDoc.cs │ │ │ │ └── InvalidETagException.cs │ │ │ ├── Validators │ │ │ │ ├── NamespaceDoc.cs │ │ │ │ └── CloudBlockStorageValidator.cs │ │ │ ├── NamespaceDoc.cs │ │ │ ├── IRackspaceProvider.cs │ │ │ ├── IProviderFactory`2.cs │ │ │ └── RackspaceImpersonationIdentity.cs │ │ └── Hp │ │ │ └── NamespaceDoc.cs │ ├── app.config │ ├── ContentDeliveryNetworks │ │ └── v1 │ │ │ ├── NamespaceDoc.cs │ │ │ ├── ServiceError.cs │ │ │ ├── ServiceProtocol.cs │ │ │ ├── Provider.cs │ │ │ ├── ServiceCollection.cs │ │ │ ├── FlavorCollection.cs │ │ │ ├── Flavor.cs │ │ │ ├── ServiceDomain.cs │ │ │ ├── ServiceCacheRule.cs │ │ │ ├── ServiceRestrictionRule.cs │ │ │ ├── ServiceOriginRule.cs │ │ │ ├── ServiceRestriction.cs │ │ │ └── ServiceStatus.cs │ ├── packages.config │ ├── Extensions │ │ ├── HttpHeadersExtensions.cs │ │ ├── EnumerableExtensions.cs │ │ ├── HttpRequestMessageExtensions.cs │ │ └── TypeExtensions.cs │ ├── PageExtensions.cs │ ├── NamespaceDoc.cs │ ├── Page.cs │ ├── Serialization │ │ ├── TimeSpanInSecondsConverter.cs │ │ └── IdentifierConverter.cs │ └── Exceptions │ │ └── RegionRequiredException.cs ├── Documentation │ ├── packages.config │ ├── NuGet.config │ ├── History │ │ ├── 1.3.6 │ │ │ └── packages.config │ │ ├── Current │ │ │ └── packages.config │ │ └── 1.4 │ │ │ └── packages.config │ ├── Content │ │ └── MSHelpViewerRoot.aml │ ├── README.md │ └── OpenStackSDK.content ├── lib │ └── Security.Cryptography │ │ ├── Security.Cryptography.dll │ │ └── Security.Cryptography.pdb ├── testing │ ├── integration │ │ ├── Providers │ │ │ └── Rackspace │ │ │ │ ├── CloudFiles │ │ │ │ └── DarkKnightRises.jpg │ │ │ │ └── OrderedTest1.orderedtest │ │ ├── TestData.cs │ │ ├── App.config │ │ ├── ContentDeliveryNetworks │ │ │ └── v1 │ │ │ │ └── ContentDeliveryNetworkServiceTests.cs │ │ ├── XunitTraceListener.cs │ │ ├── Identity │ │ │ └── v2 │ │ │ │ └── IdentityTests.cs │ │ └── packages.config │ └── unit │ │ ├── TestCategories.cs │ │ ├── Extensions │ │ └── EnumerableExtensionsTests.cs │ │ ├── app.config │ │ ├── ContentDeliveryNetworks │ │ └── v1 │ │ │ ├── ContentDeliveryNetworkServiceTests.cs │ │ │ ├── ServiceOperationFailedExceptionTests.cs │ │ │ └── ServiceCacheTests.cs │ │ ├── packages.config │ │ ├── Stubs.cs │ │ ├── OpenStackNetTests.cs │ │ ├── Serialization │ │ └── EmptyEnumerableTests.cs │ │ └── AuthenticationTests.cs └── Local.testsettings ├── LICENSE.md ├── appveyor.yml ├── NuGet.config ├── .gitattributes └── .gitignore /src/Samples/CPPCodeSamples/app.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rackspace/openstack.net/master/src/Samples/CPPCodeSamples/app.rc -------------------------------------------------------------------------------- /src/Samples/CPPCodeSamples/app.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rackspace/openstack.net/master/src/Samples/CPPCodeSamples/app.ico -------------------------------------------------------------------------------- /src/Samples/CPPCodeSamples/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by app.rc 4 | -------------------------------------------------------------------------------- /src/corelib/Icons/openstack_net_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rackspace/openstack.net/master/src/corelib/Icons/openstack_net_logo.png -------------------------------------------------------------------------------- /src/Documentation/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/lib/Security.Cryptography/Security.Cryptography.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rackspace/openstack.net/master/src/lib/Security.Cryptography/Security.Cryptography.dll -------------------------------------------------------------------------------- /src/lib/Security.Cryptography/Security.Cryptography.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rackspace/openstack.net/master/src/lib/Security.Cryptography/Security.Cryptography.pdb -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The license information for this project is stored in the following location: 2 | [src/Documentation/Content/License.aml](src/Documentation/Content/License.aml) 3 | -------------------------------------------------------------------------------- /src/testing/integration/Providers/Rackspace/CloudFiles/DarkKnightRises.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rackspace/openstack.net/master/src/testing/integration/Providers/Rackspace/CloudFiles/DarkKnightRises.jpg -------------------------------------------------------------------------------- /src/Samples/CPPCodeSamples/Stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, 3 | // but are changed infrequently 4 | 5 | #pragma once 6 | 7 | 8 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build} 2 | os: Visual Studio 2015 RC 3 | build_script: 4 | - msbuild build\build.proj /nologo /t:CI 5 | after_build: 6 | - cd build 7 | - powershell -Command .\appveyor-deploy-docs.ps1 8 | - cd .. 9 | test: off 10 | -------------------------------------------------------------------------------- /src/Samples/CPPCodeSamples/Stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // CPPCodeSamples.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | -------------------------------------------------------------------------------- /src/Samples/FSharpCodeSamples/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/testing/integration/Providers/Rackspace/OrderedTest1.orderedtest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/Samples/VBCodeSamples/packages.VBCodeSamples.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/Samples/CSharpCodeSamples/packages.CSharpCodeSamples.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/testing/integration/TestData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace OpenStack 4 | { 5 | public static class TestData 6 | { 7 | public static string GenerateName() 8 | { 9 | return string.Format("ci-test-{0}", Guid.NewGuid()); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /NuGet.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/Samples/VBCodeSamples/My Project/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/corelib/Testing/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace OpenStack.Testing 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace defines utilities for unit and integration testing. 7 | /// 8 | [CompilerGenerated] 9 | internal class NamespaceDoc 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Documentation/NuGet.config: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/corelib/Core/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespaces define provider-independent 7 | /// interfaces and implementations of OpenStack APIs. 8 | /// 9 | [CompilerGenerated] 10 | internal class NamespaceDoc 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/corelib/Networking/IPVersion.cs: -------------------------------------------------------------------------------- 1 | namespace OpenStack.Networking 2 | { 3 | /// 4 | /// Internet Protocol Version 5 | /// 6 | public enum IPVersion 7 | { 8 | /// 9 | /// IPv4 10 | /// 11 | IPv4 = 4, 12 | 13 | /// 14 | /// IPv6 15 | /// 16 | IPv6 = 6 17 | } 18 | } -------------------------------------------------------------------------------- /src/corelib/Core/Domain/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Domain 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespaces define the provider-independent 7 | /// object model for calling the OpenStack REST APIs. 8 | /// 9 | [CompilerGenerated] 10 | internal class NamespaceDoc 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/corelib/Networking/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace OpenStack.Networking 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace defines provider-independent 7 | /// interfaces and implementations for the OpenStack Networking API. 8 | /// 9 | [CompilerGenerated] 10 | internal class NamespaceDoc 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/testing/unit/TestCategories.cs: -------------------------------------------------------------------------------- 1 | namespace OpenStackNet.Testing.Unit 2 | { 3 | internal static class TestCategories 4 | { 5 | /// 6 | /// This test category should be applied to tests which should run in the automated build environment as part of 7 | /// validating a pull request or other change. 8 | /// 9 | public const string Unit = "Unit"; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/corelib/Authentication/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace OpenStack.Authentication 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace defines provider-independent 7 | /// interfaces and implementations related to authentication. 8 | /// 9 | [CompilerGenerated] 10 | internal class NamespaceDoc 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/corelib/Networking/v2/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace OpenStack.Networking.v2 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace defines provider-independent 7 | /// interfaces and implementations for the OpenStack Networking API. 8 | /// 9 | [CompilerGenerated] 10 | internal class NamespaceDoc 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/corelib/Core/Domain/Queues/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Domain.Queues 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace defines the provider-independent 7 | /// object model for calling the OpenStack Queues API. 8 | /// 9 | [CompilerGenerated] 10 | internal class NamespaceDoc 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/corelib/Core/Collections/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Collections 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace contains interfaces and 7 | /// classes that extend the collections support provided by the base class library. 8 | /// 9 | [CompilerGenerated] 10 | internal class NamespaceDoc 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/corelib/Core/Exceptions/Response/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Exceptions.Response 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace contains 7 | /// exception classes that represent errors returned by a call to a REST API. 8 | /// 9 | [CompilerGenerated] 10 | internal class NamespaceDoc 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/testing/unit/Extensions/EnumerableExtensionsTests.cs: -------------------------------------------------------------------------------- 1 | using Xunit; 2 | 3 | namespace System.Collections.Generic 4 | { 5 | public class EnumerableExtensionsTests 6 | { 7 | [Fact] 8 | public void ToCollection_ReturnsANewCollection_WhenPassedInNull() 9 | { 10 | IEnumerable items = null; 11 | IList result = items.ToNonNullList(); 12 | Assert.NotNull(result); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/corelib/Core/Compat/ISafeSerializationData.cs: -------------------------------------------------------------------------------- 1 | #if NET35 2 | 3 | namespace System.Runtime.Serialization 4 | { 5 | /// 6 | /// For internal compatibility use only. 7 | /// 8 | internal interface ISafeSerializationData 9 | { 10 | /// 11 | /// For internal compatibility use only. 12 | /// 13 | void CompleteDeserialization(object deserialized); 14 | } 15 | } 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/corelib/Core/Caching/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Caching 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace defines types 7 | /// used for caching, for example, the results of calls to various REST APIs 8 | /// that are frequently reused. 9 | /// 10 | [CompilerGenerated] 11 | internal class NamespaceDoc 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespaces define 7 | /// the object model for communicating with Rackspace services over REST APIs. 8 | /// 9 | [CompilerGenerated] 10 | internal class NamespaceDoc 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/corelib/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/testing/unit/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | # Source code files 4 | .cs text diff=csharp 5 | *.vsixmanifest text 6 | *.config text 7 | *.resx text 8 | *.vstemplate text 9 | *.nuspec text 10 | *.md text 11 | *.txt text 12 | *.ps1 text 13 | LICENSE text 14 | 15 | # Projects and solutions 16 | *.sln text merge=binary eol=crlf 17 | *.csproj text merge=binary eol=crlf 18 | *.shfbproj text merge=binary eol=crlf 19 | 20 | # Certainly binary files 21 | *.png binary 22 | *.ico binary 23 | *.snk binary 24 | -------------------------------------------------------------------------------- /src/Samples/CSharpCodeSamples/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/Samples/FSharpCodeSamples/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/Samples/VBCodeSamples/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/corelib/ContentDeliveryNetworks/v1/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace OpenStack.ContentDeliveryNetworks.v1 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace defines provider-independent 7 | /// interfaces and implementations for the OpenStack Content Delivery Network API. 8 | /// 9 | [CompilerGenerated] 10 | internal class NamespaceDoc 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Documentation/History/1.3.6/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/corelib/Core/Exceptions/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Exceptions 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace defines general 7 | /// (not provider-specific) exception classes for errors which may occur while 8 | /// working with OpenStack providers. 9 | /// 10 | [CompilerGenerated] 11 | internal class NamespaceDoc 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Exceptions/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Exceptions 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace defines 7 | /// exception classes for errors which occur while using Rackspace-specific functionality. 8 | /// 9 | [CompilerGenerated] 10 | internal class NamespaceDoc 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Dns/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Dns 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespaces define 7 | /// the object model for communicating with Rackspace's Cloud DNS service over REST APIs. 8 | /// 9 | [CompilerGenerated] 10 | internal class NamespaceDoc 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/corelib/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Queues/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Queues 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespaces define 7 | /// the object model for communicating with Rackspace's Cloud Queues service over REST APIs. 8 | /// 9 | [CompilerGenerated] 10 | internal class NamespaceDoc 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/corelib/Providers/Hp/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Hp 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespaces provide an 7 | /// implementation of the core OpenStack interfaces for accessing HP cloud 8 | /// products and services, as well as additional HP-specific functionality. 9 | /// 10 | [CompilerGenerated] 11 | internal class NamespaceDoc 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Request/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Request 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace 7 | /// contains the object models for JSON request bodies sent in calls to Rackspace's 8 | /// REST APIs. 9 | /// 10 | [CompilerGenerated] 11 | internal class NamespaceDoc 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace 7 | /// contains the object models for JSON responses returned by calls to Rackspace's 8 | /// REST APIs. 9 | /// 10 | [CompilerGenerated] 11 | internal class NamespaceDoc 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Validators/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Validators 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace defines 7 | /// classes for validating various arguments before they are used in API calls to Rackspace 8 | /// services. 9 | /// 10 | [CompilerGenerated] 11 | internal class NamespaceDoc 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Monitoring/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Monitoring 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace defines 7 | /// the object model for communicating with Rackspace's Cloud Monitoring service over REST APIs. 8 | /// 9 | [CompilerGenerated] 10 | internal class NamespaceDoc 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Samples/VBCodeSamples/My Project/Application.Designer.vb: -------------------------------------------------------------------------------- 1 | '------------------------------------------------------------------------------ 2 | ' 3 | ' This code was generated by a tool. 4 | ' Runtime Version:4.0.30319.34003 5 | ' 6 | ' Changes to this file may cause incorrect behavior and will be lost if 7 | ' the code is regenerated. 8 | ' 9 | '------------------------------------------------------------------------------ 10 | 11 | Option Strict On 12 | Option Explicit On 13 | 14 | -------------------------------------------------------------------------------- /src/corelib/Core/Validators/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Validators 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace defines interfaces 7 | /// for validating request arguments prior to sending them in calls to REST APIs. 8 | /// These interfaces may be implemented in a provider-specific manner. 9 | /// 10 | [CompilerGenerated] 11 | internal class NamespaceDoc 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/corelib/Core/Domain/Mapping/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Domain.Mapping 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace defines interfaces 7 | /// and classes for mapping between various object types. Mappings are bidirectional 8 | /// converters limited to operating on two specific types. 9 | /// 10 | [CompilerGenerated] 11 | internal class NamespaceDoc 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/corelib/Extensions/HttpHeadersExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Http.Headers; 2 | 3 | namespace System.Net.Http 4 | { 5 | internal static class HttpHeadersExtensions 6 | { 7 | public const string AuthTokenHeader = "X-Auth-Token"; 8 | 9 | public static void SetAuthToken(this HttpHeaders headers, string value) 10 | { 11 | if (headers.Contains(AuthTokenHeader)) 12 | headers.Remove(AuthTokenHeader); 13 | 14 | headers.Add(AuthTokenHeader, value); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/LoadBalancers/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.LoadBalancers 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespaces define 7 | /// the object model for communicating with Rackspace's Cloud Load Balancers service over REST APIs. 8 | /// 9 | [CompilerGenerated] 10 | internal class NamespaceDoc 11 | { 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespaces provide an 7 | /// implementation of the core OpenStack interfaces for accessing Rackspace 8 | /// products and services, as well as additional Rackspace-specific functionality. 9 | /// 10 | [CompilerGenerated] 11 | internal class NamespaceDoc 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Queues/Request/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Queues.Request 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace 7 | /// contains the object models for JSON request bodies sent in calls to Rackspace's 8 | /// Cloud Queues API. 9 | /// 10 | [CompilerGenerated] 11 | internal class NamespaceDoc 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Samples/VBCodeSamples/My Project/Application.myapp: -------------------------------------------------------------------------------- 1 | 2 | 3 | false 4 | false 5 | 0 6 | true 7 | 0 8 | 1 9 | true 10 | 11 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/AutoScale/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.AutoScale 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace defines 7 | /// the object model for communicating with Rackspace's Cloud Auto Scale service over REST APIs. 8 | /// 9 | /// 10 | [CompilerGenerated] 11 | internal class NamespaceDoc 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Databases/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Databases 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace defines 7 | /// the object model for communicating with Rackspace's Cloud Databases service over REST APIs. 8 | /// 9 | /// 10 | [CompilerGenerated] 11 | internal class NamespaceDoc 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Queues/Response/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Queues.Response 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace 7 | /// contains the object models for JSON responses returned by calls to Rackspace's 8 | /// Cloud Queues API. 9 | /// 10 | [CompilerGenerated] 11 | internal class NamespaceDoc 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/corelib/ContentDeliveryNetworks/v1/ServiceError.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace OpenStack.ContentDeliveryNetworks.v1 4 | { 5 | /// 6 | /// Represents a service error generated by the . 7 | /// 8 | /// 9 | public class ServiceError 10 | { 11 | /// 12 | /// The error message. 13 | /// 14 | [JsonProperty("message")] 15 | public string Message { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/LoadBalancers/Request/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.LoadBalancers.Request 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace 7 | /// contains the object models for JSON request bodies sent in calls to Rackspace's 8 | /// Cloud Load Balancers API. 9 | /// 10 | [CompilerGenerated] 11 | internal class NamespaceDoc 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/LoadBalancers/Response/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.LoadBalancers.Response 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace 7 | /// contains the object models for JSON responses returned by calls to Rackspace's 8 | /// Cloud Load Balancers API. 9 | /// 10 | [CompilerGenerated] 11 | internal class NamespaceDoc 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Mapping/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Mapping 2 | { 3 | using System.Runtime.CompilerServices; 4 | using net.openstack.Core.Domain.Mapping; 5 | 6 | /// 7 | /// The namespace provides 8 | /// implementations of used in Rackspace-specific 9 | /// features. 10 | /// 11 | [CompilerGenerated] 12 | internal class NamespaceDoc 13 | { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/corelib/Core/ParallelExtensionsExtras/TaskFactoryExtensions_Common.cs: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // File: TaskFactoryExtensions_Common.cs 6 | // 7 | //-------------------------------------------------------------------------- 8 | 9 | namespace System.Threading.Tasks 10 | { 11 | /// Extensions for TaskFactory. 12 | /// 13 | internal static partial class TaskFactoryExtensions 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Documentation/History/Current/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/corelib/Core/Domain/Metadata.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Newtonsoft.Json; 4 | 5 | namespace net.openstack.Core.Domain 6 | { 7 | /// 8 | /// Represents metadata for servers and images in the Compute Service. 9 | /// 10 | /// 11 | /// The metadata keys for the compute provider are case-sensitive. 12 | /// 13 | /// 14 | [JsonDictionary] 15 | [Serializable] 16 | public class Metadata : Dictionary 17 | { 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/corelib/Core/Providers/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Providers 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace defines providers 7 | /// interfaces for OpenStack services. These interfaces may expose optional 8 | /// functionality and service extensions documented at OpenStack. Other 9 | /// provider-specific extensions are included under the specific provider. 10 | /// 11 | [CompilerGenerated] 12 | internal class NamespaceDoc 13 | { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/IRackspaceProvider.cs: -------------------------------------------------------------------------------- 1 | using net.openstack.Core.Domain; 2 | using net.openstack.Core.Providers; 3 | 4 | namespace net.openstack.Providers.Rackspace 5 | { 6 | internal interface IRackspaceProvider 7 | { 8 | /// 9 | /// The used by the provider. 10 | /// 11 | IIdentityProvider IdentityProvider { get; } 12 | 13 | /// 14 | /// The default identify used by the provider. 15 | /// 16 | CloudIdentity DefaultIdentity { get; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/corelib/ContentDeliveryNetworks/v1/ServiceProtocol.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | using Newtonsoft.Json; 3 | using Newtonsoft.Json.Converters; 4 | 5 | namespace OpenStack.ContentDeliveryNetworks.v1 6 | { 7 | /// 8 | /// Protocol used to access the assets on a domain. 9 | /// 10 | [JsonConverter(typeof(StringEnumConverter))] 11 | public enum ServiceProtocol 12 | { 13 | /// 14 | [EnumMember(Value = "http")] 15 | HTTP, 16 | 17 | /// 18 | [EnumMember(Value = "https")] 19 | HTTPS 20 | } 21 | } -------------------------------------------------------------------------------- /src/corelib/Extensions/EnumerableExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | 3 | namespace System.Collections.Generic 4 | { 5 | internal static class EnumerableExtensions 6 | { 7 | /// 8 | /// Creates a new list wrapping the specified items. 9 | /// If is , returns an empty list. 10 | /// 11 | public static IList ToNonNullList(this IEnumerable items) 12 | { 13 | if(items == null) 14 | return new List(); 15 | 16 | return items.ToList(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/corelib/Networking/v2/NetworkDefinition.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using OpenStack.Serialization; 3 | 4 | namespace OpenStack.Networking.v2 5 | { 6 | /// 7 | /// Represents the definition of a network resource of the . 8 | /// 9 | /// 10 | [JsonConverterWithConstructor(typeof(RootWrapperConverter), "network")] 11 | public class NetworkDefinition 12 | { 13 | /// 14 | /// The network name. 15 | /// 16 | [JsonProperty("name")] 17 | public string Name { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /src/Documentation/History/1.4/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/LoadBalancers/Request/SetLoadBalancerErrorPageRequest.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.LoadBalancers.Request 2 | { 3 | using net.openstack.Providers.Rackspace.Objects.LoadBalancers.Response; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// 8 | [JsonObject(MemberSerialization.OptIn)] 9 | internal class SetLoadBalancerErrorPageRequest : GetLoadBalancerErrorPageResponse 10 | { 11 | public SetLoadBalancerErrorPageRequest(string content) 12 | : base(content) 13 | { 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/LoadBalancers/Request/UpdateLoadBalancerRequest.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.LoadBalancers.Request 2 | { 3 | using Newtonsoft.Json; 4 | 5 | /// 6 | /// 7 | [JsonObject(MemberSerialization.OptIn)] 8 | internal class UpdateLoadBalancerRequest 9 | { 10 | [JsonProperty("loadBalancer")] 11 | private LoadBalancerUpdate _loadBalancerUpdate; 12 | 13 | public UpdateLoadBalancerRequest(LoadBalancerUpdate update) 14 | { 15 | _loadBalancerUpdate = update; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/LoadBalancers/Request/SetLoadBalancerContentCachingRequest.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.LoadBalancers.Request 2 | { 3 | using net.openstack.Providers.Rackspace.Objects.LoadBalancers.Response; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// 8 | [JsonObject(MemberSerialization.OptIn)] 9 | internal class SetLoadBalancerContentCachingRequest : GetLoadBalancerContentCachingResponse 10 | { 11 | public SetLoadBalancerContentCachingRequest(bool enabled) 12 | : base(enabled) 13 | { 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/corelib/PageExtensions.cs: -------------------------------------------------------------------------------- 1 | using OpenStack.Synchronous.Extensions; 2 | 3 | namespace OpenStack.Synchronous 4 | { 5 | /// 6 | /// Provides synchronous extention methods for an instance. 7 | /// 8 | public static class PageExtensions 9 | { 10 | /// 11 | /// Retrieves the next page of items, if one is available. If is false, an empty page is returned. 12 | /// 13 | public static IPage GetNextPage(this IPage page) 14 | { 15 | return page.GetNextPageAsync().ForceSynchronous(); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/LoadBalancers/Request/SetLoadBalancerConnectionLoggingRequest.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.LoadBalancers.Request 2 | { 3 | using net.openstack.Providers.Rackspace.Objects.LoadBalancers.Response; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// 8 | [JsonObject(MemberSerialization.OptIn)] 9 | internal class SetLoadBalancerConnectionLoggingRequest : GetLoadBalancerConnectionLoggingResponse 10 | { 11 | public SetLoadBalancerConnectionLoggingRequest(bool enabled) 12 | : base(enabled) 13 | { 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/corelib/Networking/v2/Serialization/PortDefinitionCollection.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using OpenStack.Serialization; 3 | 4 | namespace OpenStack.Networking.v2.Serialization 5 | { 6 | /// 7 | /// Represents a collection of port definition resources of the . 8 | /// 9 | /// 10 | /// 11 | [JsonConverterWithConstructor(typeof(RootWrapperConverter), "ports")] 12 | internal class PortDefinitionCollection : List 13 | { 14 | public PortDefinitionCollection(IEnumerable ports) : base(ports) 15 | { 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/testing/unit/ContentDeliveryNetworks/v1/ContentDeliveryNetworkServiceTests.cs: -------------------------------------------------------------------------------- 1 | using Flurl.Http.Testing; 2 | using OpenStack.Synchronous; 3 | using Xunit; 4 | using HttpTest = OpenStack.Testing.HttpTest; 5 | 6 | namespace OpenStack.ContentDeliveryNetworks.v1 7 | { 8 | public class ContentDeliveryNetworkServiceTests 9 | { 10 | private const string Region = "DFW"; 11 | 12 | [Fact] 13 | public void Ping() 14 | { 15 | using (new HttpTest()) 16 | { 17 | var service = new ContentDeliveryNetworkService(Stubs.AuthenticationProvider, Region); 18 | 19 | service.Ping(); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/corelib/Networking/v2/NetworkStatus.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | using Newtonsoft.Json; 3 | using OpenStack.Serialization; 4 | 5 | namespace OpenStack.Networking.v2 6 | { 7 | /// 8 | /// Status 9 | /// 10 | [JsonConverter(typeof(TolerantEnumConverter))] 11 | public enum NetworkStatus 12 | { 13 | /// 14 | /// The network status is unknown. 15 | /// 16 | [EnumMember(Value = "UNKNOWN")] 17 | Unknown, 18 | 19 | /// 20 | /// The network is active. 21 | /// 22 | [EnumMember(Value = "ACTIVE")] 23 | Active 24 | } 25 | } -------------------------------------------------------------------------------- /src/corelib/Networking/v2/Serialization/SubnetDefinitionCollection.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using OpenStack.Serialization; 3 | 4 | namespace OpenStack.Networking.v2.Serialization 5 | { 6 | /// 7 | /// Represents a collection of subnet definition resources of the . 8 | /// 9 | /// 10 | /// 11 | [JsonConverterWithConstructor(typeof(RootWrapperConverter), "subnets")] 12 | internal class SubnetDefinitionCollection : List 13 | { 14 | public SubnetDefinitionCollection(IEnumerable subnets) : base(subnets) 15 | { 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/corelib/Networking/v2/Serialization/NetworkDefinitionCollection.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using OpenStack.Serialization; 3 | 4 | namespace OpenStack.Networking.v2.Serialization 5 | { 6 | /// 7 | /// Represents a collection of network definition resources of the . 8 | /// 9 | /// 10 | /// 11 | [JsonConverterWithConstructor(typeof (RootWrapperConverter), "networks")] 12 | internal class NetworkDefinitionCollection : List 13 | { 14 | public NetworkDefinitionCollection(IEnumerable networks) : base(networks) 15 | { 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Documentation/Content/MSHelpViewerRoot.aml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Welcome to the openstack.net SDK Reference 6 | 7 | 8 |
9 | 10 | Select a topic from the table of contents. 11 | 12 |
13 | 14 | 15 | 16 | 17 |
18 |
19 | -------------------------------------------------------------------------------- /src/corelib/Core/Synchronous/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Synchronous 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace defines classes providing 7 | /// extension methods for calling asynchronous services in a synchronous manner. 8 | /// 9 | /// These extension methods are not recommended for use in new development, but are 10 | /// provided as a compatibility aid for projects where external restrictions preclude 11 | /// the direct use of the asynchronous APIs. 12 | /// 13 | /// 14 | [CompilerGenerated] 15 | internal class NamespaceDoc 16 | { 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Documentation/README.md: -------------------------------------------------------------------------------- 1 | The documentation uses a [special build of Sandcastle Help File Builder (SHFB)](https://github.com/tunnelvisionlabs/SHFB/releases/tag/v2014.11.22.0-beta). 2 | 3 | To build the documentation from the command line, no install is required. Just run the following: 4 | 5 | build.cmd Documentation 6 | 7 | If you want to edit the documentation using Visual Studio, you must first install the [custom build of Sandcastle Help File Builder](https://github.com/tunnelvisionlabs/SHFB/releases/download/v2014.11.22.0-beta/SandcastleHelpFileBuilder.msi) and then install the [custom Sandcastle Help File Builder Visual Studio extension](https://github.com/tunnelvisionlabs/SHFB/releases/download/v2014.11.22.0-beta/SHFBVisualStudioPackage.vsix). 8 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/AuthDetails.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects 2 | { 3 | using Newtonsoft.Json; 4 | 5 | [JsonObject(MemberSerialization.OptIn)] 6 | internal class AuthDetails 7 | { 8 | [JsonProperty("passwordCredentials", DefaultValueHandling = DefaultValueHandling.Include)] 9 | public Credentials PasswordCredentials { get; set; } 10 | 11 | [JsonProperty("RAX-KSKEY:apiKeyCredentials", DefaultValueHandling = DefaultValueHandling.Include)] 12 | public Credentials APIKeyCredentials { get; set; } 13 | 14 | [JsonProperty("RAX-AUTH:domain", DefaultValueHandling = DefaultValueHandling.Include)] 15 | public Domain Domain { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/corelib/Core/Domain/ObjectStore.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Domain 2 | { 3 | using net.openstack.Core.Providers; 4 | 5 | /// 6 | /// Represents the result of various Object Storage operations. 7 | /// 8 | /// 9 | public enum ObjectStore 10 | { 11 | /// 12 | /// The container was created. 13 | /// 14 | /// 15 | ContainerCreated, 16 | 17 | /// 18 | /// The container already exists. 19 | /// 20 | /// 21 | ContainerExists, 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/testing/integration/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/corelib/Core/Domain/Converters/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Domain.Converters 2 | { 3 | using System.Net; 4 | using System.Net.NetworkInformation; 5 | using System.Runtime.CompilerServices; 6 | 7 | /// 8 | /// The namespace defines specialized 9 | /// JSON converters for calling the OpenStack REST APIs. These converters are useful for 10 | /// standard .NET classes that have a one or more specific representations in the 11 | /// OpenStack APIs (e.g. or ), and 12 | /// for extensible enumerations (e.g. ). 13 | /// 14 | [CompilerGenerated] 15 | internal class NamespaceDoc 16 | { 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/corelib/NamespaceDoc.cs: -------------------------------------------------------------------------------- 1 | namespace OpenStack 2 | { 3 | using System.Runtime.CompilerServices; 4 | 5 | /// 6 | /// The namespace defines provider-independent 7 | /// interfaces and implementations of functionality used by all OpenStack APIs. 8 | /// 9 | [CompilerGenerated] 10 | internal class NamespaceDoc 11 | { 12 | } 13 | } 14 | 15 | namespace OpenStack.Synchronous 16 | { 17 | using System.Runtime.CompilerServices; 18 | 19 | /// 20 | /// The namespace defines 21 | /// synchronous wrappers for OpenStack service interfaces which are asynchronous by default. 22 | /// 23 | [CompilerGenerated] 24 | internal class NamespaceDoc 25 | { 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/LoadBalancers/Request/AddNodesRequest.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.LoadBalancers.Request 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using Newtonsoft.Json; 7 | 8 | /// 9 | /// 10 | [JsonObject(MemberSerialization.OptIn)] 11 | internal class AddNodesRequest 12 | { 13 | [JsonProperty("nodes")] 14 | private NodeConfiguration[] _nodes; 15 | 16 | public AddNodesRequest(IEnumerable nodes) 17 | { 18 | if (nodes == null) 19 | throw new ArgumentNullException("nodes"); 20 | 21 | _nodes = nodes.ToArray(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/LoadBalancers/Request/CreateLoadBalancerRequest.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.LoadBalancers.Request 2 | { 3 | using System; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// 8 | [JsonObject(MemberSerialization.OptIn)] 9 | internal class CreateLoadBalancerRequest 10 | { 11 | [JsonProperty("loadBalancer")] 12 | private LoadBalancerConfiguration _configuration; 13 | 14 | public CreateLoadBalancerRequest(LoadBalancerConfiguration configuration) 15 | { 16 | if (configuration == null) 17 | throw new ArgumentNullException("configuration"); 18 | 19 | _configuration = configuration; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/LoadBalancers/CustomHealthMonitor.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.LoadBalancers 2 | { 3 | using Newtonsoft.Json; 4 | 5 | /// 6 | /// This class models the JSON object used to represent a custom . 7 | /// 8 | /// 9 | /// 10 | [JsonObject(MemberSerialization.OptIn)] 11 | public class CustomHealthMonitor : HealthMonitor 12 | { 13 | /// 14 | /// Initializes a new instance of the class 15 | /// during JSON deserialization. 16 | /// 17 | [JsonConstructor] 18 | protected CustomHealthMonitor() 19 | { 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/corelib/ContentDeliveryNetworks/v1/Provider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using net.openstack.Core.Domain; 3 | using Newtonsoft.Json; 4 | 5 | namespace OpenStack.ContentDeliveryNetworks.v1 6 | { 7 | /// 8 | /// Represents a provider resource of the 9 | /// 10 | /// 11 | public class Provider 12 | { 13 | /// 14 | /// The provider name 15 | /// 16 | [JsonProperty("provider")] 17 | public string Name { get; set; } 18 | 19 | /// 20 | /// A collection of links related to the provider. 21 | /// 22 | [JsonProperty("links")] 23 | public IEnumerable Links { get; set; } 24 | } 25 | } -------------------------------------------------------------------------------- /src/corelib/Networking/v2/PortStatus.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | using Newtonsoft.Json; 3 | using OpenStack.Serialization; 4 | 5 | namespace OpenStack.Networking.v2 6 | { 7 | /// 8 | /// Status 9 | /// 10 | [JsonConverter(typeof (TolerantEnumConverter))] 11 | public enum PortStatus 12 | { 13 | /// 14 | /// The port status is unknown. 15 | /// 16 | [EnumMember(Value = "UNKNOWN")] 17 | Unknown, 18 | 19 | /// 20 | /// The port is active. 21 | /// 22 | [EnumMember(Value = "ACTIVE")] 23 | Active, 24 | 25 | /// 26 | /// The port is down. 27 | /// 28 | [EnumMember(Value = "DOWN")] 29 | Down 30 | } 31 | } -------------------------------------------------------------------------------- /src/corelib/Extensions/HttpRequestMessageExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace System.Net.Http 2 | { 3 | internal static class HttpRequestMessageExtensions 4 | { 5 | public static HttpRequestMessage Copy(this HttpRequestMessage request) 6 | { 7 | var message = new HttpRequestMessage(request.Method, request.RequestUri) 8 | { 9 | Content = request.Content, 10 | Version = request.Version 11 | }; 12 | 13 | foreach (var property in request.Properties) 14 | { 15 | message.Properties.Add(property); 16 | } 17 | 18 | foreach (var header in request.Headers) 19 | { 20 | message.Headers.TryAddWithoutValidation(header.Key, header.Value); 21 | } 22 | return message; 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/corelib/Page.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading; 3 | using System.Threading.Tasks; 4 | using Newtonsoft.Json; 5 | 6 | namespace OpenStack 7 | { 8 | /// 9 | /// A page of resources. 10 | /// 11 | /// The item type. 12 | public interface IPage : IEnumerable 13 | { 14 | /// 15 | /// Specifies if another page can be retrieved with additional items 16 | /// 17 | bool HasNextPage { get; } 18 | 19 | /// 20 | /// Retrieves the next page of items, if one is available. If is false, an empty page is returned. 21 | /// 22 | Task> GetNextPageAsync(CancellationToken cancellation = default(CancellationToken)); 23 | } 24 | } -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/LoadBalancers/Request/CreateAccessListRequest.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.LoadBalancers.Request 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using Newtonsoft.Json; 7 | 8 | /// 9 | /// 10 | [JsonObject(MemberSerialization.OptIn)] 11 | internal class CreateAccessListRequest 12 | { 13 | [JsonProperty("accessList")] 14 | private NetworkItem[] _accessList; 15 | 16 | public CreateAccessListRequest(IEnumerable accessList) 17 | { 18 | if (accessList == null) 19 | throw new ArgumentNullException("accessList"); 20 | 21 | _accessList = accessList.ToArray(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Request/RescueServerRequest.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Request 2 | { 3 | using Newtonsoft.Json; 4 | 5 | /// 6 | /// This models the JSON request used for the Rescue Server request. 7 | /// 8 | /// Rescue Server (Rackspace Next Generation Cloud Servers Developer Guide - API v2) 9 | /// 10 | [JsonObject(MemberSerialization.OptIn)] 11 | internal class RescueServerRequest 12 | { 13 | #pragma warning disable 414 // The field 'fieldName' is assigned but its value is never used 14 | [JsonProperty("rescue")] 15 | private string _command = "none"; 16 | #pragma warning restore 414 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/corelib/Core/AsyncCompletionOption.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core 2 | { 3 | using System.Threading.Tasks; 4 | 5 | /// 6 | /// Specifies when a representing an asynchronous server operation 7 | /// should be considered complete. 8 | /// 9 | /// 10 | public enum AsyncCompletionOption 11 | { 12 | /// 13 | /// The representing the operation is considered complete after the 14 | /// request has been submitted to the server. 15 | /// 16 | RequestSubmitted, 17 | 18 | /// 19 | /// The representing the operation is considered complete after the 20 | /// server has completed processing the request. 21 | /// 22 | RequestCompleted, 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Request/UnrescueServerRequest.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Request 2 | { 3 | using Newtonsoft.Json; 4 | 5 | /// 6 | /// This models the JSON request used for the Unrescue Server request. 7 | /// 8 | /// Unrescue Server (Rackspace Next Generation Cloud Servers Developer Guide - API v2) 9 | /// 10 | [JsonObject(MemberSerialization.OptIn)] 11 | internal class UnrescueServerRequest 12 | { 13 | #pragma warning disable 414 // The field 'fieldName' is assigned but its value is never used 14 | [JsonProperty("unrescue")] 15 | private string _command = "none"; 16 | #pragma warning restore 414 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/MetaDataResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the List Metadata request. 8 | /// 9 | /// List Metadata (OpenStack Compute API v2 and Extensions Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class MetaDataResponse 13 | { 14 | /// 15 | /// Gets the metadata information. 16 | /// 17 | [JsonProperty("metadata")] 18 | public Metadata Metadata { get; private set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/ListCloudNetworksResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the List Networks request. 8 | /// 9 | /// List Networks (OpenStack Networking API v2.0 Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class ListCloudNetworksResponse 13 | { 14 | /// 15 | /// Gets a collection of networks. 16 | /// 17 | [JsonProperty("networks")] 18 | public CloudNetwork[] Networks { get; private set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/CreateServerResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the Create Server request. 8 | /// 9 | /// Create Server (OpenStack Compute API v2 and Extensions Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class CreateServerResponse 13 | { 14 | /// 15 | /// Gets information about the created server. 16 | /// 17 | [JsonProperty("server")] 18 | public NewServer Server { get; private set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/UsersResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the List Users request. 8 | /// 9 | /// List Users (OpenStack Identity Service API v2.0 Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class UsersResponse 13 | { 14 | /// 15 | /// Gets a collection of information about the users. 16 | /// 17 | [JsonProperty("users")] 18 | public User[] Users { get; private set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Request/RevertServerResizeRequest.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Request 2 | { 3 | using Newtonsoft.Json; 4 | 5 | /// 6 | /// This models the JSON request used for the Revert Resized Server request. 7 | /// 8 | /// Revert Resized Server (OpenStack Compute API v2 and Extensions Reference) 9 | /// 10 | [JsonObject(MemberSerialization.OptIn)] 11 | internal class RevertServerResizeRequest 12 | { 13 | #pragma warning disable 414 // The field 'fieldName' is assigned but its value is never used 14 | [JsonProperty("revertResize")] 15 | private string _command = "none"; 16 | #pragma warning restore 414 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Request/ConfirmServerResizeRequest.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Request 2 | { 3 | using Newtonsoft.Json; 4 | 5 | /// 6 | /// This models the JSON request used for the Confirm Resized Server request. 7 | /// 8 | /// Confirm Resized Server (OpenStack Compute API v2 and Extensions Reference) 9 | /// 10 | [JsonObject(MemberSerialization.OptIn)] 11 | internal class ConfirmServerResizeRequest 12 | { 13 | #pragma warning disable 414 // The field 'fieldName' is assigned but its value is never used 14 | [JsonProperty("confirmResize")] 15 | private string _command = "none"; 16 | #pragma warning restore 414 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/ListAddressesResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the List Addresses request. 8 | /// 9 | /// List Addresses (OpenStack Compute API v2 and Extensions Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class ListAddressesResponse 13 | { 14 | /// 15 | /// Gets the IP address details. 16 | /// 17 | [JsonProperty("addresses")] 18 | public ServerAddresses Addresses { get; private set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/ListImagesResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the List Images request. 8 | /// 9 | /// List Images (OpenStack Compute API v2 and Extensions Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class ListImagesResponse 13 | { 14 | /// 15 | /// Gets a collection of basic information about the images. 16 | /// 17 | [JsonProperty("images")] 18 | public SimpleServerImage[] Images { get; private set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/GetImageDetailsResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the Get Image Details request. 8 | /// 9 | /// Get Image Details (OpenStack Compute API v2 and Extensions Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class GetImageDetailsResponse 13 | { 14 | /// 15 | /// Gets detailed information about the image. 16 | /// 17 | [JsonProperty("image")] 18 | public ServerImage Image { get; private set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/ListFlavorsResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the List Flavors request. 8 | /// 9 | /// List Flavors (OpenStack Compute API v2 and Extensions Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class ListFlavorsResponse 13 | { 14 | /// 15 | /// Gets a collection of basic information about the available flavors. 16 | /// 17 | [JsonProperty("flavors")] 18 | public Flavor[] Flavors { get; private set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/FlavorDetailsResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the Get Flavor Details request. 8 | /// 9 | /// Get Flavor Details (OpenStack Compute API v2 and Extensions Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class FlavorDetailsResponse 13 | { 14 | /// 15 | /// Gets detailed information about the flavor. 16 | /// 17 | [JsonProperty("flavor")] 18 | public FlavorDetails Flavor { get; private set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/ListVolumeResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the List Volume Summaries request. 8 | /// 9 | /// List Volume Summaries (OpenStack Block Storage Service API Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class ListVolumeResponse 13 | { 14 | /// 15 | /// Gets a collection of information about the volumes. 16 | /// 17 | [JsonProperty("volumes")] 18 | public Volume[] Volumes { get; private set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/TenantsResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the List Tenants request. 8 | /// 9 | /// List Tenants (OpenStack Identity Service API v2.0 Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class TenantsResponse 13 | { 14 | /// 15 | /// Gets a collection of information about the tenants. 16 | /// 17 | [JsonProperty("tenants")] 18 | public Tenant[] Tenants { get; private set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/ListSnapshotResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the List Snapshot Summaries request. 8 | /// 9 | /// List Snapshot Summaries (OpenStack Block Storage Service API Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class ListSnapshotResponse 13 | { 14 | /// 15 | /// Gets a collection of information about the snapshots. 16 | /// 17 | [JsonProperty("snapshots")] 18 | public Snapshot[] Snapshots { get; private set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Databases/DatabaseUser.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Databases 2 | { 3 | using Newtonsoft.Json; 4 | 5 | /// 6 | /// This class models the JSON representation of a database user in the . 7 | /// 8 | /// 9 | /// 10 | /// 11 | /// 12 | [JsonObject(MemberSerialization.OptIn)] 13 | public class DatabaseUser : UserConfiguration 14 | { 15 | /// 16 | /// Initializes a new instance of the class 17 | /// during JSON deserialization. 18 | /// 19 | [JsonConstructor] 20 | protected DatabaseUser() 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/ListImagesDetailsResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the List Images with Details request. 8 | /// 9 | /// List Images (OpenStack Compute API v2 and Extensions Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class ListImagesDetailsResponse 13 | { 14 | /// 15 | /// Gets a collection of detailed information about the images. 16 | /// 17 | [JsonProperty("images")] 18 | public ServerImage[] Images { get; private set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/ListVolumeTypeResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the List Volume Types request. 8 | /// 9 | /// List Volume Types (OpenStack Block Storage Service API Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class ListVolumeTypeResponse 13 | { 14 | /// 15 | /// Gets a collection of information about the volume types. 16 | /// 17 | [JsonProperty("volume_types")] 18 | public VolumeType[] VolumeTypes { get; private set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/ListFlavorDetailsResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the List Flavors with Details request. 8 | /// 9 | /// List Flavors (OpenStack Compute API v2 and Extensions Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class ListFlavorDetailsResponse 13 | { 14 | /// 15 | /// Gets a collection of detailed information about the flavors. 16 | /// 17 | [JsonProperty("flavors")] 18 | public FlavorDetails[] Flavors { get; private set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/RescueServerResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using Newtonsoft.Json; 4 | 5 | /// 6 | /// This models the JSON response used for the Rescue Server request. 7 | /// 8 | /// Rescue Server (Rackspace Next Generation Cloud Servers Developer Guide - API v2) 9 | /// 10 | [JsonObject(MemberSerialization.OptIn)] 11 | internal class RescueServerResponse 12 | { 13 | /// 14 | /// Gets the temporary administrator password assigned for use while the server 15 | /// is in rescue mode. 16 | /// 17 | [JsonProperty("adminPass")] 18 | public string AdminPassword { get; private set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/GetCloudBlockStorageVolumeTypeResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the Show Volume Type request. 8 | /// 9 | /// Show Volume Type (OpenStack Block Storage Service API Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class GetCloudBlockStorageVolumeTypeResponse 13 | { 14 | /// 15 | /// Gets additional information about the volume type. 16 | /// 17 | [JsonProperty("volume_type")] 18 | public VolumeType VolumeType { get; private set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/IProviderFactory`2.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace 2 | { 3 | using System; 4 | 5 | /// 6 | /// Represents a factory for obtaining service providers for particular keys. 7 | /// 8 | /// The provider type. 9 | /// The key type. 10 | internal interface IProviderFactory 11 | { 12 | /// 13 | /// Get a provider for the specified . 14 | /// 15 | /// The key. If this value is , a default provider will be returned if available. 16 | /// The provider. 17 | /// If is , and the factory does not support a default provider. 18 | T Get(T2 key); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/corelib/Core/Validators/INetworksValidator.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Validators 2 | { 3 | using System; 4 | using net.openstack.Core.Exceptions; 5 | using net.openstack.Core.Providers; 6 | 7 | /// 8 | /// Represents an object that validates arguments for an implementation of 9 | /// prior to sending the calls to the underlying REST API. 10 | /// 11 | public interface INetworksValidator 12 | { 13 | /// 14 | /// Validates an IP address range (CIDR) formatted as a string. 15 | /// 16 | /// The IP address range. 17 | /// If is . 18 | /// If is not in the correct format. 19 | void ValidateCidr(string cidr); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/AuthenticationResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the Authenticate request. 8 | /// 9 | /// Authenticate (OpenStack Identity Service API v2.0 Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class AuthenticationResponse 13 | { 14 | /// 15 | /// Gets additional information about the authenticated user. 16 | /// 17 | /// 18 | [JsonProperty("access")] 19 | public UserAccess UserAccess { get; private set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/corelib/Authentication/AuthenticatedHttpClientFactory.cs: -------------------------------------------------------------------------------- 1 | using System.Net.Http; 2 | using Flurl; 3 | using Flurl.Http; 4 | using Flurl.Http.Configuration; 5 | 6 | namespace OpenStack.Authentication 7 | { 8 | /// 9 | /// Instructs Flurl to use an for all requests. 10 | /// 11 | /// 12 | public class AuthenticatedHttpClientFactory : DefaultHttpClientFactory 13 | { 14 | /// 15 | public override HttpClient CreateClient(Url url, HttpMessageHandler handler) 16 | { 17 | return new HttpClient(handler) 18 | { 19 | Timeout = FlurlHttp.Configuration.DefaultTimeout 20 | }; 21 | } 22 | 23 | /// 24 | public override HttpMessageHandler CreateMessageHandler() 25 | { 26 | return new AuthenticatedMessageHandler(base.CreateMessageHandler()); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /src/corelib/Core/IBackoffPolicy.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | 6 | /// 7 | /// Represents a back-off policy. 8 | /// 9 | /// 10 | public interface IBackoffPolicy 11 | { 12 | /// 13 | /// Gets an enumeration of instances representing the 14 | /// back-off policy intervals. 15 | /// 16 | /// 17 | /// 18 | /// This enumeration should always be lazily enumerated since implementations may 19 | /// not bound the number of elements returned. 20 | /// 21 | /// 22 | /// 23 | /// An enumeration of instances representing the back-off 24 | /// policy intervals. 25 | /// 26 | IEnumerable GetBackoffIntervals(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/RackspaceImpersonationIdentity.cs: -------------------------------------------------------------------------------- 1 | using net.openstack.Providers.Rackspace.Objects; 2 | 3 | namespace net.openstack.Providers.Rackspace 4 | { 5 | /// 6 | /// Represents a cloud identity that impersonates another . 7 | /// 8 | /// 9 | public class RackspaceImpersonationIdentity : RackspaceCloudIdentity 10 | { 11 | /// 12 | /// Gets or sets the of the user to impersonate. 13 | /// 14 | /// 15 | /// The class represents credentials 16 | /// (as opposed to an account), so any changes made to this property value will 17 | /// not be reflected in the account. 18 | /// 19 | public RackspaceCloudIdentity UserToImpersonate { get; set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/testing/unit/ContentDeliveryNetworks/v1/ServiceOperationFailedExceptionTests.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Linq; 3 | using System.Runtime.Serialization.Formatters.Binary; 4 | using Xunit; 5 | 6 | namespace OpenStack.ContentDeliveryNetworks.v1 7 | { 8 | public class ServiceOperationFailedExceptionTests 9 | { 10 | [Fact] 11 | public void SerializeCustomProperties() 12 | { 13 | var errors = new[] {new ServiceError{Message = "oops!"}}; 14 | var ex = new ServiceOperationFailedException(errors); 15 | 16 | var formatter = new BinaryFormatter(); 17 | using (var ms = new MemoryStream()) 18 | { 19 | formatter.Serialize(ms, ex); 20 | ms.Seek(0, 0); 21 | ex = (ServiceOperationFailedException)formatter.Deserialize(ms); 22 | } 23 | 24 | Assert.NotEmpty(ex.Errors); 25 | Assert.Equal("oops!", ex.Errors.First().Message); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Queues/Request/ClaimMessagesRequest.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Queues.Request 2 | { 3 | using System; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// 8 | [JsonObject(MemberSerialization.OptIn)] 9 | internal class ClaimMessagesRequest 10 | { 11 | [JsonProperty("ttl")] 12 | private long _ttl; 13 | 14 | [JsonProperty("grace")] 15 | private long _gracePeriod; 16 | 17 | public ClaimMessagesRequest(TimeSpan timeToLive, TimeSpan gracePeriod) 18 | { 19 | if (timeToLive < TimeSpan.Zero) 20 | throw new ArgumentOutOfRangeException("timeToLive"); 21 | if (gracePeriod < TimeSpan.Zero) 22 | throw new ArgumentOutOfRangeException("gracePeriod"); 23 | 24 | _ttl = (long)timeToLive.TotalSeconds; 25 | _gracePeriod = (long)gracePeriod.TotalSeconds; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/corelib/ContentDeliveryNetworks/v1/ServiceCollection.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using net.openstack.Core.Domain; 3 | using Newtonsoft.Json; 4 | using OpenStack.Serialization; 5 | 6 | namespace OpenStack.ContentDeliveryNetworks.v1 7 | { 8 | /// 9 | /// Represents a collection of service resources of the . 10 | /// 11 | /// 12 | public class ServiceCollection : Page 13 | { 14 | /// 15 | /// The requested services. 16 | /// 17 | [JsonProperty("services")] 18 | public IList Services 19 | { 20 | get { return Items; } 21 | } 22 | 23 | /// 24 | /// The paging navigation links. 25 | /// 26 | [JsonProperty("links")] 27 | public IList ServiceLinks 28 | { 29 | get { return Links; } 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/NewUserResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the Add User request. 8 | /// 9 | /// Add User (OpenStack Identity Service API v2.0 Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class NewUserResponse 13 | { 14 | /// 15 | /// Gets the information about the newly created user, including the generated 16 | /// if no password was specified in the request. 17 | /// 18 | [JsonProperty("user")] 19 | public NewUser NewUser { get; private set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/corelib/Extensions/TypeExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using System.Reflection; 3 | 4 | namespace System.Extensions 5 | { 6 | /// 7 | /// Useful System.Type extension methods for custom implementations. 8 | /// 9 | /// 10 | public static class TypeExtensions 11 | { 12 | /// 13 | /// Gets the AssemblyFileVersion for the specified type. 14 | /// 15 | /// The type which resides in the desired assembly. 16 | public static string GetAssemblyFileVersion(this Type type) 17 | { 18 | Assembly assembly = type.Assembly; 19 | try 20 | { 21 | var fileVersionInfo = FileVersionInfo.GetVersionInfo(assembly.Location); 22 | return fileVersionInfo.FileVersion; 23 | } 24 | catch 25 | { 26 | return assembly.GetName().Version.ToString(); 27 | } 28 | } 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/ServerVolumeListResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using System.Collections.Generic; 4 | using net.openstack.Core.Domain; 5 | using Newtonsoft.Json; 6 | 7 | /// 8 | /// This models the JSON response used for the List Volume Attachments request. 9 | /// 10 | /// List Volume Attachments (Rackspace Next Generation Cloud Servers Developer Guide - API v2) 11 | /// 12 | [JsonObject(MemberSerialization.OptIn)] 13 | internal class ServerVolumeListResponse 14 | { 15 | /// 16 | /// Gets a collection of information about the volume attachments. 17 | /// 18 | [JsonProperty("volumeAttachments")] 19 | public IEnumerable ServerVolumes { get; private set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/MetadataItemResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the Get Metadata Item request. 8 | /// 9 | /// Get Metadata Item (OpenStack Compute API v2 and Extensions Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class MetadataItemResponse 13 | { 14 | /// 15 | /// Gets information about the metadata item. The returned object 16 | /// will only have one item, containing the key and value for the metadata item. 17 | /// 18 | [JsonProperty("meta")] 19 | public Metadata Metadata { get; private set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/corelib/ContentDeliveryNetworks/v1/FlavorCollection.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using OpenStack.Serialization; 3 | 4 | namespace OpenStack.ContentDeliveryNetworks.v1 5 | { 6 | /// 7 | /// Represents a collection of flavor resources of the . 8 | /// 9 | /// 10 | [JsonConverterWithConstructor(typeof(RootWrapperConverter), "flavors")] 11 | public class FlavorCollection : List 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | public FlavorCollection() 17 | { 18 | } 19 | 20 | /// 21 | /// Initializes a new instance of the class. 22 | /// 23 | /// The flavors. 24 | public FlavorCollection(IEnumerable flavors) : base(flavors) 25 | { 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/testing/integration/ContentDeliveryNetworks/v1/ContentDeliveryNetworkServiceTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using OpenStack.Synchronous; 3 | using Xunit; 4 | using Xunit.Abstractions; 5 | 6 | namespace OpenStack.ContentDeliveryNetworks.v1 7 | { 8 | [Trait("ci","false")] 9 | public class ContentDeliveryNetworkServiceTests : IDisposable 10 | { 11 | private readonly ContentDeliveryNetworkService _cdnService; 12 | 13 | public ContentDeliveryNetworkServiceTests(ITestOutputHelper testLog) 14 | { 15 | OpenStackNet.Tracing.Http.Listeners.Add(new XunitTraceListener(testLog)); 16 | 17 | var authenticationProvider = TestIdentityProvider.GetIdentityProvider(); 18 | _cdnService = new ContentDeliveryNetworkService(authenticationProvider, "DFW"); 19 | } 20 | 21 | public void Dispose() 22 | { 23 | OpenStackNet.Tracing.Http.Listeners.Clear(); 24 | } 25 | 26 | [Fact] 27 | public void Ping() 28 | { 29 | _cdnService.Ping(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/testing/unit/ContentDeliveryNetworks/v1/ServiceCacheTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | using Newtonsoft.Json.Linq; 4 | using Xunit; 5 | 6 | namespace OpenStack.ContentDeliveryNetworks.v1 7 | { 8 | public class ServiceCacheTests 9 | { 10 | [Fact] 11 | public void SerializeTimeToLiveToSeconds() 12 | { 13 | var cache = new ServiceCache("cache", TimeSpan.FromSeconds(60)); 14 | 15 | var json = JsonConvert.SerializeObject(cache); 16 | 17 | var result = JObject.Parse(json); 18 | Assert.Equal(60, result.Value("ttl")); 19 | } 20 | 21 | [Fact] 22 | public void DeserializeTimeToLiveFromSeconds() 23 | { 24 | var cache = new ServiceCache("cache", TimeSpan.FromSeconds(60)); 25 | var json = JsonConvert.SerializeObject(cache); 26 | 27 | var result = JsonConvert.DeserializeObject(json); 28 | 29 | Assert.Equal(60, result.TimeToLive.TotalSeconds); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/BulkDeleteResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using Newtonsoft.Json; 6 | 7 | [JsonObject(MemberSerialization.OptIn)] 8 | internal class BulkDeleteResponse 9 | { 10 | [JsonProperty("Number Not Found")] 11 | public int NumberNotFound { get; set; } 12 | 13 | [JsonProperty("Response Status")] 14 | public string Status { get; set; } 15 | 16 | [JsonProperty("Errors")] 17 | public IEnumerable> Errors { get; set; } 18 | 19 | [JsonProperty("Number Deleted")] 20 | public int NumberDeleted { get; set; } 21 | 22 | [JsonProperty("Response Body")] 23 | public string ResponseBody { get; set; } 24 | 25 | public IEnumerable AllItems { get; set; } 26 | 27 | public bool IsItemError(string s) 28 | { 29 | return Errors.Any(e => e.Any(e2 => e2.Equals(s))); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/CloudNetworkResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the Create Network and Show Network requests. 8 | /// 9 | /// Create Network (OpenStack Networking API v2.0 Reference) 10 | /// Show Network (OpenStack Networking API v2.0 Reference) 11 | /// 12 | [JsonObject(MemberSerialization.OptIn)] 13 | internal class CloudNetworkResponse 14 | { 15 | /// 16 | /// Gets additional information about the network. 17 | /// 18 | [JsonProperty("network")] 19 | public CloudNetwork Network { get; private set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/corelib/Core/Domain/Tenant.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Domain 2 | { 3 | using net.openstack.Core.Providers; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the basic JSON description of a tenant. 8 | /// 9 | /// 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | public class Tenant : ExtensibleJsonObject 13 | { 14 | /// 15 | /// Gets the unique identifier for the tenant. 16 | /// The value of this property is not defined. Do not use. 17 | /// 18 | [JsonProperty("id")] 19 | public string Id { get; private set; } 20 | 21 | /// 22 | /// Gets the "name" property for the tenant. 23 | /// The value of this property is not defined. Do not use. 24 | /// 25 | [JsonProperty("name")] 26 | public string Name { get; private set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/corelib/Core/Validators/IBlockStorageValidator.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Validators 2 | { 3 | using System; 4 | using net.openstack.Core.Providers; 5 | using net.openstack.Providers.Rackspace.Exceptions; 6 | 7 | /// 8 | /// Represents an object that validates arguments for an implementation of 9 | /// prior to sending the calls to the underlying REST API. 10 | /// 11 | public interface IBlockStorageValidator 12 | { 13 | /// 14 | /// Validates the size parameter when creating a new block storage volume 15 | /// with . 16 | /// 17 | /// The volume size in GB. 18 | /// If is less than 0. 19 | /// If is not a valid volume size. 20 | void ValidateVolumeSize(int size); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/LoadBalancers/Response/GetLoadBalancerNodeResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.LoadBalancers.Response 2 | { 3 | using Newtonsoft.Json; 4 | 5 | /// 6 | /// 7 | [JsonObject(MemberSerialization.OptIn)] 8 | internal class GetLoadBalancerNodeResponse 9 | { 10 | #pragma warning disable 649 // Field 'fieldName' is never assigned to, and will always have its default value 11 | [JsonProperty("node")] 12 | private Node _node; 13 | #pragma warning restore 649 14 | 15 | /// 16 | /// Initializes a new instance of the class 17 | /// during JSON deserialization. 18 | /// 19 | [JsonConstructor] 20 | protected GetLoadBalancerNodeResponse() 21 | { 22 | } 23 | 24 | public Node Node 25 | { 26 | get 27 | { 28 | return _node; 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/UserCredentialResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the Update User Credentials request 8 | /// when used with API Key credentials. 9 | /// 10 | /// Update User Credentials (OpenStack Identity Service API v2.0 Reference) 11 | /// 12 | [JsonObject(MemberSerialization.OptIn)] 13 | internal class UserCredentialResponse 14 | { 15 | /// 16 | /// Gets the API key credentials sent with the Update User Credentials request. 17 | /// 18 | [JsonProperty("RAX-KSKEY:apiKeyCredentials")] 19 | public UserCredential UserCredential { get; private set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/corelib/ContentDeliveryNetworks/v1/Flavor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | namespace OpenStack.ContentDeliveryNetworks.v1 7 | { 8 | /// 9 | /// Represents a flavor resource of the 10 | /// 11 | /// 12 | public class Flavor 13 | { 14 | /// 15 | /// The unique identifier for the flavor. 16 | /// 17 | [JsonProperty("id")] 18 | public string Id { get; set; } 19 | 20 | /// 21 | /// Collection of links related to the current flavor. 22 | /// 23 | [JsonProperty("links")] 24 | public IEnumerable Links { get; set; } 25 | 26 | /// 27 | /// Collection of available providers for the current flavor. 28 | /// 29 | [JsonProperty("providers")] 30 | public IEnumerable Providers { get; set; } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/GetCloudBlockStorageVolumeResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the Create Volume and Show Volume requests. 8 | /// 9 | /// Create Volume (OpenStack Block Storage Service API Reference) 10 | /// Show Volume (OpenStack Block Storage Service API Reference) 11 | /// 12 | [JsonObject(MemberSerialization.OptIn)] 13 | internal class GetCloudBlockStorageVolumeResponse 14 | { 15 | /// 16 | /// Gets additional information about the volume. 17 | /// 18 | [JsonProperty("volume")] 19 | public Volume Volume { get; private set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/LoadBalancers/Response/GetLoadBalancerResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.LoadBalancers.Response 2 | { 3 | using Newtonsoft.Json; 4 | 5 | /// 6 | /// 7 | [JsonObject(MemberSerialization.OptIn)] 8 | internal class GetLoadBalancerResponse 9 | { 10 | #pragma warning disable 649 // Field 'fieldName' is never assigned to, and will always have its default value 11 | [JsonProperty("loadBalancer")] 12 | private LoadBalancer _loadBalancer; 13 | #pragma warning restore 649 14 | 15 | /// 16 | /// Initializes a new instance of the class 17 | /// during JSON deserialization. 18 | /// 19 | [JsonConstructor] 20 | protected GetLoadBalancerResponse() 21 | { 22 | } 23 | 24 | public LoadBalancer LoadBalancer 25 | { 26 | get 27 | { 28 | return _loadBalancer; 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/GetCloudBlockStorageSnapshotResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the Create Snapshot and Show Snapshot requests. 8 | /// 9 | /// Create Snapshot (OpenStack Block Storage Service API Reference) 10 | /// Show Snapshot (OpenStack Block Storage Service API Reference) 11 | /// 12 | [JsonObject(MemberSerialization.OptIn)] 13 | internal class GetCloudBlockStorageSnapshotResponse 14 | { 15 | /// 16 | /// Gets information about the snapshot. 17 | /// 18 | [JsonProperty("snapshot")] 19 | public Snapshot Snapshot { get; private set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/testing/unit/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/PasswordCredentialResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Providers.Rackspace.Objects.Request; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the Update User Credentials request 8 | /// when used with password credentials. 9 | /// 10 | /// Update User Credentials (OpenStack Identity Service API v2.0 Reference) 11 | /// 12 | [JsonObject(MemberSerialization.OptIn)] 13 | internal class PasswordCredentialResponse 14 | { 15 | /// 16 | /// Gets the password credentials used for the Update User Credentials request. 17 | /// 18 | [JsonProperty("passwordCredentials")] 19 | public PasswordCredential PasswordCredential { get; private set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/testing/integration/XunitTraceListener.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using Xunit.Abstractions; 4 | 5 | namespace OpenStack 6 | { 7 | public class XunitTraceListener : TraceListener 8 | { 9 | private readonly ITestOutputHelper _testLog; 10 | 11 | public XunitTraceListener(ITestOutputHelper testLog) 12 | { 13 | _testLog = testLog; 14 | } 15 | 16 | public override void Write(string message) 17 | { 18 | if (message.StartsWith(OpenStackNet.Tracing.Http.Name)) 19 | return; 20 | 21 | TryLog(message); 22 | } 23 | 24 | public override void WriteLine(string message) 25 | { 26 | TryLog(message); 27 | } 28 | 29 | private void TryLog(string message) 30 | { 31 | try 32 | { 33 | _testLog.WriteLine(message); 34 | } 35 | catch (InvalidOperationException) 36 | { 37 | // Unable to log to xunit because it thinks no test is active... 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #Build Output 2 | /artifacts 3 | 4 | #OS junk files 5 | [Tt]humbs.db 6 | *.DS_Store 7 | 8 | #Visual Studio files 9 | *.[Oo]bj 10 | *.user 11 | *.aps 12 | *.pch 13 | *.vspscc 14 | *.vssscc 15 | *_i.c 16 | *_p.c 17 | *.ncb 18 | *.suo 19 | *.tlb 20 | *.tlh 21 | *.bak 22 | *.[Cc]ache 23 | *.ilk 24 | *.log 25 | *.lib 26 | *.sbr 27 | *.sdf 28 | *.opensdf 29 | *.unsuccessfulbuild 30 | ipch/ 31 | obj/ 32 | [Bb]in 33 | [Oo]bj 34 | [Dd]ebug*/ 35 | [Rr]elease*/ 36 | Ankh.NoLoad 37 | *.DotSettings 38 | 39 | # Roslyn IntelliSense Cache 40 | *.sln.ide/ 41 | 42 | # Visual Studio Profiling Output 43 | *.psess 44 | *.vsp 45 | *.vspx 46 | *.krn.ctl 47 | *.app.ctl 48 | 49 | #Tooling 50 | _ReSharper*/ 51 | *.resharper 52 | [Tt]est[Rr]esult* 53 | 54 | #Subversion files 55 | .svn/ 56 | 57 | # Office Temp Files 58 | ~$* 59 | 60 | #Git 61 | *.orig 62 | 63 | #SQL Source Control 64 | CommandLineHooks.xml 65 | 66 | #MSTest Test Results 67 | TestResults 68 | 69 | # Sandcastle Per-User File 70 | .shfb/ 71 | *.shfbproj_* 72 | 73 | # Sandcastle Output 74 | docs/Api/ 75 | docs/html/ 76 | /src/Documentation/Help/ 77 | 78 | #NuGet 79 | *.nupkg 80 | /src/packages/ 81 | -------------------------------------------------------------------------------- /src/corelib/Serialization/TimeSpanInSecondsConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace OpenStack.Serialization 5 | { 6 | /// 7 | /// Converts a json number representing seconds to a . 8 | /// 9 | /// 10 | public class TimeSpanInSecondsConverter : JsonConverter 11 | { 12 | /// 13 | public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) 14 | { 15 | var timeSpan = (TimeSpan) value; 16 | writer.WriteValue(timeSpan.TotalSeconds); 17 | } 18 | 19 | /// 20 | public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) 21 | { 22 | double seconds = double.Parse(reader.Value.ToString()); 23 | return TimeSpan.FromSeconds(seconds); 24 | } 25 | 26 | /// 27 | public override bool CanConvert(Type objectType) 28 | { 29 | return objectType == typeof (TimeSpan); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /src/corelib/Core/Validators/IHttpResponseCodeValidator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using JSIStudios.SimpleRESTServices.Client; 3 | using net.openstack.Core.Exceptions.Response; 4 | 5 | namespace net.openstack.Core.Validators 6 | { 7 | /// 8 | /// Represents an object that can determine whether a particular response from a 9 | /// REST API call succeeded. 10 | /// 11 | public interface IHttpResponseCodeValidator 12 | { 13 | /// 14 | /// Verifies that represents a successful response 15 | /// for a REST API call, throwing an appropriate 16 | /// if indicates a failure. 17 | /// 18 | /// The response from the REST call. 19 | /// If is . 20 | /// If indicates the REST API call failed. 21 | void Validate(Response response); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/RoleResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the Add Role and Get Role by Name requests. 8 | /// 9 | /// Add Role (OpenStack Identity Service API v2.0 Reference) 10 | /// Get Role by Name (OpenStack Identity Service API v2.0 Reference) 11 | /// 12 | [JsonObject(MemberSerialization.OptIn)] 13 | internal class RoleResponse 14 | { 15 | /// 16 | /// Gets information about the role. 17 | /// 18 | [JsonProperty("role")] 19 | public Role Role { get; private set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Monitoring/CpuCheckDetails.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Monitoring 2 | { 3 | using Newtonsoft.Json; 4 | 5 | /// 6 | /// This class represents the detailed configuration parameters for a 7 | /// check. 8 | /// 9 | /// 10 | /// 11 | /// 12 | [JsonObject(MemberSerialization.OptIn)] 13 | public class CpuCheckDetails : CheckDetails 14 | { 15 | /// 16 | /// Initializes a new instance of the class. 17 | /// 18 | public CpuCheckDetails() 19 | { 20 | } 21 | 22 | /// 23 | /// 24 | /// This class only supports checks. 25 | /// 26 | protected internal override bool SupportsCheckType(CheckTypeId checkTypeId) 27 | { 28 | return checkTypeId == CheckTypeId.AgentCpu; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/testing/integration/Identity/v2/IdentityTests.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics; 2 | using net.openstack.Core.Providers; 3 | using Xunit; 4 | using Xunit.Abstractions; 5 | 6 | namespace OpenStack.Identity.v2 7 | { 8 | public class IdentityTests 9 | { 10 | private readonly OpenStackIdentityProvider _identityService; 11 | 12 | public IdentityTests(ITestOutputHelper testLog) 13 | { 14 | var testOutput = new XunitTraceListener(testLog); 15 | Trace.Listeners.Add(testOutput); 16 | OpenStackNet.Tracing.Http.Listeners.Add(testOutput); 17 | 18 | _identityService = (OpenStackIdentityProvider) TestIdentityProvider.GetIdentityProvider(); 19 | } 20 | 21 | [Fact] 22 | public void AuthenticateTest() 23 | { 24 | var userAccess = _identityService.Authenticate(); 25 | Assert.NotNull(userAccess); 26 | Assert.NotNull(userAccess.Token); 27 | Assert.NotNull(userAccess.Token.Id); 28 | Assert.NotNull(userAccess.ServiceCatalog); 29 | Assert.NotEmpty(userAccess.ServiceCatalog); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/corelib/Networking/v2/Serialization/PortCollection.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using OpenStack.Serialization; 3 | 4 | namespace OpenStack.Networking.v2.Serialization 5 | { 6 | /// 7 | /// Represents a collection of port resources returned by the . 8 | /// Intended for custom implementations and stubbing responses in unit tests. 9 | /// 10 | /// 11 | /// 12 | [JsonConverterWithConstructor(typeof(RootWrapperConverter), "ports")] 13 | public class PortCollection : List 14 | { 15 | /// 16 | /// Initializes a new instance of the class. 17 | /// 18 | public PortCollection() 19 | { 20 | } 21 | 22 | /// 23 | /// Initializes a new instance of the class. 24 | /// 25 | /// The networks. 26 | public PortCollection(IEnumerable ports) : base(ports) 27 | { 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/ListServersResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the List Servers and List Servers with Details requests. 8 | /// 9 | /// List Servers (OpenStack Compute API v2 and Extensions Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class ListServersResponse 13 | { 14 | /// 15 | /// Gets a collection of information about the servers. 16 | /// 17 | [JsonProperty("servers")] 18 | public Server[] Servers { get; private set; } 19 | 20 | /// 21 | /// Gets a collection of links related to the collection of servers. 22 | /// 23 | [JsonProperty("servers_links")] 24 | public Link[] Links { get; private set; } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Monitoring/MemoryCheckDetails.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Monitoring 2 | { 3 | using Newtonsoft.Json; 4 | 5 | /// 6 | /// This class represents the detailed configuration parameters for a 7 | /// check. 8 | /// 9 | /// 10 | /// 11 | /// 12 | [JsonObject(MemberSerialization.OptIn)] 13 | public class MemoryCheckDetails : CheckDetails 14 | { 15 | /// 16 | /// Initializes a new instance of the class. 17 | /// 18 | public MemoryCheckDetails() 19 | { 20 | } 21 | 22 | /// 23 | /// 24 | /// This class only supports checks. 25 | /// 26 | protected internal override bool SupportsCheckType(CheckTypeId checkTypeId) 27 | { 28 | return checkTypeId == CheckTypeId.AgentMemory; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/corelib/Networking/v2/Serialization/SubnetCollection.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using OpenStack.Serialization; 3 | 4 | namespace OpenStack.Networking.v2.Serialization 5 | { 6 | /// 7 | /// Represents a collection of subnet resources returned by the . 8 | /// Intended for custom implementations and stubbing responses in unit tests. 9 | /// 10 | /// 11 | /// 12 | [JsonConverterWithConstructor(typeof(RootWrapperConverter), "subnets")] 13 | public class SubnetCollection : List 14 | { 15 | /// 16 | /// Initializes a new instance of the class. 17 | /// 18 | public SubnetCollection() 19 | { 20 | } 21 | 22 | /// 23 | /// Initializes a new instance of the class. 24 | /// 25 | /// The networks. 26 | public SubnetCollection(IEnumerable subnets) : base(subnets) 27 | { 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /src/corelib/Core/Domain/VolumeType.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Domain 2 | { 3 | using net.openstack.Core.Providers; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// Represents the type of a volume in the Block Storage service. 8 | /// 9 | /// 10 | /// 11 | /// 12 | [JsonObject(MemberSerialization.OptIn)] 13 | public class VolumeType : ExtensibleJsonObject 14 | { 15 | /// 16 | /// Gets the unique identifier for this volume type. 17 | /// The value of this property is not defined. Do not use. 18 | /// 19 | [JsonProperty("id")] 20 | public string Id { get; private set; } 21 | 22 | /// 23 | /// Gets the name of the volume type. 24 | /// The value of this property is not defined. Do not use. 25 | /// 26 | [JsonProperty("name")] 27 | public string Name { get; private set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/corelib/ContentDeliveryNetworks/v1/ServiceDomain.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace OpenStack.ContentDeliveryNetworks.v1 4 | { 5 | /// 6 | /// Represents a service domain resource of the . 7 | /// 8 | /// 9 | public class ServiceDomain 10 | { 11 | /// 12 | /// Initializes a new instance of the class. 13 | /// 14 | /// The domain name. 15 | public ServiceDomain(string domain) 16 | { 17 | Domain = domain; 18 | } 19 | 20 | /// 21 | /// The domain used to access the assets on their website, which will have a CNAME entry pointed back to the CDN provider. 22 | /// 23 | [JsonProperty("domain")] 24 | public string Domain { get; set; } 25 | 26 | /// 27 | /// The protocol used to access the assets on this domain. 28 | /// 29 | [JsonProperty("protocol")] 30 | public ServiceProtocol? Protocol { get; set; } 31 | } 32 | } -------------------------------------------------------------------------------- /src/corelib/Core/Domain/Mapping/IJsonObjectMapper`1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json.Linq; 3 | 4 | namespace net.openstack.Core.Domain.Mapping 5 | { 6 | /// 7 | /// Represents an object that can convert between generic instances 8 | /// and instances of another specific type. 9 | /// 10 | /// The type which can be converted to and from . 11 | public interface IJsonObjectMapper : IObjectMapper 12 | { 13 | /// 14 | /// Converts a JSON string representation of to an instance 15 | /// of . 16 | /// 17 | /// The JSON string representation. 18 | /// An instance of represented by . 19 | /// If is . 20 | /// If the conversion cannot be performed. 21 | T Map(string rawJson); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/corelib/Networking/v2/Serialization/NetworkCollection.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using OpenStack.Serialization; 3 | 4 | namespace OpenStack.Networking.v2.Serialization 5 | { 6 | /// 7 | /// Represents a collection of network resources returned by the . 8 | /// Intended for custom implementations and stubbing responses in unit tests. 9 | /// 10 | /// 11 | /// 12 | [JsonConverterWithConstructor(typeof(RootWrapperConverter), "networks")] 13 | public class NetworkCollection : List 14 | { 15 | /// 16 | /// Initializes a new instance of the class. 17 | /// 18 | public NetworkCollection() 19 | { 20 | } 21 | 22 | /// 23 | /// Initializes a new instance of the class. 24 | /// 25 | /// The networks. 26 | public NetworkCollection(IEnumerable networks) : base(networks) 27 | { 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/testing/integration/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/corelib/Core/ParallelExtensionsExtras/TaskFactoryExtensions_From.cs: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // File: TaskFactoryExtensions_From.cs 6 | // 7 | //-------------------------------------------------------------------------- 8 | 9 | namespace System.Threading.Tasks 10 | { 11 | partial class TaskFactoryExtensions 12 | { 13 | #region TaskFactory 14 | /// Creates a Task that has completed in the Canceled state with the specified CancellationToken. 15 | /// The target TaskFactory. 16 | /// The CancellationToken with which the Task should complete. 17 | /// The completed Task. 18 | public static Task FromCancellation(this TaskFactory factory, CancellationToken cancellationToken) 19 | { 20 | if (!cancellationToken.IsCancellationRequested) throw new ArgumentOutOfRangeException("cancellationToken"); 21 | return new Task(() => { }, cancellationToken); 22 | } 23 | #endregion 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/corelib/Networking/v2/Subnet.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using OpenStack.Serialization; 3 | 4 | namespace OpenStack.Networking.v2 5 | { 6 | /// 7 | /// Represents a subnet resource of the . 8 | /// 9 | /// IPv4 or IPv6 address blocks from which IPs to be assigned to VMs on a given network are selected. 10 | /// 11 | /// 12 | /// 13 | [JsonConverterWithConstructor(typeof(RootWrapperConverter), "subnet")] 14 | public class Subnet : SubnetCreateDefinition 15 | { 16 | /// 17 | /// The ID of the subnet. 18 | /// 19 | [JsonProperty("id")] 20 | public Identifier Id { get; set; } 21 | 22 | /// 23 | /// The ID of the tenant who owns the network. 24 | /// 25 | [JsonProperty("tenant_id")] 26 | public string TenantId { get; set; } 27 | 28 | /// 29 | /// Specifies if DHCP is enabled. 30 | /// 31 | [JsonProperty("enable_dhcp")] 32 | public new bool IsDHCPEnabled { get; set; } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Monitoring/LoadAverageCheckDetails.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Monitoring 2 | { 3 | using Newtonsoft.Json; 4 | 5 | /// 6 | /// This class represents the detailed configuration parameters for a 7 | /// check. 8 | /// 9 | /// 10 | /// 11 | /// 12 | [JsonObject(MemberSerialization.OptIn)] 13 | public class LoadAverageCheckDetails : CheckDetails 14 | { 15 | /// 16 | /// Initializes a new instance of the class. 17 | /// 18 | public LoadAverageCheckDetails() 19 | { 20 | } 21 | 22 | /// 23 | /// 24 | /// This class only supports checks. 25 | /// 26 | protected internal override bool SupportsCheckType(CheckTypeId checkTypeId) 27 | { 28 | return checkTypeId == CheckTypeId.AgentLoadAverage; 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/ServerVolumeResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the Attach Volume to Server and Get Volume Attachment Details requests. 8 | /// 9 | /// Attach Volume to Server (Rackspace Next Generation Cloud Servers Developer Guide - API v2) 10 | /// Get Volume Attachment Details (Rackspace Next Generation Cloud Servers Developer Guide - API v2) 11 | /// 12 | [JsonObject(MemberSerialization.OptIn)] 13 | internal class ServerVolumeResponse 14 | { 15 | /// 16 | /// Gets information about the volume attachment. 17 | /// 18 | [JsonProperty("volumeAttachment")] 19 | public ServerVolume ServerVolume { get; private set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/corelib/Core/Domain/ProviderStateBase`1.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Domain 2 | { 3 | /// 4 | /// Provides a base class for domain objects which require access to the 5 | /// provider which created them. 6 | /// 7 | /// The provider type. 8 | /// 9 | public abstract class ProviderStateBase : ExtensibleJsonObject 10 | { 11 | /// 12 | /// Gets the provider which created the instance. 13 | /// 14 | protected internal T Provider { get; set; } 15 | 16 | /// 17 | /// Gets the region where the current entity resides. 18 | /// 19 | protected internal string Region { get; set; } 20 | 21 | /// 22 | /// Gets the identity the current entity belongs to, or if 23 | /// the identity was not explicitly specified in the request that created 24 | /// this object (i.e. the default identity of was 25 | /// used). 26 | /// 27 | protected internal CloudIdentity Identity { get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/testing/unit/Stubs.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Threading.Tasks; 3 | using Moq; 4 | using OpenStack.Authentication; 5 | 6 | namespace OpenStack 7 | { 8 | /// 9 | /// Default stubs for unit testing 10 | /// 11 | public static class Stubs 12 | { 13 | public static readonly IAuthenticationProvider AuthenticationProvider; 14 | 15 | static Stubs() 16 | { 17 | var authProviderStub = CreateAuthenticationProvider(); 18 | AuthenticationProvider = authProviderStub.Object; 19 | } 20 | 21 | public static Mock CreateAuthenticationProvider() 22 | { 23 | var stub = new Mock(); 24 | OpenStackNet.Configure(); 25 | 26 | stub.Setup(provider => provider.GetToken(It.IsAny())) 27 | .Returns(Task.FromResult("mock-token")); 28 | 29 | stub.Setup(provider => provider.GetEndpoint(It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())) 30 | .Returns(Task.FromResult("http://example.com/api")); 31 | 32 | return stub; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/LoadBalancers/Response/GetLoadBalancerSslConfigurationResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.LoadBalancers.Response 2 | { 3 | using Newtonsoft.Json; 4 | 5 | /// 6 | /// 7 | [JsonObject(MemberSerialization.OptIn)] 8 | internal class GetLoadBalancerSslConfigurationResponse 9 | { 10 | #pragma warning disable 649 // Field 'fieldName' is never assigned to, and will always have its default value {value} 11 | [JsonProperty("sslTermination")] 12 | private LoadBalancerSslConfiguration _sslConfiguration; 13 | #pragma warning restore 649 14 | 15 | /// 16 | /// Initializes a new instance of the class 17 | /// during JSON deserialization. 18 | /// 19 | [JsonConstructor] 20 | protected GetLoadBalancerSslConfigurationResponse() 21 | { 22 | } 23 | 24 | public LoadBalancerSslConfiguration SslConfiguration 25 | { 26 | get 27 | { 28 | return _sslConfiguration; 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/corelib/Networking/v2/Port.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace OpenStack.Networking.v2 4 | { 5 | /// 6 | /// Represents a port resource of the . 7 | /// 8 | /// 9 | /// Virtual (or logical) switch ports on a given network. 10 | /// 11 | /// 12 | public class Port : PortCreateDefinition 13 | { 14 | /// 15 | /// The ID of the port. 16 | /// 17 | [JsonProperty("id")] 18 | public Identifier Id { get; set; } 19 | 20 | /// 21 | /// The port status. 22 | /// 23 | [JsonProperty("status")] 24 | public PortStatus Status { get; set; } 25 | 26 | /// 27 | /// The administrative state of the port. 28 | /// 29 | [JsonProperty("admin_state_up")] 30 | public bool IsUp { get; set; } 31 | 32 | /// 33 | /// The port security enablement status. 34 | /// 35 | [JsonProperty("port_security_enabled")] 36 | public bool IsPortSecurityEnabled { get; set; } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/corelib/ContentDeliveryNetworks/v1/ServiceCacheRule.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace OpenStack.ContentDeliveryNetworks.v1 4 | { 5 | /// 6 | /// Represents a caching rule resource of the . 7 | /// 8 | /// 9 | public class ServiceCacheRule 10 | { 11 | /// 12 | /// Initializes a new instance of the class. 13 | /// 14 | /// The rule name. 15 | /// The request rule. 16 | public ServiceCacheRule(string name, string requestUrl) 17 | { 18 | Name = name; 19 | RequestUrl = requestUrl; 20 | } 21 | 22 | /// 23 | /// The rule name. 24 | /// 25 | [JsonProperty("name")] 26 | public string Name { get; set; } 27 | 28 | /// 29 | /// The request url this rule should match for this TTL to be used (regex is supported). 30 | /// 31 | [JsonProperty("request_url")] 32 | public string RequestUrl { get; set; } 33 | } 34 | } -------------------------------------------------------------------------------- /src/corelib/Core/ParallelExtensionsExtras/TaskFactoryExtensions_ContinueWhenAllAny.cs: -------------------------------------------------------------------------------- 1 | //-------------------------------------------------------------------------- 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // 5 | // File: TaskFactoryExtensions_ContinueWhenAllAny.cs 6 | // 7 | //-------------------------------------------------------------------------- 8 | 9 | namespace System.Threading.Tasks 10 | { 11 | partial class TaskFactoryExtensions 12 | { 13 | /// 14 | /// Creates a continuation Task that will complete upon 15 | /// the completion of a set of provided Tasks. 16 | /// 17 | /// The TaskFactory to use to create the continuation task. 18 | /// The array of tasks from which to continue. 19 | /// A task that, when completed, will return the array of completed tasks. 20 | public static Task[]> WhenAll( 21 | this TaskFactory factory, params Task[] tasks) 22 | { 23 | return factory.ContinueWhenAll(tasks, completedTasks => completedTasks); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/corelib/Core/IEncodeDecodeProvider.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core 2 | { 3 | /// 4 | /// This interface provides methods for encoding and decoding strings which are 5 | /// embedded in the query string section of a URL. 6 | /// 7 | public interface IEncodeDecodeProvider 8 | { 9 | /// 10 | /// Encodes a string for inclusion in a URL. 11 | /// 12 | /// 13 | /// The encoded string can be restored by calling . 14 | /// 15 | /// The string to encode. 16 | /// The encoded string. If is , this method returns . 17 | string UrlEncode(string stringToEncode); 18 | 19 | /// 20 | /// Decodes a string which is embedded in a URL. 21 | /// 22 | /// The string to decode. 23 | /// The decoded string. If is , this method returns . 24 | string UrlDecode(string stringToDecode); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/corelib/ContentDeliveryNetworks/v1/ServiceRestrictionRule.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace OpenStack.ContentDeliveryNetworks.v1 4 | { 5 | /// 6 | /// Represents a service restriction rule resource of the . 7 | /// 8 | /// 9 | public class ServiceRestrictionRule 10 | { 11 | /// 12 | /// Initializes a new instance of the class. 13 | /// 14 | /// The restriction name. 15 | /// The http host from which requests must originate. 16 | public ServiceRestrictionRule(string name, string referrer) 17 | { 18 | Name = name; 19 | Referrer = referrer; 20 | } 21 | 22 | /// 23 | /// The restriction name. 24 | /// 25 | [JsonProperty("name")] 26 | public string Name { get; set; } 27 | 28 | /// 29 | /// The http host from which requests must originate. 30 | /// 31 | [JsonProperty("referrer")] 32 | public string Referrer { get; set; } 33 | } 34 | } -------------------------------------------------------------------------------- /src/corelib/Core/Domain/SimpleServer.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Domain 2 | { 3 | using System; 4 | using net.openstack.Core.Providers; 5 | using Newtonsoft.Json; 6 | 7 | /// 8 | /// This models the basic JSON description of a server. 9 | /// 10 | /// 11 | /// 12 | [JsonObject(MemberSerialization.OptIn)] 13 | public class SimpleServer : ServerBase 14 | { 15 | /// 16 | /// Gets the server name. 17 | /// The value of this property is not defined by OpenStack, and may not be consistent across vendors. 18 | /// 19 | [JsonProperty] 20 | public string Name { get; private set; } 21 | 22 | /// 23 | protected override void UpdateThis(ServerBase server) 24 | { 25 | if (server == null) 26 | throw new ArgumentNullException("server"); 27 | 28 | base.UpdateThis(server); 29 | 30 | var details = server as SimpleServer; 31 | 32 | if (details == null) 33 | return; 34 | 35 | Name = details.Name; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/corelib/Core/IStatusParser.cs: -------------------------------------------------------------------------------- 1 | using net.openstack.Core.Domain; 2 | 3 | namespace net.openstack.Core 4 | { 5 | /// 6 | /// Represents an object which can convert a string to a object 7 | /// containing a status code and a textual representation of that status. 8 | /// 9 | public interface IStatusParser 10 | { 11 | /// 12 | /// Converts a string to an equivalent object. A return value indicates whether the operation succeeded. 13 | /// 14 | /// A string containing a status to convert. 15 | /// When this method returns, contains a instance 16 | /// equivalent to , if the conversion succeeded, or if 17 | /// the conversion failed. The conversion fails if the parameter is 18 | /// or is not of the correct format. 19 | /// 20 | /// if was converted successfully; otherwise, . 21 | bool TryParse(string value, out Status status); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/LoadBalancers/Response/GetAccessListResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.LoadBalancers.Response 2 | { 3 | using System.Collections.ObjectModel; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// 8 | [JsonObject(MemberSerialization.OptIn)] 9 | internal class GetAccessListResponse 10 | { 11 | #pragma warning disable 649 // Field 'fieldName' is never assigned to, and will always have its default value 12 | [JsonProperty("accessList")] 13 | private NetworkItem[] _accessList; 14 | #pragma warning restore 649 15 | 16 | /// 17 | /// Initializes a new instance of the class 18 | /// during JSON deserialization. 19 | /// 20 | [JsonConstructor] 21 | protected GetAccessListResponse() 22 | { 23 | } 24 | 25 | public ReadOnlyCollection AccessList 26 | { 27 | get 28 | { 29 | if (_accessList == null) 30 | return null; 31 | 32 | return new ReadOnlyCollection(_accessList); 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/corelib/Core/Domain/Converters/IPAddressNoneIsNullSimpleConverter.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Domain.Converters 2 | { 3 | using System; 4 | using System.Net; 5 | using Newtonsoft.Json; 6 | 7 | /// 8 | /// This implementation of extends the behavior of 9 | /// by treating null values in the JSON representation as 10 | /// instead of . 11 | /// 12 | /// 13 | /// 14 | public class IPAddressNoneIsNullSimpleConverter : IPAddressSimpleConverter 15 | { 16 | /// 17 | public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) 18 | { 19 | object result = base.ReadJson(reader, objectType, existingValue, serializer); 20 | return result ?? IPAddress.None; 21 | } 22 | 23 | /// 24 | protected override string ConvertToString(IPAddress obj) 25 | { 26 | if (IPAddress.None.Equals(obj)) 27 | return null; 28 | 29 | return base.ConvertToString(obj); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/LoadBalancers/Response/GetLoadBalancerContentCachingResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.LoadBalancers.Response 2 | { 3 | using Newtonsoft.Json; 4 | 5 | /// 6 | /// 7 | [JsonObject(MemberSerialization.OptIn)] 8 | internal class GetLoadBalancerContentCachingResponse 9 | { 10 | [JsonProperty("contentCaching")] 11 | private LoadBalancerEnabledFlag _body; 12 | 13 | /// 14 | /// Initializes a new instance of the class 15 | /// during JSON deserialization. 16 | /// 17 | [JsonConstructor] 18 | protected GetLoadBalancerContentCachingResponse() 19 | { 20 | } 21 | 22 | protected GetLoadBalancerContentCachingResponse(bool enabled) 23 | { 24 | _body = enabled ? LoadBalancerEnabledFlag.True : LoadBalancerEnabledFlag.False; 25 | } 26 | 27 | public bool? Enabled 28 | { 29 | get 30 | { 31 | if (_body == null) 32 | return null; 33 | 34 | return _body.Enabled; 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Samples/VBCodeSamples/My Project/AssemblyInfo.vb: -------------------------------------------------------------------------------- 1 | Imports System 2 | Imports System.Reflection 3 | Imports System.Runtime.InteropServices 4 | 5 | ' General Information about an assembly is controlled through the following 6 | ' set of attributes. Change these attribute values to modify the information 7 | ' associated with an assembly. 8 | 9 | ' Review the values of the assembly attributes 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 'The following GUID is for the ID of the typelib if this project is exposed to COM 21 | 22 | 23 | ' Version information for an assembly consists of the following four values: 24 | ' 25 | ' Major Version 26 | ' Minor Version 27 | ' Build Number 28 | ' Revision 29 | ' 30 | ' You can specify all the values or you can default the Build and Revision Numbers 31 | ' by using the '*' as shown below: 32 | ' 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/ListVirtualInterfacesResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using System.Collections.Generic; 4 | using net.openstack.Core.Domain; 5 | using Newtonsoft.Json; 6 | 7 | /// 8 | /// This models the JSON response used for the Create Virtual Interface and List Virtual Interfaces requests. 9 | /// 10 | /// Create Virtual Interface (Rackspace Cloud Networks Developer Guide - OpenStack Networking API v2) 11 | /// List Virtual Interfaces (Rackspace Cloud Networks Developer Guide - OpenStack Networking API v2) 12 | /// 13 | [JsonObject(MemberSerialization.OptIn)] 14 | internal class ListVirtualInterfacesResponse 15 | { 16 | /// 17 | /// Gets a collection of information about the virtual interfaces. 18 | /// 19 | [JsonProperty("virtual_interfaces")] 20 | public IEnumerable VirtualInterfaces { get; private set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/ServerDetailsResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the Get Server Details, Update Server, and Rebuild Server requests. 8 | /// 9 | /// Get Server Details (OpenStack Compute API v2 and Extensions Reference) 10 | /// Update Server (OpenStack Compute API v2 and Extensions Reference) 11 | /// Rebuild Server (OpenStack Compute API v2 and Extensions Reference) 12 | /// 13 | [JsonObject(MemberSerialization.OptIn)] 14 | internal class ServerDetailsResponse 15 | { 16 | /// 17 | /// Gets the detailed information about the server. 18 | /// 19 | [JsonProperty("server")] 20 | public Server Server { get; private set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/LoadBalancers/Response/GetLoadBalancerMetadataItemResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.LoadBalancers.Response 2 | { 3 | using Newtonsoft.Json; 4 | 5 | /// 6 | /// 7 | [JsonObject(MemberSerialization.OptIn)] 8 | internal class GetLoadBalancerMetadataItemResponse 9 | { 10 | #pragma warning disable 649 // Field 'fieldName' is never assigned to, and will always have its default value 11 | /// 12 | /// This is the backing field for the property. 13 | /// 14 | [JsonProperty("meta")] 15 | private LoadBalancerMetadataItem _metadataItem; 16 | #pragma warning restore 649 17 | 18 | /// 19 | /// Initializes a new instance of the class 20 | /// during JSON deserialization. 21 | /// 22 | [JsonConstructor] 23 | protected GetLoadBalancerMetadataItemResponse() 24 | { 25 | } 26 | 27 | public LoadBalancerMetadataItem MetadataItem 28 | { 29 | get 30 | { 31 | return _metadataItem; 32 | } 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/corelib/ContentDeliveryNetworks/v1/ServiceOriginRule.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | 3 | namespace OpenStack.ContentDeliveryNetworks.v1 4 | { 5 | /// 6 | /// Represents a service origin rule resource of the . 7 | /// 8 | /// 9 | public class ServiceOriginRule 10 | { 11 | /// 12 | /// Initializes a new instance of the class. 13 | /// 14 | /// The rule name. 15 | /// The request URL this rule should match for this origin to be used. 16 | public ServiceOriginRule(string name, string requestUrl) 17 | { 18 | Name = name; 19 | RequestUrl = requestUrl; 20 | } 21 | 22 | /// 23 | /// The rule name. 24 | /// 25 | [JsonProperty("name")] 26 | public string Name { get; private set; } 27 | 28 | /// 29 | /// The request URL this rule should match for this origin to be used. (regex is supported). 30 | /// 31 | [JsonProperty("request_url")] 32 | public string RequestUrl { get; private set; } 33 | } 34 | } -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/LoadBalancers/Response/GetLoadBalancerConnectionLoggingResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.LoadBalancers.Response 2 | { 3 | using Newtonsoft.Json; 4 | 5 | /// 6 | /// 7 | [JsonObject(MemberSerialization.OptIn)] 8 | internal class GetLoadBalancerConnectionLoggingResponse 9 | { 10 | [JsonProperty("connectionLogging")] 11 | private LoadBalancerEnabledFlag _body; 12 | 13 | /// 14 | /// Initializes a new instance of the class 15 | /// during JSON deserialization. 16 | /// 17 | [JsonConstructor] 18 | protected GetLoadBalancerConnectionLoggingResponse() 19 | { 20 | } 21 | 22 | protected GetLoadBalancerConnectionLoggingResponse(bool enabled) 23 | { 24 | _body = enabled ? LoadBalancerEnabledFlag.True : LoadBalancerEnabledFlag.False; 25 | } 26 | 27 | public bool? Enabled 28 | { 29 | get 30 | { 31 | if (_body == null) 32 | return null; 33 | 34 | return _body.Enabled; 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/corelib/ContentDeliveryNetworks/v1/ServiceRestriction.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Newtonsoft.Json; 3 | 4 | namespace OpenStack.ContentDeliveryNetworks.v1 5 | { 6 | /// 7 | /// Represents a service restriction resource of the . 8 | /// 9 | /// 10 | public class ServiceRestriction 11 | { 12 | /// 13 | /// Initializes a new instance of the class. 14 | /// 15 | /// The restriction name. 16 | /// The rules that define the restrictions to impose. 17 | public ServiceRestriction(string name, IEnumerable rules) 18 | { 19 | Name = name; 20 | Rules = rules.ToNonNullList(); 21 | } 22 | 23 | /// 24 | /// The restriction name. 25 | /// 26 | [JsonProperty("name")] 27 | public string Name { get; set; } 28 | 29 | /// 30 | /// Rules that define the restrictions to impose. 31 | /// 32 | [JsonProperty("rules")] 33 | public IList Rules { get; set; } 34 | } 35 | } -------------------------------------------------------------------------------- /src/Samples/FSharpCodeSamples/ObjectStorageProviderExamples.fs: -------------------------------------------------------------------------------- 1 | module ObjectStorageProviderExamples 2 | 3 | open System; 4 | open System.Collections.Generic; 5 | open net.openstack.Core.Domain; 6 | open net.openstack.Core.Providers; 7 | 8 | //#region ListObjectsInContainer 9 | let listAllObjects(provider : IObjectStorageProvider, containerName : string) = 10 | seq { 11 | let lastContainerObject : ContainerObject ref = { contents = null } 12 | let finished : bool ref = { contents = false } 13 | while not !finished do 14 | let marker = if !lastContainerObject <> null then (!lastContainerObject).Name else null 15 | let containerObjects = provider.ListObjects(containerName, marker= marker) 16 | lastContainerObject := null 17 | for containerObject in containerObjects do 18 | lastContainerObject := containerObject 19 | yield containerObject 20 | if !lastContainerObject = null then 21 | finished := true 22 | } 23 | 24 | let listObjects(provider : IObjectStorageProvider, containerName : string) = 25 | Console.WriteLine("Objects in container {0}", containerName) 26 | for containerObject in listAllObjects(provider, containerName) do 27 | Console.WriteLine(" {0}", containerObject.Name) 28 | () 29 | //#endregion 30 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/ListEndpointsResponse.cs: -------------------------------------------------------------------------------- 1 | using net.openstack.Core.Domain; 2 | using Newtonsoft.Json; 3 | 4 | namespace net.openstack.Providers.Rackspace.Objects.Response 5 | { 6 | /// 7 | /// This models the JSON response used for the List Endpoints request. 8 | /// 9 | /// List Token Endpoints (OpenStack Identity Service API v2.0 Reference) 10 | /// List Service Catalog Endpoints (OpenStack Identity Service API v2.0 Reference) 11 | /// 12 | [JsonObject(MemberSerialization.OptIn)] 13 | internal class ListEndpointsResponse 14 | { 15 | /// 16 | /// Gets additional information about the endpoints. 17 | /// 18 | /// 19 | [JsonProperty("endpoints", DefaultValueHandling = DefaultValueHandling.Ignore)] 20 | public ExtendedEndpoint[] Endpoints { get; private set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/LoadBalancers/Response/ListVirtualAddressesResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.LoadBalancers.Response 2 | { 3 | using System.Collections.ObjectModel; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// 8 | [JsonObject(MemberSerialization.OptIn)] 9 | internal class ListVirtualAddressesResponse 10 | { 11 | #pragma warning disable 649 // Field 'fieldName' is never assigned to, and will always have its default value {value} 12 | [JsonProperty("virtualIps")] 13 | private LoadBalancerVirtualAddress[] _virtualAddresses; 14 | #pragma warning restore 649 15 | 16 | /// 17 | /// Initializes a new instance of the class 18 | /// during JSON deserialization. 19 | /// 20 | [JsonConstructor] 21 | protected ListVirtualAddressesResponse() 22 | { 23 | } 24 | 25 | public ReadOnlyCollection VirtualAddresses 26 | { 27 | get 28 | { 29 | if (_virtualAddresses == null) 30 | return null; 31 | 32 | return new ReadOnlyCollection(_virtualAddresses); 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Samples/CPPCodeSamples/AssemblyInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | using namespace System; 4 | using namespace System::Reflection; 5 | using namespace System::Runtime::CompilerServices; 6 | using namespace System::Runtime::InteropServices; 7 | using namespace System::Security::Permissions; 8 | 9 | // 10 | // General Information about an assembly is controlled through the following 11 | // set of attributes. Change these attribute values to modify the information 12 | // associated with an assembly. 13 | // 14 | [assembly:AssemblyTitleAttribute(L"CPPCodeSamples")]; 15 | [assembly:AssemblyDescriptionAttribute(L"")]; 16 | [assembly:AssemblyConfigurationAttribute(L"")]; 17 | [assembly:AssemblyCompanyAttribute(L"")]; 18 | [assembly:AssemblyProductAttribute(L"CPPCodeSamples")]; 19 | [assembly:AssemblyCopyrightAttribute(L"Copyright (c) 2013")]; 20 | [assembly:AssemblyTrademarkAttribute(L"")]; 21 | [assembly:AssemblyCultureAttribute(L"")]; 22 | 23 | // 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the value or you can default the Revision and Build Numbers 32 | // by using the '*' as shown below: 33 | 34 | [assembly:AssemblyVersionAttribute("1.0.*")]; 35 | 36 | [assembly:ComVisible(false)]; 37 | 38 | [assembly:CLSCompliantAttribute(true)]; -------------------------------------------------------------------------------- /src/corelib/Core/Domain/Queues/Message.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Domain.Queues 2 | { 3 | using System; 4 | using Newtonsoft.Json; 5 | using Newtonsoft.Json.Linq; 6 | 7 | /// 8 | /// Represents a queue message with a dynamic body. 9 | /// 10 | /// 11 | /// 12 | [JsonObject(MemberSerialization.OptIn)] 13 | public class Message : Message 14 | { 15 | /// 16 | /// Initializes a new instance of the class during 17 | /// JSON deserialization. 18 | /// 19 | [JsonConstructor] 20 | protected Message() 21 | { 22 | } 23 | 24 | /// 25 | /// Initializes a new instance of the class using 26 | /// the specified time-to-live and message body. 27 | /// 28 | /// The time-to-live for the message. 29 | /// The message data. 30 | /// If is negative or . 31 | public Message(TimeSpan timeToLive, JObject body) 32 | : base(timeToLive, body) 33 | { 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Queues/Response/ListCloudQueuesResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Queues.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using net.openstack.Core.Domain.Queues; 5 | using Newtonsoft.Json; 6 | 7 | /// 8 | /// 9 | [JsonObject(MemberSerialization.OptIn)] 10 | internal class ListCloudQueuesResponse 11 | { 12 | #pragma warning disable 649 // Field 'fieldName' is never assigned to, and will always have its default value {value} 13 | [JsonProperty("links")] 14 | private Link[] _links; 15 | 16 | [JsonProperty("queues")] 17 | private CloudQueue[] _queues; 18 | #pragma warning restore 649 19 | 20 | /// 21 | /// Initializes a new instance of the class 22 | /// during JSON deserialization. 23 | /// 24 | [JsonConstructor] 25 | protected ListCloudQueuesResponse() 26 | { 27 | } 28 | 29 | public Link[] Links 30 | { 31 | get 32 | { 33 | return _links; 34 | } 35 | } 36 | 37 | public CloudQueue[] Queues 38 | { 39 | get 40 | { 41 | return _queues; 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/corelib/Serialization/IdentifierConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Newtonsoft.Json; 3 | 4 | namespace OpenStack.Serialization 5 | { 6 | /// 7 | public class IdentifierConverter : JsonConverter 8 | { 9 | /// 10 | public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) 11 | { 12 | if (value == null) 13 | return; 14 | 15 | Identifier id = (Identifier) value; 16 | writer.WriteValue(id.ToString()); 17 | } 18 | 19 | /// 20 | public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) 21 | { 22 | switch (reader.TokenType) 23 | { 24 | case JsonToken.Null: 25 | return null; 26 | case JsonToken.String: 27 | var id = reader.Value.ToString(); 28 | return string.IsNullOrEmpty(id) ? null : new Identifier(id); 29 | } 30 | 31 | throw new JsonSerializationException(string.Format("Unexpected token when deserializing {0}", objectType.FullName)); 32 | } 33 | 34 | /// 35 | public override bool CanConvert(Type objectType) 36 | { 37 | return objectType == typeof(Identifier); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/Local.testsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | These are default test settings for a local test run. 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 |
21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Response/RolesResponse.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Response 2 | { 3 | using net.openstack.Core.Domain; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON response used for the List Roles and List User Global Roles requests. 8 | /// 9 | /// List Roles (Rackspace OS-KSADM Extension - API v2.0) 10 | /// List User Global Roles (OpenStack Identity Service API v2.0 Reference) 11 | /// 12 | [JsonObject(MemberSerialization.OptIn)] 13 | internal class RolesResponse 14 | { 15 | /// 16 | /// Gets a collection of roles. 17 | /// 18 | [JsonProperty("roles")] 19 | public Role[] Roles { get; private set; } 20 | 21 | /// 22 | /// Gets a collection of links related to . 23 | /// 24 | [JsonProperty("roles_links")] 25 | public string[] RoleLinks { get; private set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/corelib/Core/Domain/CloudIdentityWithProject.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Domain 2 | { 3 | /// 4 | /// This class extends with the addition of the 5 | /// and properties, which 6 | /// may be required for authentication with certain Identity Service providers. 7 | /// 8 | /// 9 | /// 10 | public class CloudIdentityWithProject : CloudIdentity 11 | { 12 | /// 13 | /// Gets or sets the project ID for this identity. 14 | /// 15 | /// 16 | /// The project ID for this identity. The value may be if the particular 17 | /// provider supports authenticating without a project ID. 18 | /// 19 | public ProjectId ProjectId 20 | { 21 | get; 22 | set; 23 | } 24 | 25 | /// 26 | /// Gets or sets the project name for this identity. 27 | /// 28 | /// 29 | /// The project name for this identity. The value may be if the particular 30 | /// provider supports authenticating without a project name. 31 | /// 32 | public string ProjectName 33 | { 34 | get; 35 | set; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/corelib/ContentDeliveryNetworks/v1/ServiceStatus.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.Serialization; 2 | using Newtonsoft.Json; 3 | using Newtonsoft.Json.Converters; 4 | 5 | namespace OpenStack.ContentDeliveryNetworks.v1 6 | { 7 | /// 8 | /// Content Delivery Network (CDN) service status 9 | /// 10 | [JsonConverter(typeof(StringEnumConverter))] 11 | public enum ServiceStatus 12 | { 13 | /// 14 | /// The service is currently being created and deployed. 15 | /// 16 | [EnumMember(Value = "create_in_progress")] 17 | CreateInProgress, 18 | 19 | /// 20 | /// The service has been deployed and is ready to use. 21 | /// 22 | [EnumMember(Value = "deployed")] 23 | Deployed, 24 | 25 | /// 26 | /// The service is currently being updated. 27 | /// 28 | [EnumMember(Value = "update_in_progress")] 29 | UpdateInProgress, 30 | 31 | /// 32 | /// The service is currently being deleted. 33 | /// 34 | [EnumMember(Value = "delete_in_progress")] 35 | DeleteInProgress, 36 | 37 | /// 38 | /// The previous operation on the service failed. Looks for the details on 39 | /// 40 | [EnumMember(Value = "failed")] 41 | Failed 42 | } 43 | } -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Exceptions/InvalidETagException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | 4 | namespace net.openstack.Providers.Rackspace.Exceptions 5 | { 6 | /// 7 | /// Represents errors which occur while validating the ETag following an object transfer. 8 | /// 9 | /// 10 | [Serializable] 11 | public class InvalidETagException : Exception 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | public InvalidETagException() 17 | { 18 | } 19 | 20 | /// 21 | /// Initializes a new instance of the class with 22 | /// serialized data. 23 | /// 24 | /// The that holds the serialized object data about the exception being thrown. 25 | /// The that contains contextual information about the source or destination. 26 | /// If is . 27 | protected InvalidETagException(SerializationInfo info, StreamingContext context) 28 | : base(info, context) 29 | { 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Request/AddUserRequest.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Request 2 | { 3 | using System; 4 | using net.openstack.Core.Domain; 5 | using Newtonsoft.Json; 6 | 7 | /// 8 | /// This models the JSON request used for the Add User request. 9 | /// 10 | /// Add User (OpenStack Identity Service API v2.0 Reference) 11 | /// 12 | [JsonObject(MemberSerialization.OptIn)] 13 | internal class AddUserRequest 14 | { 15 | /// 16 | /// Gets additional information about the user to add. 17 | /// 18 | [JsonProperty("user")] 19 | public NewUser User { get; private set; } 20 | 21 | /// 22 | /// Initializes a new instance of the class for the 23 | /// specified . 24 | /// 25 | /// The user. 26 | /// If is . 27 | public AddUserRequest(NewUser user) 28 | { 29 | if (user == null) 30 | throw new ArgumentNullException("user"); 31 | 32 | User = user; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/testing/unit/OpenStackNetTests.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net.Http.Headers; 3 | using Flurl.Http; 4 | using OpenStack.Testing; 5 | using Xunit; 6 | 7 | namespace OpenStack 8 | { 9 | public class OpenStackNetTests : IDisposable 10 | { 11 | public void Dispose() 12 | { 13 | OpenStackNet.Configuration.ResetDefaults(); 14 | } 15 | 16 | [Fact] 17 | public async void UserAgentTest() 18 | { 19 | using (var httpTest = new HttpTest()) 20 | { 21 | OpenStackNet.Configure(); 22 | 23 | await "http://api.com".GetAsync(); 24 | 25 | var userAgent = httpTest.CallLog[0].Request.Headers.UserAgent.ToString(); 26 | Assert.Contains("openstack.net", userAgent); 27 | } 28 | } 29 | 30 | [Fact] 31 | public async void UserAgentWithApplicationSuffixTest() 32 | { 33 | using (var httpTest = new HttpTest()) 34 | { 35 | OpenStackNet.Configure(configure: options => options.UserAgents.Add(new ProductInfoHeaderValue("(unittests)"))); 36 | 37 | await "http://api.com".GetAsync(); 38 | 39 | var userAgent = httpTest.CallLog[0].Request.Headers.UserAgent.ToString(); 40 | Assert.Contains("openstack.net", userAgent); 41 | Assert.Contains("unittests", userAgent); 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/testing/unit/Serialization/EmptyEnumerableTests.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Newtonsoft.Json; 3 | using Xunit; 4 | 5 | namespace OpenStack.Serialization 6 | { 7 | public class EmptyEnumerableTests 8 | { 9 | private class ExampleThing 10 | { 11 | public ExampleThing() 12 | { 13 | Messages = new List(); 14 | } 15 | 16 | [JsonProperty("messages")] 17 | public IEnumerable Messages { get; set; } 18 | } 19 | 20 | [Fact] 21 | public void WhenDeserializingNullCollection_ItShouldUseAnEmptyCollection() 22 | { 23 | OpenStackNet.Configure(); 24 | var thing = new ExampleThing{Messages = null}; 25 | string json = JsonConvert.SerializeObject(thing); 26 | Assert.DoesNotContain("messages", json); 27 | 28 | var result = JsonConvert.DeserializeObject(json); 29 | 30 | Assert.NotNull(result.Messages); 31 | Assert.Empty(result.Messages); 32 | } 33 | 34 | [Fact] 35 | public void WhenSerializingEmptyCollection_ItShouldBeIgnored() 36 | { 37 | OpenStackNet.Configure(); 38 | var thing = new ExampleThing { Messages = new List() }; 39 | 40 | string json = JsonConvert.SerializeObject(thing); 41 | 42 | Assert.DoesNotContain("messages", json); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/corelib/Networking/v2/PortUpdateDefinition.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Newtonsoft.Json; 3 | using OpenStack.Serialization; 4 | 5 | namespace OpenStack.Networking.v2 6 | { 7 | /// 8 | /// Represents the set of properties which can be modified when updating a . 9 | /// 10 | /// 11 | [JsonConverterWithConstructor(typeof(RootWrapperConverter), "port")] 12 | public class PortUpdateDefinition 13 | { 14 | /// 15 | /// Initializes a new instance of the class. 16 | /// 17 | public PortUpdateDefinition() 18 | { 19 | FixedIPs = new List(); 20 | SecurityGroups = new List(); 21 | } 22 | 23 | /// 24 | /// The port name. 25 | /// 26 | [JsonProperty("name")] 27 | public string Name { get; set; } 28 | 29 | /// 30 | /// IP addresses for the port. 31 | /// 32 | [JsonProperty("fixed_ips")] 33 | public IList FixedIPs { get; set; } 34 | 35 | /// 36 | /// The IDs of any attached security groups. 37 | /// 38 | [JsonProperty("security_groups")] 39 | public IList SecurityGroups { get; set; } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Validators/CloudBlockStorageValidator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using net.openstack.Core.Validators; 3 | using net.openstack.Providers.Rackspace.Exceptions; 4 | 5 | namespace net.openstack.Providers.Rackspace.Validators 6 | { 7 | /// 8 | /// Provides an implementation of for 9 | /// operation with Rackspace's Cloud Block Storage product. 10 | /// 11 | /// 12 | public class CloudBlockStorageValidator : IBlockStorageValidator 13 | { 14 | /// 15 | /// A default instance of . 16 | /// 17 | private static readonly CloudBlockStorageValidator _default = new CloudBlockStorageValidator(); 18 | 19 | /// 20 | /// Gets a default implementation of . 21 | /// 22 | public static CloudBlockStorageValidator Default 23 | { 24 | get 25 | { 26 | return _default; 27 | } 28 | } 29 | 30 | /// 31 | public void ValidateVolumeSize(int size) 32 | { 33 | if (size < 0) 34 | throw new ArgumentOutOfRangeException("size"); 35 | 36 | if (size < 100 || size > 1000) 37 | throw new InvalidVolumeSizeException(size); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Databases/Database.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Databases 2 | { 3 | using Newtonsoft.Json; 4 | using ExtensibleJsonObject = net.openstack.Core.Domain.ExtensibleJsonObject; 5 | 6 | /// 7 | /// This class models the JSON representation of a database resource in the . 8 | /// 9 | /// 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | public class Database : ExtensibleJsonObject 13 | { 14 | #pragma warning disable 649 // Field 'fieldName' is never assigned to, and will always have its default value {value} 15 | /// 16 | /// This is the backing field for the property. 17 | /// 18 | [JsonProperty("name")] 19 | private DatabaseName _name; 20 | #pragma warning restore 649 21 | 22 | /// 23 | /// Initializes a new instance of the class 24 | /// during JSON deserialization. 25 | /// 26 | [JsonConstructor] 27 | protected Database() 28 | { 29 | } 30 | 31 | /// 32 | /// Gets the name of the database. 33 | /// 34 | public DatabaseName Name 35 | { 36 | get 37 | { 38 | return _name; 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Request/AddRoleRequest.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Request 2 | { 3 | using System; 4 | using net.openstack.Core.Domain; 5 | using Newtonsoft.Json; 6 | 7 | /// 8 | /// This models the JSON request used for the Add Role request. 9 | /// 10 | /// Add Role (OpenStack Identity Service API v2.0 Reference) 11 | /// 12 | [JsonObject(MemberSerialization.OptIn)] 13 | internal class AddRoleRequest 14 | { 15 | /// 16 | /// Gets additional information about the role to add. 17 | /// 18 | [JsonProperty("role")] 19 | public Role Role { get; private set; } 20 | 21 | /// 22 | /// Initializes a new instance of the class for the 23 | /// specified . 24 | /// 25 | /// The role. 26 | /// If is . 27 | public AddRoleRequest(Role role) 28 | { 29 | if (role == null) 30 | throw new ArgumentNullException("role"); 31 | 32 | Role = role; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Request/ServerResizeRequest.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Request 2 | { 3 | using System; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON request used for the Resize Server request. 8 | /// 9 | /// Resize Server (OpenStack Compute API v2 and Extensions Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class ServerResizeRequest 13 | { 14 | /// 15 | /// Gets additional information about the Resize Server request. 16 | /// 17 | [JsonProperty("resize")] 18 | public ServerResizeDetails Details { get; private set; } 19 | 20 | /// 21 | /// Initializes a new instance of the 22 | /// class with the specified details. 23 | /// 24 | /// The details of the request. 25 | /// If is . 26 | public ServerResizeRequest(ServerResizeDetails details) 27 | { 28 | if (details == null) 29 | throw new ArgumentNullException("details"); 30 | 31 | Details = details; 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /src/testing/unit/AuthenticationTests.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using Flurl.Http; 3 | using OpenStack.ContentDeliveryNetworks.v1; 4 | using OpenStack.Testing; 5 | using Xunit; 6 | 7 | namespace OpenStack 8 | { 9 | public class AuthenticationTests 10 | { 11 | [Fact] 12 | public async void When401UnauthorizedIsReturned_RetryRequest() 13 | { 14 | using (var httpTest = new HttpTest()) 15 | { 16 | httpTest.RespondWith((int)HttpStatusCode.Unauthorized, "Your token has expired"); 17 | httpTest.RespondWithJson(new Flavor()); 18 | 19 | var service = new ContentDeliveryNetworkService(Stubs.AuthenticationProvider, "DFW"); 20 | var flavor = await service.GetFlavorAsync("flavor-id"); 21 | Assert.NotNull(flavor); 22 | } 23 | } 24 | 25 | [Fact] 26 | public async void When401AuthenticationFailsMultipleTimes_ThrowException() 27 | { 28 | using (var httpTest = new HttpTest()) 29 | { 30 | httpTest.RespondWith((int)HttpStatusCode.Unauthorized, "Your token has expired"); 31 | httpTest.RespondWith((int)HttpStatusCode.Unauthorized, "Your token has expired"); 32 | 33 | var service = new ContentDeliveryNetworkService(Stubs.AuthenticationProvider, "DFW"); 34 | await Assert.ThrowsAsync(() => service.GetFlavorAsync("flavor-id")); 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Request/ServerRebootRequest.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Request 2 | { 3 | using System; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON request used for the Reboot Server request. 8 | /// 9 | /// Reboot Server (OpenStack Compute API v2 and Extensions Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class ServerRebootRequest 13 | { 14 | /// 15 | /// Gets additional details about the Reboot Server request. 16 | /// 17 | [JsonProperty("reboot")] 18 | public ServerRebootDetails Details { get; private set; } 19 | 20 | /// 21 | /// Initializes a new instance of the 22 | /// class with the specified details. 23 | /// 24 | /// The details of the request. 25 | /// If is . 26 | public ServerRebootRequest(ServerRebootDetails details) 27 | { 28 | if (details == null) 29 | throw new ArgumentNullException("details"); 30 | 31 | Details = details; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/LoadBalancers/Request/AddLoadBalancerMetadataRequest.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.LoadBalancers.Request 2 | { 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using Newtonsoft.Json; 7 | 8 | /// 9 | /// 10 | [JsonObject(MemberSerialization.OptIn)] 11 | internal class AddLoadBalancerMetadataRequest 12 | { 13 | [JsonProperty("metadata")] 14 | private LoadBalancerMetadataItem[] _metadata; 15 | 16 | /// 17 | /// Initializes a new instance of the class 18 | /// with the specified metadata. 19 | /// 20 | /// The metadata to add. 21 | /// If is . 22 | /// If contains a pair whose key is or empty, or whose value is . 23 | public AddLoadBalancerMetadataRequest(IEnumerable> metadata) 24 | { 25 | if (metadata == null) 26 | throw new ArgumentNullException("metadata"); 27 | 28 | _metadata = metadata.Select(i => new LoadBalancerMetadataItem(i.Key, i.Value)).ToArray(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/corelib/Core/Validators/IObjectStorageValidator.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Validators 2 | { 3 | using System; 4 | using net.openstack.Core.Exceptions; 5 | using net.openstack.Core.Providers; 6 | 7 | /// 8 | /// Represents an object that validates arguments for an implementation of 9 | /// prior to sending the calls to the underlying REST API. 10 | /// 11 | public interface IObjectStorageValidator 12 | { 13 | /// 14 | /// Validates a container name for an object storage provider. 15 | /// 16 | /// The container name. 17 | /// If is . 18 | /// If is not a valid container name. 19 | void ValidateContainerName(string containerName); 20 | 21 | /// 22 | /// Validates an object name for an object storage provider. 23 | /// 24 | /// The object name. 25 | /// If is . 26 | /// If is not a valid object name. 27 | void ValidateObjectName(string objectName); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Request/ServerRebuildRequest.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Request 2 | { 3 | using System; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON request used for the Rebuild Server request. 8 | /// 9 | /// Rebuild Server (OpenStack Compute API v2 and Extensions Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class ServerRebuildRequest 13 | { 14 | /// 15 | /// Gets additional information about the Rebuild Server request. 16 | /// 17 | [JsonProperty("rebuild")] 18 | public ServerRebuildDetails Details { get; private set; } 19 | 20 | /// 21 | /// Initializes a new instance of the 22 | /// class with the specified details. 23 | /// 24 | /// The details of the request. 25 | /// If is . 26 | public ServerRebuildRequest(ServerRebuildDetails details) 27 | { 28 | if (details == null) 29 | throw new ArgumentNullException("details"); 30 | 31 | Details = details; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/corelib/Core/Domain/HomeDocument.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Core.Domain 2 | { 3 | using System.Collections.Generic; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This class models the root object of the home document described by 8 | /// Home Documents for HTTP APIs. 9 | /// 10 | /// JSON Home Documents (Home Documents for HTTP APIs - draft-nottingham-json-home-03) 11 | /// 12 | /// 13 | [JsonObject(MemberSerialization.OptIn)] 14 | public class HomeDocument : ExtensibleJsonObject 15 | { 16 | #pragma warning disable 649 // Field 'fieldName' is never assigned to, and will always have its default value {value} 17 | /// 18 | /// The backing field for the property. 19 | /// 20 | [JsonProperty("resources")] 21 | private Dictionary _resources; 22 | #pragma warning restore 649 23 | 24 | /// 25 | /// Gets the resources. The keys of this dictionary are link relation types 26 | /// (as defined by RFC5988). 27 | /// 28 | public Dictionary Resources 29 | { 30 | get 31 | { 32 | return _resources; 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/corelib/Exceptions/RegionRequiredException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | 4 | namespace OpenStack 5 | { 6 | /// 7 | /// The exception that is thrown when a service requires that a region is explicitly set and one was not provided. 8 | /// 9 | /// 10 | [Serializable] 11 | public class RegionRequiredException : Exception 12 | { 13 | /// 14 | /// Initializes a new instance of the class. 15 | /// 16 | /// The error message. 17 | /// The message formatting arguments. 18 | public RegionRequiredException(string message, params object[] args) : base(string.Format(message, args)) 19 | { 20 | } 21 | 22 | /// 23 | /// Initializes a new instance of the class. 24 | /// 25 | /// The that holds the serialized object data about the exception being thrown. 26 | /// The that contains contextual information about the source or destination. 27 | protected RegionRequiredException(SerializationInfo info, StreamingContext context) : base(info, context) 28 | { 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Request/CreateCloudNetworkRequest.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Request 2 | { 3 | using System; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON request used for the Create Network request. 8 | /// 9 | /// Create Network (OpenStack Networking API v2.0 Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class CreateCloudNetworkRequest 13 | { 14 | /// 15 | /// Gets additional details about the Create Network request. 16 | /// 17 | [JsonProperty("network")] 18 | public CreateCloudNetworksDetails Details { get; private set; } 19 | 20 | /// 21 | /// Initializes a new instance of the 22 | /// class with the specified details. 23 | /// 24 | /// The details of the request. 25 | /// If is . 26 | public CreateCloudNetworkRequest(CreateCloudNetworksDetails details) 27 | { 28 | if (details == null) 29 | throw new ArgumentNullException("details"); 30 | 31 | Details = details; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Documentation/OpenStackSDK.content: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/corelib/Providers/Rackspace/Objects/Request/CreateServerImageRequest.cs: -------------------------------------------------------------------------------- 1 | namespace net.openstack.Providers.Rackspace.Objects.Request 2 | { 3 | using System; 4 | using Newtonsoft.Json; 5 | 6 | /// 7 | /// This models the JSON request used for the Create Image request. 8 | /// 9 | /// Create Image (OpenStack Compute API v2 and Extensions Reference) 10 | /// 11 | [JsonObject(MemberSerialization.OptIn)] 12 | internal class CreateServerImageRequest 13 | { 14 | /// 15 | /// Gets additional details about the Create Image request. 16 | /// 17 | [JsonProperty("createImage")] 18 | public CreateServerImageDetails Details { get; private set; } 19 | 20 | /// 21 | /// Initializes a new instance of the 22 | /// class with the specified details. 23 | /// 24 | /// The details of the request. 25 | /// If is . 26 | public CreateServerImageRequest(CreateServerImageDetails details) 27 | { 28 | if (details == null) 29 | throw new ArgumentNullException("details"); 30 | 31 | Details = details; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/corelib/Core/Exceptions/Response/ItemNotFoundException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | using System.Runtime.Serialization; 4 | using RestResponse = JSIStudios.SimpleRESTServices.Client.Response; 5 | 6 | namespace net.openstack.Core.Exceptions.Response 7 | { 8 | /// 9 | /// Represents errors with status code resulting 10 | /// from a call to a REST API. 11 | /// 12 | /// 13 | [Serializable] 14 | public class ItemNotFoundException : ResponseException 15 | { 16 | /// 17 | /// Initializes a new instance of the class with the 18 | /// specified REST response. 19 | /// 20 | /// The REST response. 21 | public ItemNotFoundException(RestResponse response) 22 | : base("The item was not found or does not exist.", response) 23 | { 24 | } 25 | 26 | /// 27 | /// Initializes a new instance of the class with the 28 | /// specified error message and REST response. 29 | /// 30 | /// The message that describes the error. 31 | /// The REST response. 32 | public ItemNotFoundException(string message, RestResponse response) 33 | : base(message, response) 34 | { 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Samples/CSharpCodeSamples/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CSharpCodeSamples")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CSharpCodeSamples")] 13 | [assembly: AssemblyCopyright("Copyright © 2013")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("a2ab7054-310b-49b4-80b9-7094c0aa64fc")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | --------------------------------------------------------------------------------