Skip to content

Commit 0881e5d

Browse files
committed
Merge pull request #1230 from Nilambari/release-1.0.0
Networking Hybrid team minor but important PS changes
2 parents aa07ccc + a44b3aa commit 0881e5d

File tree

22 files changed

+1798
-3925
lines changed

22 files changed

+1798
-3925
lines changed

src/ResourceManager/Network/Commands.Network.Test/Commands.Network.Test.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@
6767
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.1.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
6868
</Reference>
6969
<Reference Include="Microsoft.Azure.Management.Network, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
70-
<SpecificVersion>False</SpecificVersion>
71-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.2.0.13-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
70+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.2.0.15-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
71+
<Private>True</Private>
7272
</Reference>
7373
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
7474
<SpecificVersion>False</SpecificVersion>

src/ResourceManager/Network/Commands.Network.Test/ScenarioTests/ExpressRouteCircuitTests.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function Test-ExpressRouteCircuitCRUD
3131
$resourceGroup = New-AzureRmResourceGroup -Name $rgname -Location $rglocation
3232

3333
# Create the ExpressRouteCircuit
34-
$circuit = New-AzureRmExpressRouteCircuit -Name $circuitName -Location $location -ResourceGroupName $rgname -SkuTier Standard -SkuFamily MeteredData -ServiceProviderName "equinix" -PeeringLocation "Silicon Valley" -BandwidthInMbps 1000;
34+
$circuit = New-AzureRmExpressRouteCircuit -Name $circuitName -Location $location -ResourceGroupName $rgname -SkuTier Standard -SkuFamily MeteredData -BillingType MeteredData -ServiceProviderName "equinix" -PeeringLocation "Silicon Valley" -BandwidthInMbps 1000;
3535

3636
# get Circuit
3737
$getCircuit = Get-AzureRmExpressRouteCircuit -Name $circuitName -ResourceGroupName $rgname
@@ -61,7 +61,7 @@ function Test-ExpressRouteCircuitCRUD
6161
# set
6262
$getCircuit.ServiceProviderProperties.BandwidthInMbps = 500
6363

64-
$getCircuit = $getCircuit | Set-AzureRmExpressRouteCircuit
64+
$getCircuit = Set-AzureRmExpressRouteCircuit -ExpressRouteCircuit $getCircuit -BillingType UnlimitedData
6565
Assert-AreEqual $rgName $getCircuit.ResourceGroupName
6666
Assert-AreEqual $circuitName $getCircuit.Name
6767
Assert-NotNull $getCircuit.Location
@@ -108,7 +108,7 @@ function Test-ExpressRouteCircuitPeeringCRUD
108108

109109
# Create the ExpressRouteCircuit with peering
110110
$peering = New-AzureRmExpressRouteCircuitPeeringConfig -Name AzurePrivatePeering -PeeringType AzurePrivatePeering -PeerASN 100 -PrimaryPeerAddressPrefix "192.168.1.0/30" -SecondaryPeerAddressPrefix "192.168.2.0/30" -VlanId 200
111-
$circuit = New-AzureRmExpressRouteCircuit -Name $circuitName -Location $location -ResourceGroupName $rgname -SkuTier Standard -SkuFamily MeteredData -ServiceProviderName "equinix" -PeeringLocation "Silicon Valley" -BandwidthInMbps 1000 -Peering $peering
111+
$circuit = New-AzureRmExpressRouteCircuit -Name $circuitName -Location $location -ResourceGroupName $rgname -SkuTier Standard -SkuFamily MeteredData -BillingType UnlimitedData -ServiceProviderName "equinix" -PeeringLocation "Silicon Valley" -BandwidthInMbps 1000 -Peering $peering
112112

113113
#verification
114114
Assert-AreEqual $rgName $circuit.ResourceGroupName
@@ -146,7 +146,7 @@ function Test-ExpressRouteCircuitPeeringCRUD
146146
Assert-AreEqual 1 @($listPeering).Count
147147

