Skip to content

Commit aaf4888

Browse files
brooklyngwvvvarunv
authored andcommitted
Added new Set-AzureDedicatedCircuitProperties commandlet and removed Set-AzureDedicatedCircuitBandwidth
1 parent c3ca4c3 commit aaf4888

File tree

7 files changed

+35
-20
lines changed

7 files changed

+35
-20
lines changed

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/Commands.ExpressRoute.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,8 @@
8181
<SpecificVersion>False</SpecificVersion>
8282
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.4.1.1\lib\net40\Microsoft.WindowsAzure.Management.dll</HintPath>
8383
</Reference>
84-
<Reference Include="Microsoft.WindowsAzure.Management.ExpressRoute, Version=0.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
85-
<SpecificVersion>False</SpecificVersion>
86-
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.ExpressRoute.0.18.2-preview\lib\net40\Microsoft.WindowsAzure.Management.ExpressRoute.dll</HintPath>
84+
<Reference Include="Microsoft.WindowsAzure.Management.ExpressRoute">
85+
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.ExpressRoute.0.18.3-preview\lib\net40\Microsoft.WindowsAzure.Management.ExpressRoute.dll</HintPath>
8786
</Reference>
8887
<Reference Include="Newtonsoft.Json">
8988
<HintPath>..\..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
@@ -135,7 +134,7 @@
135134
<Compile Include="DedicatedCircuits\GetAzureDedicatedCircuit.cs" />
136135
<Compile Include="DedicatedCircuits\NewAzureDedicatedCircuit.cs" />
137136
<Compile Include="DedicatedCircuits\RemoveAzureDedicatedCircuit.cs" />
138-
<Compile Include="DedicatedCircuitBandwidths\SetAzureDedicatedCircuitBandwidth.cs" />
137+
<Compile Include="DedicatedCircuitProperties\SetAzureDedicatedCircuitProperties.cs" />
139138
<Compile Include="ExpressRouteBaseCmdlet.cs" />
140139
<Compile Include="ExpressRouteClient.cs" />
141140
<Compile Include="Properties\AssemblyInfo.cs" />
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,20 @@ namespace Microsoft.WindowsAzure.Commands.ExpressRoute
2020
{
2121
using Management.ExpressRoute.Models;
2222

23-
[Cmdlet(VerbsCommon.Set, "AzureDedicatedCircuitBandwidth"), OutputType(typeof(AzureDedicatedCircuit))]
24-
public class SetAzureDedicatedCircuitBandwidthCommand : ExpressRouteBaseCmdlet
23+
[Cmdlet(VerbsCommon.Set, "AzureDedicatedCircuitProperties"), OutputType(typeof(AzureDedicatedCircuit))]
24+
public class SetAzureDedicatedCircuitPropertiesCommand : ExpressRouteBaseCmdlet
2525
{
2626
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true,
2727
HelpMessage = "Service Key of Azure Dedicated Circuit to be removed")]
2828
[ValidateGuid]
2929
[ValidateNotNullOrEmpty]
3030
public string ServiceKey { get; set; }
3131

32-
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Circuit Bandwidth")]
33-
[ValidateNotNullOrEmpty]
34-
public UInt32 Bandwidth { get; set; }
32+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Circuit Bandwidth")]
33+
public UInt32? Bandwidth { get; set; }
34+
35+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Circuit Sku")]
36+
public CircuitSku? Sku { get; set; }
3537

3638
[Parameter(HelpMessage = "Do not confirm Azure Dedicated Circuit Update")]
3739
public SwitchParameter Force { get; set; }
@@ -45,7 +47,7 @@ public override void ExecuteCmdlet()
4547
ServiceKey,
4648
() =>
4749
{
48-
var circuit = ExpressRouteClient.SetAzureDedicatedCircuitBandwidth(ServiceKey, Bandwidth);
50+
var circuit = ExpressRouteClient.SetAzureDedicatedCircuitProperties(ServiceKey, Bandwidth, Sku);
4951

5052
WriteObject(circuit);
5153

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/DedicatedCircuits/NewAzureDedicatedCircuit.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ public class NewAzureDedicatedCircuitCommand : ExpressRouteBaseCmdlet
3737
[Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = "Circuit Service Provider Name")]
3838
public string ServiceProviderName { get; set; }
3939

40+
[Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = "Circuit Sku")]
41+
public CircuitSku Sku { get; set; }
42+
4043
[Parameter(HelpMessage = "Do not confirm Azure Dedicated Circuit creation")]
4144
public SwitchParameter Force { get; set; }
4245

@@ -50,7 +53,7 @@ public override void ExecuteCmdlet()
5053
() =>
5154
{
5255
var circuit = ExpressRouteClient.NewAzureDedicatedCircuit(CircuitName, Bandwidth, Location,
53-
ServiceProviderName);
56+
ServiceProviderName, Sku);
5457
WriteVerboseWithTimestamp(Resources.NewAzureDedicatedCircuitSucceeded);
5558
WriteObject(circuit);
5659
});

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/ExpressRouteClient.cs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,15 @@ public AzureDedicatedCircuit GetAzureDedicatedCircuit(string serviceKey)
115115
}
116116

