From 4acb28c9d696cb962042ff8c1aafbcaf74730574 Mon Sep 17 00:00:00 2001 From: Farhan Syed Date: Tue, 31 Jul 2018 15:22:40 -0700 Subject: [PATCH 1/4] add global reach flag in express route circuit --- .../NewAzureExpressRouteCircuitCommand.cs | 6 ++++++ ...crosoft.Azure.Commands.Network.format.ps1xml | 4 ++++ .../Models/PSExpressRouteCircuit.cs | 2 ++ .../help/New-AzureRmExpressRouteCircuit.md | 17 ++++++++++++++++- ...crosoft.Azure.Commands.Network.format.ps1xml | 4 ++++ 5 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/ResourceManager/Network/Commands.Network/ExpressRouteCircuit/NewAzureExpressRouteCircuitCommand.cs b/src/ResourceManager/Network/Commands.Network/ExpressRouteCircuit/NewAzureExpressRouteCircuitCommand.cs index 1921be352bda..0ac25752d898 100644 --- a/src/ResourceManager/Network/Commands.Network/ExpressRouteCircuit/NewAzureExpressRouteCircuitCommand.cs +++ b/src/ResourceManager/Network/Commands.Network/ExpressRouteCircuit/NewAzureExpressRouteCircuitCommand.cs @@ -103,6 +103,11 @@ public class NewAzureExpressRouteCircuitCommand : ExpressRouteCircuitBaseCmdlet [ValidateNotNullOrEmpty] public bool? AllowClassicOperations { get; set; } + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true)] + [ValidateNotNullOrEmpty] + public bool AllowGlobalReach { get; set; } [Parameter( Mandatory = false, @@ -165,6 +170,7 @@ private PSExpressRouteCircuit CreateExpressRouteCircuit() circuit.Peerings = this.Peering; circuit.Authorizations = this.Authorization; circuit.AllowClassicOperations = this.AllowClassicOperations; + circuit.AllowGlobalReach = this.AllowGlobalReach; // Map to the sdk object var circuitModel = NetworkResourceManagerProfile.Mapper.Map(circuit); diff --git a/src/ResourceManager/Network/Commands.Network/Microsoft.Azure.Commands.Network.format.ps1xml b/src/ResourceManager/Network/Commands.Network/Microsoft.Azure.Commands.Network.format.ps1xml index 259e8650b83f..a678606fb57d 100644 --- a/src/ResourceManager/Network/Commands.Network/Microsoft.Azure.Commands.Network.format.ps1xml +++ b/src/ResourceManager/Network/Commands.Network/Microsoft.Azure.Commands.Network.format.ps1xml @@ -2216,6 +2216,10 @@ GatewayManagerEtag + + + AllowGlobalReach + diff --git a/src/ResourceManager/Network/Commands.Network/Models/PSExpressRouteCircuit.cs b/src/ResourceManager/Network/Commands.Network/Models/PSExpressRouteCircuit.cs index 19b9d52f073f..3d0f6a298a1b 100644 --- a/src/ResourceManager/Network/Commands.Network/Models/PSExpressRouteCircuit.cs +++ b/src/ResourceManager/Network/Commands.Network/Models/PSExpressRouteCircuit.cs @@ -41,6 +41,8 @@ public class PSExpressRouteCircuit : PSTopLevelResource public string GatewayManagerEtag { get; set; } + public bool AllowGlobalReach { get; set; } + [JsonIgnore] public string SkuText { diff --git a/src/ResourceManager/Network/Commands.Network/help/New-AzureRmExpressRouteCircuit.md b/src/ResourceManager/Network/Commands.Network/help/New-AzureRmExpressRouteCircuit.md index 80280cce1329..b3ada5787769 100644 --- a/src/ResourceManager/Network/Commands.Network/help/New-AzureRmExpressRouteCircuit.md +++ b/src/ResourceManager/Network/Commands.Network/help/New-AzureRmExpressRouteCircuit.md @@ -19,7 +19,7 @@ New-AzureRmExpressRouteCircuit -Name -ResourceGroupName -Locat -BandwidthInMbps [-Peering ] [-Authorization ] - [-AllowClassicOperations ] [-Tag ] [-Force] [-AsJob] + [-AllowClassicOperations ] [-AllowGlobalReach ] [-Tag ] [-Force] [-AsJob] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -45,6 +45,21 @@ New-AzureRmExpressRouteCircuit @parameters ## PARAMETERS +### -AllowGlobalReach +The use of this parameter allows you to enable Global Reach on the circuit. + +```yaml +Type: System.Boolean +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -AllowClassicOperations The use of this parameter allows you to use the classic Azure PowerShell cmdlets to manage the circuit. diff --git a/src/ResourceManager/Network/Stack/Commands.Network/Microsoft.Azure.Commands.Network.format.ps1xml b/src/ResourceManager/Network/Stack/Commands.Network/Microsoft.Azure.Commands.Network.format.ps1xml index 51516af208d1..48e018236d9c 100644 --- a/src/ResourceManager/Network/Stack/Commands.Network/Microsoft.Azure.Commands.Network.format.ps1xml +++ b/src/ResourceManager/Network/Stack/Commands.Network/Microsoft.Azure.Commands.Network.format.ps1xml @@ -2006,6 +2006,10 @@ GatewayManagerEtag + + + AllowGlobalReach + From 8ca0c13d44c2e7bcb44c146613a2a55184376706 Mon Sep 17 00:00:00 2001 From: Farhan Syed Date: Thu, 2 Aug 2018 23:03:21 -0700 Subject: [PATCH 2/4] updated change log --- src/ResourceManager/Network/Commands.Network/ChangeLog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ResourceManager/Network/Commands.Network/ChangeLog.md b/src/ResourceManager/Network/Commands.Network/ChangeLog.md index 39b2e781acc9..9e7d23cb130e 100644 --- a/src/ResourceManager/Network/Commands.Network/ChangeLog.md +++ b/src/ResourceManager/Network/Commands.Network/ChangeLog.md @@ -21,6 +21,7 @@ ## Current Release * Added example for Set-AzureRmLocalNetworkGateway * Added examples and descriptions for Add-AzureRmVirtualNetworkGatewayIpConfig, Get-AzureRmVirtualNetworkGatewayConnectionSharedKey and New-AzureRmVirtualNetworkGatewayConnection +* Added AllowGlobalReach flag in New-AzureExpressRouteCircuit to enable/disable Global reach feature ## Version 6.4.1 * Updated all help files to include full parameter types and correct input/output types. From da0fa8e0847cfb734d9fc9c64d493e31a8969ed6 Mon Sep 17 00:00:00 2001 From: Farhan Syed Date: Mon, 6 Aug 2018 13:48:34 -0700 Subject: [PATCH 3/4] changed bool to switchparameter and updated a test --- .../ScenarioTests/ExpressRouteCircuitTests.ps1 | 3 ++- .../ExpressRouteCircuit/NewAzureExpressRouteCircuitCommand.cs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ResourceManager/Network/Commands.Network.Test/ScenarioTests/ExpressRouteCircuitTests.ps1 b/src/ResourceManager/Network/Commands.Network.Test/ScenarioTests/ExpressRouteCircuitTests.ps1 index 0314c6c9a9b8..74155b819eee 100644 --- a/src/ResourceManager/Network/Commands.Network.Test/ScenarioTests/ExpressRouteCircuitTests.ps1 +++ b/src/ResourceManager/Network/Commands.Network.Test/ScenarioTests/ExpressRouteCircuitTests.ps1 @@ -154,7 +154,7 @@ function Test-ExpressRouteCircuitCRUD $resourceGroup = New-AzureRmResourceGroup -Name $rgname -Location $rglocation # Create the ExpressRouteCircuit - $circuit = New-AzureRmExpressRouteCircuit -Name $circuitName -Location $location -ResourceGroupName $rgname -SkuTier Standard -SkuFamily MeteredData -ServiceProviderName "equinix" -PeeringLocation "Silicon Valley" -BandwidthInMbps 500; + $circuit = New-AzureRmExpressRouteCircuit -Name $circuitName -Location $location -ResourceGroupName $rgname -SkuTier Standard -SkuFamily MeteredData -ServiceProviderName "equinix" -PeeringLocation "Silicon Valley" -BandwidthInMbps 500 -AllowGlobalReach; # get Circuit $getCircuit = Get-AzureRmExpressRouteCircuit -Name $circuitName -ResourceGroupName $rgname @@ -171,6 +171,7 @@ function Test-ExpressRouteCircuitCRUD Assert-AreEqual "equinix" $getCircuit.ServiceProviderProperties.ServiceProviderName Assert-AreEqual "Silicon Valley" $getCircuit.ServiceProviderProperties.PeeringLocation Assert-AreEqual "500" $getCircuit.ServiceProviderProperties.BandwidthInMbps + Assert-AreEqual $True $getCircuit.AllowGlobalReach # list $list = Get-AzureRmExpressRouteCircuit -ResourceGroupName $rgname diff --git a/src/ResourceManager/Network/Commands.Network/ExpressRouteCircuit/NewAzureExpressRouteCircuitCommand.cs b/src/ResourceManager/Network/Commands.Network/ExpressRouteCircuit/NewAzureExpressRouteCircuitCommand.cs index 0ac25752d898..6d53ca5d226e 100644 --- a/src/ResourceManager/Network/Commands.Network/ExpressRouteCircuit/NewAzureExpressRouteCircuitCommand.cs +++ b/src/ResourceManager/Network/Commands.Network/ExpressRouteCircuit/NewAzureExpressRouteCircuitCommand.cs @@ -107,7 +107,7 @@ public class NewAzureExpressRouteCircuitCommand : ExpressRouteCircuitBaseCmdlet Mandatory = false, ValueFromPipelineByPropertyName = true)] [ValidateNotNullOrEmpty] - public bool AllowGlobalReach { get; set; } + public SwitchParameter AllowGlobalReach { get; set; } [Parameter( Mandatory = false, @@ -170,7 +170,7 @@ private PSExpressRouteCircuit CreateExpressRouteCircuit() circuit.Peerings = this.Peering; circuit.Authorizations = this.Authorization; circuit.AllowClassicOperations = this.AllowClassicOperations; - circuit.AllowGlobalReach = this.AllowGlobalReach; + circuit.AllowGlobalReach = this.AllowGlobalReach.IsPresent; // Map to the sdk object var circuitModel = NetworkResourceManagerProfile.Mapper.Map(circuit); From d2d3a26a442d061a2def2eb88b43335864463239 Mon Sep 17 00:00:00 2001 From: Farhan Syed Date: Thu, 16 Aug 2018 12:27:59 -0700 Subject: [PATCH 4/4] updated doc --- .../Commands.Network/help/New-AzureRmExpressRouteCircuit.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ResourceManager/Network/Commands.Network/help/New-AzureRmExpressRouteCircuit.md b/src/ResourceManager/Network/Commands.Network/help/New-AzureRmExpressRouteCircuit.md index b3ada5787769..3ba2367c2b33 100644 --- a/src/ResourceManager/Network/Commands.Network/help/New-AzureRmExpressRouteCircuit.md +++ b/src/ResourceManager/Network/Commands.Network/help/New-AzureRmExpressRouteCircuit.md @@ -49,14 +49,14 @@ New-AzureRmExpressRouteCircuit @parameters The use of this parameter allows you to enable Global Reach on the circuit. ```yaml -Type: System.Boolean +Type: System.Management.Automation.SwitchParameter Parameter Sets: (All) Aliases: Required: False Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) +Default value: False +Accept pipeline input: False Accept wildcard characters: False ```