Skip to content

Commit 0de16f8

Browse files
author
Alan Quillin
committed
Added default identity to Identity, Computer and Base providers.
1 parent af34f88 commit 0de16f8

29 files changed

+611
-494
lines changed

src/console/console.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@
3535
<WarningLevel>4</WarningLevel>
3636
</PropertyGroup>
3737
<ItemGroup>
38-
<Reference Include="Newtonsoft.Json">
38+
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
3939
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
4040
</Reference>
41-
<Reference Include="SimpleRESTServices, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
41+
<Reference Include="SimpleRESTServices, Version=1.0.5.0, Culture=neutral, processorArchitecture=MSIL">
4242
<SpecificVersion>False</SpecificVersion>
43-
<HintPath>..\packages\SimpleRESTServices.1.0.2.0\lib\net40\SimpleRESTServices.dll</HintPath>
43+
<HintPath>..\packages\SimpleRESTServices.1.0.5.0\lib\net40\SimpleRESTServices.dll</HintPath>
4444
</Reference>
4545
<Reference Include="System" />
4646
<Reference Include="System.Core" />

src/console/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="Newtonsoft.Json" version="4.5.11" targetFramework="net40" />
4-
<package id="SimpleRESTServices" version="1.0.2.0" targetFramework="net40" />
4+
<package id="SimpleRESTServices" version="1.0.5.0" targetFramework="net40" />
55
</packages>

src/corelib/Core/Domain/Endpoint.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@ public class Endpoint
1313
public string VersionInfo { get; set; }
1414

1515
public string VersionList { get; set; }
16+
17+
public string InternalURL { get; set; }
1618
}
1719
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace net.openstack.Core.Exceptions.Response
2+
{
3+
public class ServiceConflictException : ResponseException
4+
{
5+
public ServiceConflictException(JSIStudios.SimpleRESTServices.Client.Response response) : base("There was a conflict with the service. Entity may already exist.", response) { }
6+
7+
public ServiceConflictException(string message, JSIStudios.SimpleRESTServices.Client.Response response) : base(message, response) { }
8+
}
9+
}