117117
public AzureDedicatedCircuit NewAzureDedicatedCircuit(string circuitName,
118-
UInt32 bandwidth, string location, string serviceProviderName)
118+
UInt32 bandwidth, string location, string serviceProviderName, CircuitSku sku)
119119
{
120120
var result = Client.DedicatedCircuits.New(new DedicatedCircuitNewParameters()
121121
{
122122
Bandwidth = bandwidth,
123123
CircuitName = circuitName,
124124
Location = location,
125-
ServiceProviderName = serviceProviderName
125+
ServiceProviderName = serviceProviderName,
126+
Sku = sku
126127
});
127128

128129
if (result.HttpStatusCode.Equals(HttpStatusCode.OK))
@@ -140,12 +141,21 @@ public IEnumerable<AzureDedicatedCircuit> ListAzureDedicatedCircuit()
140141
return (Client.DedicatedCircuits.List().DedicatedCircuits);
141142
}
142143

143-
public AzureDedicatedCircuit SetAzureDedicatedCircuitBandwidth(string serviceKey, UInt32 bandwidth)
144+
public AzureDedicatedCircuit SetAzureDedicatedCircuitProperties(string serviceKey, UInt32? bandwidth, CircuitSku? sku)
144145
{
145-
var result = Client.DedicatedCircuits.Update(serviceKey, (new DedicatedCircuitUpdateParameters()
146+
var updateParams = new DedicatedCircuitUpdateParameters() {};
147+
148+
if (bandwidth.HasValue)
149+
{
150+
updateParams.Bandwidth = bandwidth.Value.ToString();
151+
}
152+
153+
if (sku.HasValue)
146154
{
147-
Bandwidth = bandwidth
148-
}));
155+
updateParams.Sku = sku.Value.ToString();
156+
}
157+
158+
var result = Client.DedicatedCircuits.Update(serviceKey, updateParams);
149159

150160
if (result.HttpStatusCode.Equals(HttpStatusCode.OK))
151161
{

src/ServiceManagement/ExpressRoute/Commands.ExpressRoute/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="2.14.201151115" targetFramework="net45" />
1212
<package id="Microsoft.Net.Http" version="2.2.28" targetFramework="net45" />
1313
<package id="Microsoft.WindowsAzure.Management" version="4.1.1" targetFramework="net45" />
14-
<package id="Microsoft.WindowsAzure.Management.ExpressRoute" version="0.18.2-preview" targetFramework="net45" />
14+
<package id="Microsoft.WindowsAzure.Management.ExpressRoute" version="0.18.3-preview" targetFramework="net45" />
1515
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
1616
</packages>

src/ServiceManagement/Services/Commands.Test/Commands.Test.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.Compute.12.1.0-preview\lib\net40\Microsoft.WindowsAzure.Management.Compute.dll</HintPath>
120120
</Reference>
121121
<Reference Include="Microsoft.WindowsAzure.Management.ExpressRoute">
122-
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.ExpressRoute.0.18.2-preview\lib\net40\Microsoft.WindowsAzure.Management.ExpressRoute.dll</HintPath>
122+
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.ExpressRoute.0.18.3-preview\lib\net40\Microsoft.WindowsAzure.Management.ExpressRoute.dll</HintPath>
123123
</Reference>
124124
<Reference Include="Microsoft.WindowsAzure.Management.MediaServices">
125125
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.Management.MediaServices.4.0.0\lib\net40\Microsoft.WindowsAzure.Management.MediaServices.dll</HintPath>
@@ -318,6 +318,7 @@
318318
<SubType>Designer</SubType>
319319
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
320320
</Content>
321+
<None Include="app.config" />
321322
<None Include="MSSharedLibKey.snk" />
322323
<Content Include="Resources\MyWebTemplateFolder\web.cloud.config">
323324
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

src/ServiceManagement/Services/Commands.Test/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.3" targetFramework="net45" />
1919
<package id="Microsoft.WindowsAzure.Management" version="4.1.1" targetFramework="net45" />
2020
<package id="Microsoft.WindowsAzure.Management.Compute" version="12.1.0-preview" targetFramework="net45" />
21-
<package id="Microsoft.WindowsAzure.Management.ExpressRoute" version="0.18.2-preview" targetFramework="net45" />
21+
<package id="Microsoft.WindowsAzure.Management.ExpressRoute" version="0.18.3-preview" targetFramework="net45" />
2222
<package id="Microsoft.WindowsAzure.Management.MediaServices" version="4.0.0" targetFramework="net45" />
2323
<package id="Microsoft.WindowsAzure.Management.ServiceBus" version="0.17.0-preview" targetFramework="net45" />
2424
<package id="Microsoft.WindowsAzure.Management.Storage" version="5.1.1" targetFramework="net45" />

0 commit comments

Comments
 (0)