148148
# add a new Peering
149-
$circuit = Get-AzureRmExpressRouteCircuit -Name $circuitName -ResourceGroupName $rgname | Add-AzureRmExpressRouteCircuitPeeringConfig -Name MicrosoftPeering -PeeringType MicrosoftPeering -PeerASN 99 -PrimaryPeerAddressPrefix "192.168.1.0/30" -SecondaryPeerAddressPrefix "192.168.2.0/30" -VlanId 200 -MircosoftConfigAdvertisedPublicPrefixes @("11.2.3.4/30", "12.2.3.4/30") -MircosoftConfigCustomerAsn 1000 -MircosoftConfigRoutingRegistryName AFRINIC | Set-AzureRmExpressRouteCircuit
149+
$circuit = Get-AzureRmExpressRouteCircuit -Name $circuitName -ResourceGroupName $rgname | Add-AzureRmExpressRouteCircuitPeeringConfig -Name MicrosoftPeering -PeeringType MicrosoftPeering -PeerASN 99 -PrimaryPeerAddressPrefix "192.168.1.0/30" -SecondaryPeerAddressPrefix "192.168.2.0/30" -VlanId 200 -MircosoftConfigAdvertisedPublicPrefixes @("11.2.3.4/30", "12.2.3.4/30") -MircosoftConfigCustomerAsn 1000 -MircosoftConfigRoutingRegistryName AFRINIC | Set-AzureRmExpressRouteCircuit -BillingType UnlimitedData
150150

151151
$p = $circuit | Get-AzureRmExpressRouteCircuitPeeringConfig -Name MicrosoftPeering
152152
Assert-AreEqual "MicrosoftPeering" $p.Name
@@ -165,7 +165,7 @@ function Test-ExpressRouteCircuitPeeringCRUD
165165
Assert-AreEqual 2 @($listPeering).Count
166166

167167
# Set a new peering
168-
$circuit = Get-AzureRmExpressRouteCircuit -Name $circuitName -ResourceGroupName $rgname | Set-AzureRmExpressRouteCircuitPeeringConfig -Name MicrosoftPeering -PeeringType MicrosoftPeering -PeerASN 100 -PrimaryPeerAddressPrefix "192.168.1.0/30" -SecondaryPeerAddressPrefix "192.168.2.0/30" -VlanId 200 -MircosoftConfigAdvertisedPublicPrefixes @("11.2.3.4/30", "12.2.3.4/30") -MircosoftConfigCustomerAsn 1000 -MircosoftConfigRoutingRegistryName AFRINIC | Set-AzureRmExpressRouteCircuit
168+
$circuit = Get-AzureRmExpressRouteCircuit -Name $circuitName -ResourceGroupName $rgname | Set-AzureRmExpressRouteCircuitPeeringConfig -Name MicrosoftPeering -PeeringType MicrosoftPeering -PeerASN 100 -PrimaryPeerAddressPrefix "192.168.1.0/30" -SecondaryPeerAddressPrefix "192.168.2.0/30" -VlanId 200 -MircosoftConfigAdvertisedPublicPrefixes @("11.2.3.4/30", "12.2.3.4/30") -MircosoftConfigCustomerAsn 1000 -MircosoftConfigRoutingRegistryName AFRINIC | Set-AzureRmExpressRouteCircuit -BillingType UnlimitedData
169169
$p = $circuit | Get-AzureRmExpressRouteCircuitPeeringConfig -Name MicrosoftPeering
170170
Assert-AreEqual "MicrosoftPeering" $p.Name
171171
Assert-AreEqual "MicrosoftPeering" $p.PeeringType

src/ResourceManager/Network/Commands.Network.Test/SessionRecords/Commands.Network.Test.ScenarioTests.ExpressRouteCircuitTests/TestExpressRouteCircuitCRUD.json

