Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/corelib/Core/Domain/CloudBlockStorage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace net.openstack.Core.Domain
{
public enum CloudBlockStorage
{
Unknown,
VolumeCreated,
VolumeExists
}
}
15 changes: 15 additions & 0 deletions src/corelib/Core/ICloudBlockStorageProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace net.openstack.Core
{
public interface ICloudBlockStorageProvider
{




}
}
7 changes: 7 additions & 0 deletions src/corelib/Core/ICloudBlockStorageValidator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace net.openstack.Core
{
public interface ICloudBlockStorageValidator
{

}
}
41 changes: 41 additions & 0 deletions src/corelib/Providers/Rackspace/CloudBlockStorageProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using JSIStudios.SimpleRESTServices.Client;
using JSIStudios.SimpleRESTServices.Client.Json;
using net.openstack.Core;
using net.openstack.Core.Domain;
using net.openstack.Providers.Rackspace.Validators;

namespace net.openstack.Providers.Rackspace
{
public class CloudBlockStorageProvider : ProviderBase, ICloudBlockStorageProvider
{

private readonly ICloudBlockStorageValidator _cloudBlockStorageValidator;

public CloudBlockStorageProvider()
: this(null) { }

public CloudBlockStorageProvider(CloudIdentity defaultIdentity)
: this(defaultIdentity, new IdentityProvider(), new JsonRestServices(), new CloudBlockStorageValidator()) { }

public CloudBlockStorageProvider(IIdentityProvider identityProvider, IRestService restService, ICloudBlockStorageValidator cloudBlockStorageValidator)
: this(null, identityProvider, restService, cloudBlockStorageValidator) { }

public CloudBlockStorageProvider(CloudIdentity defaultIdentity, IIdentityProvider identityProvider, IRestService restService, ICloudBlockStorageValidator cloudBlockStorageValidator)
: base(defaultIdentity, identityProvider, restService)
{
_cloudBlockStorageValidator = cloudBlockStorageValidator;
}




#region Private methods

protected string GetServiceEndpoint(CloudIdentity identity = null, string region = null)
{
return base.GetPublicServiceEndpoint(identity, "cloudBlockStorage", region);
}

#endregion
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using net.openstack.Core;

namespace net.openstack.Providers.Rackspace.Validators
{
public class CloudBlockStorageValidator : ICloudBlockStorageValidator
{
}
}
5 changes: 5 additions & 0 deletions src/corelib/corelib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Core\Domain\Address.cs" />
<Compile Include="Core\Domain\CloudBlockStorage.cs" />
<Compile Include="Core\Domain\CloudIdentity.cs" />
<Compile Include="Core\Domain\Container.cs" />
<Compile Include="Core\Domain\Flavor.cs" />
<Compile Include="Core\Domain\FlavorDetails.cs" />
<Compile Include="Core\ICloudBlockStorageProvider.cs" />
<Compile Include="Core\ICloudBlockStorageValidator.cs" />
<Compile Include="Core\Domain\ImageType.cs" />
<Compile Include="Core\Domain\Link.cs" />
<Compile Include="Core\Domain\Mapping\IJsonObjectMapper.cs" />
Expand All @@ -74,6 +77,7 @@
<Compile Include="Core\Exceptions\Response\UserNotAuthorizedException.cs" />
<Compile Include="Core\IObjectStoreProvider.cs" />
<Compile Include="Core\IObjectStoreValidator.cs" />
<Compile Include="Providers\Rackspace\CloudBlockStorageProvider.cs" />
<Compile Include="Providers\Rackspace\IExtendedIdentityProvider.cs" />
<Compile Include="Providers\Rackspace\ObjectStoreProvider.cs" />
<Compile Include="Providers\Rackspace\ComputeProvider.cs" />
Expand Down Expand Up @@ -136,6 +140,7 @@
<Compile Include="Core\Exceptions\Response\ResponseException.cs" />
<Compile Include="Core\Exceptions\UserAuthenticationException.cs" />
<Compile Include="Core\Exceptions\UserAuthorizationException.cs" />
<Compile Include="Providers\Rackspace\Validators\CloudBlockStorageValidator.cs" />
<Compile Include="UserAccessCache.cs" />
<Compile Include="Core\IIdentityProvider.cs" />
<Compile Include="Core\IRetryLogic.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using net.openstack.Core.Domain;
using net.openstack.Providers.Rackspace;

namespace Net.OpenStack.Testing.Integration.Providers.Rackspace
{
[TestClass]
public class CloudBlockStorageTests
{
private static RackspaceCloudIdentity _testIdentity;
private static RackspaceCloudIdentity _testAdminIdentity;
private TestContext testContextInstance;

/// <summary>
///Gets or sets the test context which provides
///information about and functionality for the current test run.
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}

[ClassInitialize]
public static void Init(TestContext context)
{
_testIdentity = new RackspaceCloudIdentity(Bootstrapper.Settings.TestIdentity);

}
}
}
1 change: 1 addition & 0 deletions src/testing/integration/integration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<ItemGroup>
<Compile Include="Bootstrapper.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Providers\Rackspace\CloudBlockStorageTests.cs" />
<Compile Include="Providers\Rackspace\ComputeTests.cs" />
<Compile Include="Providers\Rackspace\IdentityTests.cs" />
<Compile Include="Providers\Rackspace\ExtendedIdentityTests.cs" />
Expand Down
10 changes: 10 additions & 0 deletions src/testing/unit/Providers/Rackspace/CloudBlockStorageTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace OpenStackNet.Testing.Unit.Providers.Rackspace
{
[TestClass]
public class CloudBlockStorageTests
{

}
}
1 change: 1 addition & 0 deletions src/testing/unit/unit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Providers\Rackspace\CloudBlockStorageTests.cs" />
<Compile Include="Providers\Rackspace\IdentityProviderCacheTests.cs" />
<Compile Include="Providers\Rackspace\ObjectProviderValidatorTests.cs" />
<Compile Include="UnitTest1.cs" />
Expand Down