src/corelib/Core/IComputeProvider.cs

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,63 +7,63 @@ namespace net.openstack.Core
77
public interface IComputeProvider
88
{
99
// Servers
10-
IEnumerable<Server> ListServers(CloudIdentity identity, string imageId = null, string flavorId = null, string name = null, string status = null, string markerId = null, int? limit = null, DateTime? changesSince = null, string region = null);
11-
IEnumerable<ServerDetails> ListServersWithDetails(CloudIdentity identity, string imageId = null, string flavorId = null, string name = null, string status = null, string markerId = null, int? limit = null, DateTime? changesSince = null, string region = null);
12-
NewServer CreateServer(CloudIdentity identity, string cloudServerName, string imageName, string flavor, string diskConfig = null, Metadata metadata = null, string region = null);
13-
ServerDetails GetDetails(CloudIdentity identity, string cloudServerId, string region = null);
14-
bool UpdateServer(CloudIdentity identity, string cloudServerId, string name = null, string ipV4Address = null, string ipV6Address = null, string region = null);
15-
bool DeleteServer(CloudIdentity identity, string cloudServerId, string region = null);
16-
10+
IEnumerable<Server> ListServers(string imageId = null, string flavorId = null, string name = null, string status = null, string markerId = null, int? limit = null, DateTime? changesSince = null, string region = null, CloudIdentity identity = null);
11+
IEnumerable<ServerDetails> ListServersWithDetails(string imageId = null, string flavorId = null, string name = null, string status = null, string markerId = null, int? limit = null, DateTime? changesSince = null, string region = null, CloudIdentity identity = null);
12+
NewServer CreateServer(string cloudServerName, string imageName, string flavor, string diskConfig = null, Metadata metadata = null, string region = null, CloudIdentity identity = null);
13+
ServerDetails GetDetails(string cloudServerId, string region = null, CloudIdentity identity = null);
14+
bool UpdateServer(string cloudServerId, string name = null, string ipV4Address = null, string ipV6Address = null, string region = null, CloudIdentity identity = null);
15+
bool DeleteServer(string cloudServerId, string region = null, CloudIdentity identity = null);
16+
1717
// Server Addresses
18-
ServerAddresses ListAddresses(CloudIdentity identity, string serverId, string region = null);
19-
Network ListAddressesByNetwork(CloudIdentity identity, string serverId, string network, string region = null);
18+
ServerAddresses ListAddresses(string serverId, string region = null, CloudIdentity identity = null);
19+
Network ListAddressesByNetwork(string serverId, string network, string region = null, CloudIdentity identity = null);
2020

2121
// Server Actions
22-
bool ChangeAdministratorPassword(CloudIdentity identity, string serverId, string password, string region = null);
23-
bool RebootServer(CloudIdentity identity, string serverId, RebootType rebootType, string region = null);
24-
ServerDetails RebuildServer(CloudIdentity identity, string serverId, string serverName, string imageName, string flavor, string adminPassword, string ipV4Address = null, string ipV6Address = null, Metadata metadata = null, string diskConfig = null, Personality personality = null, string region = null);
25-
bool ResizeServer(CloudIdentity identity, string serverId, string serverName, string flavor, string diskConfig = null, string region = null);
26-
bool ConfirmServerResize(CloudIdentity identity, string serverId, string region = null);
27-
bool RevertServerResize(CloudIdentity identity, string serverId, string region = null);
28-
string RescueServer(CloudIdentity identity, string serverId, string region = null);
29-
ServerDetails UnRescueServer(CloudIdentity identity, string serverId, string region = null);
30-
bool CreateImage(CloudIdentity identity, string serverId, string imageName, Metadata metadata = null, string region = null);
22+
bool ChangeAdministratorPassword(string serverId, string password, string region = null, CloudIdentity identity = null);
23+
bool RebootServer(string serverId, RebootType rebootType, string region = null, CloudIdentity identity = null);
24+
ServerDetails RebuildServer(string serverId, string serverName, string imageName, string flavor, string adminPassword, string ipV4Address = null, string ipV6Address = null, Metadata metadata = null, string diskConfig = null, Personality personality = null, string region = null, CloudIdentity identity = null);
25+
bool ResizeServer(string serverId, string serverName, string flavor, string diskConfig = null, string region = null, CloudIdentity identity = null);
26+
bool ConfirmServerResize(string serverId, string region = null, CloudIdentity identity = null);
27+
bool RevertServerResize(string serverId, string region = null, CloudIdentity identity = null);
28+
string RescueServer(string serverId, string region = null, CloudIdentity identity = null);
29+
ServerDetails UnRescueServer(string serverId, string region = null, CloudIdentity identity = null);
30+
bool CreateImage(string serverId, string imageName, Metadata metadata = null, string region = null, CloudIdentity identity = null);
3131

3232
// Volume Attachment Actions
3333

3434
// Flavors
35-
IEnumerable<Flavor> ListFlavors(CloudIdentity identity, int minDiskInGB = 0, int minRamInMB = 0, string markerId = null, int limit = 0, string region = null);
36-
IEnumerable<FlavorDetails> ListFlavorsWithDetails(CloudIdentity identity, int minDiskInGB = 0, int minRamInMB = 0, string markerId = null, int limit = 0, string region = null);
37-
FlavorDetails GetFlavor(CloudIdentity identity, string id, string region = null);
35+
IEnumerable<Flavor> ListFlavors(int minDiskInGB = 0, int minRamInMB = 0, string markerId = null, int limit = 0, string region = null, CloudIdentity identity = null);
36+
IEnumerable<FlavorDetails> ListFlavorsWithDetails(int minDiskInGB = 0, int minRamInMB = 0, string markerId = null, int limit = 0, string region = null, CloudIdentity identity = null);
37+
FlavorDetails GetFlavor(string id, string region = null, CloudIdentity identity = null);
3838

3939
// Images
40-
IEnumerable<ServerImage> ListImages(CloudIdentity identity, string serverId = null, string imageName = null, string imageStatus = null, DateTime changesSince = default(DateTime), string markerId = null, int limit = 0, string imageType = null, string region = null);
41-
IEnumerable<ServerImageDetails> ListImagesWithDetails(CloudIdentity identity, string serverId = null, string imageName = null, string imageStatus = null, DateTime changesSince = default(DateTime), string markerId = null, int limit = 0, string imageType = null, string region = null);
42-
ServerImageDetails GetImage(CloudIdentity identity, string imageId, string region = null);
43-
bool DeleteImage(CloudIdentity identity, string imageId, string region = null);
40+
IEnumerable<ServerImage> ListImages(string serverId = null, string imageName = null, string imageStatus = null, DateTime changesSince = default(DateTime), string markerId = null, int limit = 0, string imageType = null, string region = null, CloudIdentity identity = null);
41+
IEnumerable<ServerImageDetails> ListImagesWithDetails(string serverId = null, string imageName = null, string imageStatus = null, DateTime changesSince = default(DateTime), string markerId = null, int limit = 0, string imageType = null, string region = null, CloudIdentity identity = null);
42+
ServerImageDetails GetImage(string imageId, string region = null, CloudIdentity identity = null);
43+
bool DeleteImage(string imageId, string region = null, CloudIdentity identity = null);
4444

4545
// Server metadata
46-
Metadata ListServerMetadata(CloudIdentity identity, string cloudServerId, string region = null);
47-
bool SetServerMetadata(CloudIdentity identity, string cloudServerId, Metadata metadata, string region = null);
48-
bool UpdateServerMetadata(CloudIdentity identity, string cloudServerId, Metadata metadata, string region = null);
49-
string GetServerMetadataItem(CloudIdentity identity, string cloudServerId, string key, string region = null);
50-
bool SetServerMetadataItem(CloudIdentity identity, string cloudServerId, string key, string value, string region = null);
51-
bool DeleteServerMetadataItem(CloudIdentity identity, string cloudServerId, string key, string region = null);
46+
Metadata ListServerMetadata(string cloudServerId, string region = null, CloudIdentity identity = null);
47+
bool SetServerMetadata(string cloudServerId, Metadata metadata, string region = null, CloudIdentity identity = null);
48+
bool UpdateServerMetadata(string cloudServerId, Metadata metadata, string region = null, CloudIdentity identity = null);
49+
string GetServerMetadataItem(string cloudServerId, string key, string region = null, CloudIdentity identity = null);
50+
bool SetServerMetadataItem(string cloudServerId, string key, string value, string region = null, CloudIdentity identity = null);
51+
bool DeleteServerMetadataItem(string cloudServerId, string key, string region = null, CloudIdentity identity = null);
5252

5353
// Image metadata
54-
Metadata ListImageMetadata(CloudIdentity identity, string cloudServerId, string region = null);
55-
bool SetImageMetadata(CloudIdentity identity, string cloudServerId, Metadata metadata, string region = null);
56-
bool UpdateImageMetadata(CloudIdentity identity, string cloudServerId, Metadata metadata, string region = null);
57-
string GetImageMetadataItem(CloudIdentity identity, string cloudServerId, string key, string region = null);
58-
bool SetImageMetadataItem(CloudIdentity identity, string cloudServerId, string key, string value, string region = null);
59-
bool DeleteImageMetadataItem(CloudIdentity identity, string cloudServerId, string key, string region = null);
54+
Metadata ListImageMetadata(string cloudServerId, string region = null, CloudIdentity identity = null);
55+
bool SetImageMetadata(string cloudServerId, Metadata metadata, string region = null, CloudIdentity identity = null);
56+
bool UpdateImageMetadata(string cloudServerId, Metadata metadata, string region = null, CloudIdentity identity = null);
57+
string GetImageMetadataItem(string cloudServerId, string key, string region = null, CloudIdentity identity = null);
58+
bool SetImageMetadataItem(string cloudServerId, string key, string value, string region = null, CloudIdentity identity = null);
59+
bool DeleteImageMetadataItem(string cloudServerId, string key, string region = null, CloudIdentity identity = null);
6060

61-
ServerDetails WaitForServerState(CloudIdentity identity, string cloudServerId, string expectedState, string[] errorStates, string region = null, int refreshCount = 600, int refreshDelayInMS = 2400);
62-
ServerDetails WaitForServerActive(CloudIdentity identity, string cloudServerId, string region = null, int refreshCount = 600, int refreshDelayInMS = 2400);
63-
ServerDetails WaitForServerDeleted(CloudIdentity identity, string cloudServerId, string region = null, int refreshCount = 600, int refreshDelayInMS = 2400);
64-
ServerImageDetails WaitForImageState(CloudIdentity identity, string imageId, string expectedState, string[] errorStates, string region = null, int refreshCount = 600, int refreshDelayInMS = 2400);
65-
ServerImageDetails WaitForImageActive(CloudIdentity identity, string imageId, string region = null, int refreshCount = 600, int refreshDelayInMS = 2400);
66-
ServerImageDetails WaitForImageDeleted(CloudIdentity identity, string imageId, string region = null, int refreshCount = 600, int refreshDelayInMS = 2400);
61+
ServerDetails WaitForServerState(string cloudServerId, string expectedState, string[] errorStates, string region = null, int refreshCount = 600, int refreshDelayInMS = 2400, CloudIdentity identity = null);
62+
ServerDetails WaitForServerActive(string cloudServerId, string region = null, int refreshCount = 600, int refreshDelayInMS = 2400, CloudIdentity identity = null);
63+
void WaitForServerDeleted(string cloudServerId, string region = null, int refreshCount = 600, int refreshDelayInMS = 2400, CloudIdentity identity = null);
64+
ServerImageDetails WaitForImageState(string imageId, string expectedState, string[] errorStates, string region = null, int refreshCount = 600, int refreshDelayInMS = 2400, CloudIdentity identity = null);
65+
ServerImageDetails WaitForImageActive(string imageId, string region = null, int refreshCount = 600, int refreshDelayInMS = 2400, CloudIdentity identity = null);
66+
void WaitForImageDeleted(string imageId, string region = null, int refreshCount = 600, int refreshDelayInMS = 2400, CloudIdentity identity = null);
6767
}
6868
}
6969