Lines changed: 244 additions & 359 deletions
Large diffs are not rendered by default.

src/ResourceManager/Network/Commands.Network.Test/SessionRecords/Commands.Network.Test.ScenarioTests.ExpressRouteCircuitTests/TestExpressRouteCircuitPeeringCRUD.json

Lines changed: 328 additions & 988 deletions
Large diffs are not rendered by default.

src/ResourceManager/Network/Commands.Network.Test/SessionRecords/Commands.Network.Test.ScenarioTests.VirtualNetworkGatewayTests/TestVirtualNetworkGatewayCRUD.json

Lines changed: 984 additions & 2533 deletions
Large diffs are not rendered by default.

src/ResourceManager/Network/Commands.Network.Test/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<package id="Microsoft.Azure.Gallery" version="2.6.2-preview" targetFramework="net45" />
88
<package id="Microsoft.Azure.Graph.RBAC" version="1.7.0-preview" targetFramework="net45" />
99
<package id="Microsoft.Azure.Management.Authorization" version="1.0.0" targetFramework="net45" />
10-
<package id="Microsoft.Azure.Management.Network" version="2.0.13-preview" targetFramework="net45" />
10+
<package id="Microsoft.Azure.Management.Network" version="2.0.15-preview" targetFramework="net45" />
1111
<package id="Microsoft.Azure.Management.Resources" version="2.18.7-preview" targetFramework="net45" />
1212
<package id="Microsoft.Azure.Test.Framework" version="1.0.5774.40163-prerelease" targetFramework="net45" />
1313
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.0.5774.40163-prerelease" targetFramework="net45" />

src/ResourceManager/Network/Commands.Network/Commands.Network.csproj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@
7777
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.1.0.0\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
7878
</Reference>
7979
<Reference Include="Microsoft.Azure.Management.Network, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
80-
<SpecificVersion>False</SpecificVersion>
81-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.2.0.13-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
80+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Network.2.0.15-preview\lib\net40\Microsoft.Azure.Management.Network.dll</HintPath>
81+
<Private>True</Private>
8282
</Reference>
8383
<Reference Include="Microsoft.Azure.ResourceManager, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
8484
<SpecificVersion>False</SpecificVersion>
@@ -297,6 +297,8 @@
297297
<Compile Include="VirtualNetworkGateway\NewAzureVirtualNetworkGatewayIpConfigCommand.cs" />
298298
<Compile Include="VirtualNetworkGateway\RemoveAzureVirtualNetworkGatewayCommand.cs" />
299299
<Compile Include="VirtualNetworkGateway\ResetAzureVirtualNetworkGatewayCommand.cs" />
300+
<Compile Include="VirtualNetworkGateway\SetAzureVirtualNetworkGatewayDefaultSiteCommand.cs" />
301+
<Compile Include="VirtualNetworkGateway\RemoveAzureVirtualNetworkGatewayDefaultSiteCommand.cs" />
300302
<Compile Include="LocalNetworkGateway\LocalNetworkGatewayBaseCmdlet.cs" />
301303
<Compile Include="LocalNetworkGateway\RemoveAzureLocalNetworkGatewayCommand.cs" />
302304
<Compile Include="LocalNetworkGateway\GetAzureLocalNetworkGatewayCommand.cs" />

src/ResourceManager/Network/Commands.Network/ExpressRouteCircuit/NewAzureExpressRouteCircuitCommand.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,20 @@ public class NewAzureExpressRouteCircuitCommand : ExpressRouteCircuitBaseCmdlet
8484
public int BandwidthInMbps { get; set; }
8585

8686
[Parameter(
87-
Mandatory = false,
87+
Mandatory = false,
8888
ValueFromPipelineByPropertyName = true)]
8989
[ValidateNotNullOrEmpty]
9090
public List<PSPeering> Peering { get; set; }
9191

