Skip to content

Commit 7712191

Browse files
committed
Release 0.5.1.10
1 parent f01a332 commit 7712191

31 files changed

+332
-107
lines changed

.nuget/packages.config

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="FAKE" version="3.17.0" />
4+
</packages>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Elastacloud.AzureManagement.Fluent/Clients/ImageManagementClient.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using Elastacloud.AzureManagement.Fluent.Clients.Helpers;
1717
using Elastacloud.AzureManagement.Fluent.Clients.Interfaces;
1818
using Elastacloud.AzureManagement.Fluent.Commands.VirtualMachines;
19+
using Elastacloud.AzureManagement.Fluent.Helpers;
1920
using Elastacloud.AzureManagement.Fluent.Types.VirtualMachines;
2021
using Microsoft.WindowsAzure;
2122
using Microsoft.WindowsAzure.Storage;
@@ -29,16 +30,19 @@ namespace Elastacloud.AzureManagement.Fluent.Clients
2930
/// </summary>
3031
public class ImageManagementClient : GenerateEventClientBase, IImageManagementClient
3132
{
32-
public ImageManagementClient(string subscriptionId, X509Certificate2 certificate)
33+
public ImageManagementClient(string subscriptionId, X509Certificate2 certificate, string defaultLocation = LocationConstants.NorthEurope)
3334
{
3435
SubscriptionId = subscriptionId;
3536
ManagementCertificate = certificate;
37+
Location = defaultLocation;
3638
}
3739

3840
public X509Certificate2 ManagementCertificate { get; set; }
3941

4042
public string SubscriptionId { get; set; }
4143

44+
public string Location { get; set; }
45+
4246
/// <summary>
4347
/// Used to copy or register an image from one subscription to another
4448
/// </summary>
@@ -110,7 +114,8 @@ public void CopyAndRegisterImageInNewSubscription(ImageProperties imagePropertie
110114
var registerImageCommand = new RegisterImageCommand(imageProperties)
111115
{
112116
SubscriptionId = SubscriptionId,
113-
Certificate = ManagementCertificate
117+
Certificate = ManagementCertificate,
118+
Location = Location
114119
};
115120
registerImageCommand.Execute();
116121
RaiseClientUpdate(100, "Completed registration of image into target account");
@@ -126,7 +131,8 @@ public List<ImageProperties> ImageList
126131
var listImagesCommand = new ListImagesCommand()
127132
{
128133
SubscriptionId = SubscriptionId,
129-
Certificate = ManagementCertificate
134+
Certificate = ManagementCertificate,
135+
Location = Location
130136
};
131137
listImagesCommand.Execute();
132138
return listImagesCommand.Properties;

Elastacloud.AzureManagement.Fluent/Clients/LinuxVirtualMachineClient.cs

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,29 @@ public class LinuxVirtualMachineClient : ILinuxVirtualMachineClient
4040
/// </summary>
4141
/// <param name="subscriptionId">the subscription id </param>
4242
/// <param name="certificate">A management certificate for the subscription</param>
43-
public LinuxVirtualMachineClient(string subscriptionId, X509Certificate2 certificate)
43+
/// <param name="defaultLocation">The location to which service management request is sent to</param>
44+
public LinuxVirtualMachineClient(string subscriptionId, X509Certificate2 certificate, string defaultLocation = LocationConstants.NorthEurope)
4445
{
4546
SubscriptionId = subscriptionId;
4647
ManagementCertificate = certificate;
48+
Location = defaultLocation;
4749
}
50+
/// <summary>
51+
/// The default location that the service management api is being called from
52+
/// </summary>
53+
public string Location { get; set; }
4854

4955
/// <summary>
5056
/// Constructs a VirtualMachinenClient
5157
/// </summary>
5258
/// <param name="properties">A valid VirtualMachineProperties object</param>
5359
/// <param name="subscriptionId">The susbcription id for the subscription</param>
5460
/// <param name="certificate">The susbcription id for the subscription</param>
55-
public LinuxVirtualMachineClient(List<LinuxVirtualMachineProperties> properties, string subscriptionId, X509Certificate2 certificate)
61+
public LinuxVirtualMachineClient(List<LinuxVirtualMachineProperties> properties, string subscriptionId, X509Certificate2 certificate, string defaultLocation = LocationConstants.NorthEurope)
5662
: this(subscriptionId, certificate)
5763
{
5864
Properties = properties;
65+
Location = defaultLocation;
5966
}
6067

6168
/// <summary>
@@ -81,7 +88,8 @@ public List<PersistentVMRole> VirtualMachine
8188
var command = new GetVirtualMachineContextCommand(Properties.First())
8289
{
8390
SubscriptionId = SubscriptionId,
84-
Certificate = ManagementCertificate
91+
Certificate = ManagementCertificate,
92+
Location = Location
8593
};
8694
command.Execute();
8795
return (_vmRoles = command.PersistentVm.ToList());
@@ -102,7 +110,8 @@ private void CheckVmDeploymentIsRunning(List<LinuxVirtualMachineProperties> prop
102110
var command = new GetVirtualMachineContextCommand(vmProperties)
103111
{
104112
SubscriptionId = SubscriptionId,
105-
Certificate = ManagementCertificate
113+
Certificate = ManagementCertificate,
114+
Location = Location
106115
};
107116
command.Execute();
108117
command.PersistentVm.ForEach(vm =>
@@ -148,7 +157,8 @@ public IVirtualMachineClient CreateNewVirtualMachineDeploymentFromTemplateGaller
148157
var checkCloudServiceAvailabilityCommand = new CheckCloudServiceNameAvailableCommand(cloudServiceName)
149158
{
150159
SubscriptionId = SubscriptionId,
151-
Certificate = ManagementCertificate
160+
Certificate = ManagementCertificate,
161+
Location = Location
152162
};
153163
checkCloudServiceAvailabilityCommand.Execute();
154164
Trace.WriteLine(String.Format("Checked cloud service availability - is available: {0}", checkCloudServiceAvailabilityCommand.CloudServiceAvailable));
@@ -158,7 +168,8 @@ public IVirtualMachineClient CreateNewVirtualMachineDeploymentFromTemplateGaller
158168
var cloudServiceCommand = new CreateCloudServiceCommand(cloudServiceName, "Created by Fluent Management", location, affinityGroup)
159169
{
160170
SubscriptionId = SubscriptionId,
161-
Certificate = ManagementCertificate
171+
Certificate = ManagementCertificate,
172+
Location = Location
162173
};
163174
cloudServiceCommand.Execute();
164175
Trace.WriteLine(String.Format("Cloud service named {0} has been created", cloudServiceName));
@@ -173,10 +184,11 @@ public IVirtualMachineClient CreateNewVirtualMachineDeploymentFromTemplateGaller
173184

174185
// This is really unfortunate and not documented anywhere - unable to add multiple roles to a rolelist!!!
175186
// continue to the create the virtual machine in the cloud service
176-
var command = new CreateLinuxVirtualMachineDeploymentCommand(new List<LinuxVirtualMachineProperties>(new[]{properties[0]}), cloudServiceName)
187+
var command = new CreateLinuxVirtualMachineDeploymentCommand(new List<LinuxVirtualMachineProperties>(new[]{properties[0]}), cloudServiceName, Location)
177188
{
178189
SubscriptionId = SubscriptionId,
179-
Certificate = ManagementCertificate
190+
Certificate = ManagementCertificate,
191+
Location = Location
180192
};
181193
command.Execute();
182194
// raise this event every time we create a VM
@@ -196,7 +208,8 @@ public IVirtualMachineClient CreateNewVirtualMachineDeploymentFromTemplateGaller
196208
var startCommand = new AddLinuxVirtualMachineToDeploymentCommand(theProperty, cloudServiceName)
197209
{
198210
SubscriptionId = SubscriptionId,
199-
Certificate = ManagementCertificate
211+
Certificate = ManagementCertificate,
212+
Location = Location
200213
};
201214
startCommand.Execute();
202215
// raise this event every time we create a VM

Elastacloud.AzureManagement.Fluent/Clients/ServiceBusClient.cs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,16 @@ public class ServiceBusClient : IServiceBusClient
2626
private readonly string _subscriptionId;
2727
private readonly X509Certificate2 _managementCertificate;
2828

29-
public ServiceBusClient(string subscriptionId, X509Certificate2 certificate)
29+
public ServiceBusClient(string subscriptionId, X509Certificate2 certificate, string defaultLocation = LocationConstants.NorthEurope)
3030
{
3131
_subscriptionId = subscriptionId;
3232
_managementCertificate = certificate;
33+
Location = defaultLocation;
3334
}
3435

3536
#region Implementation of IServiceBusClient
3637

38+
public string Location { get; set; }
3739
/// <summary>
3840
/// Creates a namespace given a name value
3941
/// </summary>
@@ -50,7 +52,8 @@ public void CreateNamespace(string name, string location = LocationConstants.Nor
5052
var command = new CreateServiceBusNamespaceCommand(name, location)
5153
{
5254
SubscriptionId = _subscriptionId,
53-
Certificate = _managementCertificate
55+
Certificate = _managementCertificate,
56+
Location = Location
5457
};
5558
command.Execute();
5659
Namespace = name;
@@ -64,7 +67,8 @@ public bool CheckNamespaceExists(string name)
6467
var command = new CheckServiceBusNamespaceAvailabilityCommand(name)
6568
{
6669
SubscriptionId = _subscriptionId,
67-
Certificate = _managementCertificate
70+
Certificate = _managementCertificate,
71+
Location = Location
6872
};
6973
command.Execute();
7074
return command.IsAvailable;
@@ -78,7 +82,8 @@ public void DeleteNamespace(string name)
7882
var command = new DeleteServiceBusNamespaceCommand(name)
7983
{
8084
SubscriptionId = _subscriptionId,
81-
Certificate = _managementCertificate
85+
Certificate = _managementCertificate,
86+
Location = Location
8287
};
8388
command.Execute();
8489
}
@@ -91,7 +96,8 @@ public IEnumerable<string> GetServiceBusNamspaceList(string location)
9196
var command = new GetServiceBusNamespaceListCommand(location)
9297
{
9398
SubscriptionId = _subscriptionId,
94-
Certificate = _managementCertificate
99+
Certificate = _managementCertificate,
100+
Location = Location
95101
};
96102
command.Execute();
97103
return command.Namespaces;
@@ -105,7 +111,8 @@ public string GetServiceBusConnectionString(string @namespace, string ruleName)
105111
var command = new GetServiceBusPolicyConnectionStringCommand(@namespace, ruleName)
106112
{
107113
SubscriptionId = _subscriptionId,
108-
Certificate = _managementCertificate
114+
Certificate = _managementCertificate,
115+
Location = Location
109116
};
110117
command.Execute();
111118
if (command.ConnectionString == null)

0 commit comments

Comments
 (0)