src/corelib/Core/IIdentityProvider.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ namespace net.openstack.Core
44
{
55
public interface IIdentityProvider
66
{
7-
UserAccess Authenticate(CloudIdentity identity);
8-
string GetToken(CloudIdentity identity, bool forceCacheRefresh = false);
9-
IdentityToken GetTokenInfo(CloudIdentity identity, bool forceCacheRefresh = false);
7+
UserAccess Authenticate(CloudIdentity identity = null);
8+
string GetToken(CloudIdentity identity = null, bool forceCacheRefresh = false);
9+
IdentityToken GetTokenInfo(CloudIdentity identity = null, bool forceCacheRefresh = false);
1010

11-
Role[] GetRolesByUser(CloudIdentity identity, string userId);
11+
Role[] GetRolesByUser(string userId, CloudIdentity identity = null);
1212

13-
User[] ListUsers(CloudIdentity identity);
14-
User GetUserByName(CloudIdentity identity, string name);
15-
User GetUser(CloudIdentity identity, string id);
16-
NewUser AddUser(CloudIdentity identity, NewUser user);
17-
User UpdateUser(CloudIdentity identity, User user);
18-
bool DeleteUser(CloudIdentity identity, string userId);
13+
User[] ListUsers(CloudIdentity identity = null);
14+
User GetUserByName(string name, CloudIdentity identity = null);
15+
User GetUser(string id, CloudIdentity identity = null);
16+
NewUser AddUser(NewUser user, CloudIdentity identity = null);
17+
User UpdateUser(User user, CloudIdentity identity = null);
18+
bool DeleteUser(string userId, CloudIdentity identity = null);
1919

20-
UserCredential[] ListUserCredentials(CloudIdentity identity, string userId);
20+
UserCredential[] ListUserCredentials(string userId, CloudIdentity identity = null);
2121

22-
Tenant[] ListTenants(CloudIdentity identity);
23-
UserAccess GetUserAccess(CloudIdentity identity, bool forceCacheRefresh = false);
24-
UserCredential GetUserCredential(CloudIdentity identity, string userId, string credentialKey);
22+
Tenant[] ListTenants(CloudIdentity identity = null);
23+
UserAccess GetUserAccess(CloudIdentity identity = null, bool forceCacheRefresh = false);
24+
UserCredential GetUserCredential(string userId, string credentialKey, CloudIdentity identity = null);
2525
}
2626
}

src/corelib/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.0.0.0")]
35+
[assembly: AssemblyVersion("1.0.3.0")]
36+
[assembly: AssemblyFileVersion("1.0.3.0")]
3737

3838
[assembly: InternalsVisibleTo("OpenStackNet.Testing.Integration")]
3939
[assembly: InternalsVisibleTo("OpenStackNet.Testing.Unit")]

0 commit comments

Comments
 (0)