92+
[Parameter(
93+
Mandatory = true,
94+
ValueFromPipelineByPropertyName = true)]
95+
[ValidateSet(
96+
MNM.ExpressRouteCircuitBillingType.MeteredData,
97+
MNM.ExpressRouteCircuitBillingType.UnlimitedData,
98+
IgnoreCase = true)]
99+
public string BillingType { get; set; }
100+
92101
[Parameter(
93102
Mandatory = false,
94103
ValueFromPipelineByPropertyName = true,
@@ -129,7 +138,7 @@ private PSExpressRouteCircuit CreateExpressRouteCircuit()
129138
circuit.Name = this.Name;
130139
circuit.ResourceGroupName = this.ResourceGroupName;
131140
circuit.Location = this.Location;
132-
141+
133142
// Construct sku
134143
if (!string.IsNullOrEmpty(this.SkuTier))
135144
{
@@ -150,6 +159,7 @@ private PSExpressRouteCircuit CreateExpressRouteCircuit()
150159

151160
circuit.Peerings = new List<PSPeering>();
152161
circuit.Peerings = this.Peering;
162+
circuit.BillingType = this.BillingType;
153163

154164
// Map to the sdk object
155165
var circuitModel = Mapper.Map<MNM.ExpressRouteCircuit>(circuit);
@@ -160,7 +170,7 @@ private PSExpressRouteCircuit CreateExpressRouteCircuit()
160170
this.ExpressRouteCircuitClient.CreateOrUpdate(this.ResourceGroupName, this.Name, circuitModel);
161171

162172
var getExpressRouteCircuit = this.GetExpressRouteCircuit(this.ResourceGroupName, this.Name);
163-
173+
getExpressRouteCircuit.BillingType = this.BillingType;
164174
return getExpressRouteCircuit;
165175
}
166176
}

src/ResourceManager/Network/Commands.Network/ExpressRouteCircuit/SetAzureExpressRouteCircuitCommand.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ public class SetAzureExpressRouteCircuitCommand : ExpressRouteCircuitBaseCmdlet
3131
HelpMessage = "The ExpressRouteCircuit")]
3232
public PSExpressRouteCircuit ExpressRouteCircuit { get; set; }
3333

34+
[Parameter(
35+
Mandatory = true,
36+
ValueFromPipelineByPropertyName = true)]
37+
[ValidateSet(
38+
MNM.ExpressRouteCircuitBillingType.MeteredData,
39+
MNM.ExpressRouteCircuitBillingType.UnlimitedData,
40+
IgnoreCase = true)]
41+
public string BillingType { get; set; }
42+
3443
protected override void ProcessRecord()
3544
{
3645
base.ProcessRecord();
@@ -39,7 +48,8 @@ protected override void ProcessRecord()
3948
{
4049
throw new ArgumentException(Microsoft.Azure.Commands.Network.Properties.Resources.ResourceNotFound);
4150
}
42-
51+
ExpressRouteCircuit.BillingType = BillingType;
52+
4353
// Map to the sdk object
4454
var circuitModel = Mapper.Map<MNM.ExpressRouteCircuit>(this.ExpressRouteCircuit);
4555
circuitModel.Type = Microsoft.Azure.Commands.Network.Properties.Resources.ExpressRouteCircuitType;

src/ResourceManager/Network/Commands.Network/Models/PSExpressRouteCircuit.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public class PSExpressRouteCircuit : PSTopLevelResource
3434

3535
public PSExpressRouteCircuitSku Sku { get; set; }
3636

37+
public string BillingType { get; set; }
38+
3739
public string ProvisioningState { get; set; }
3840

3941
[JsonIgnore]
@@ -47,7 +49,7 @@ public string ServiceProviderPropertiesText
4749
{
4850
get { return JsonConvert.SerializeObject(ServiceProviderProperties, Formatting.Indented); }
4951
}
50-
52+
5153
[JsonIgnore]
5254
public string PeeringsText
5355
{

0 commit comments

Comments
 (0)