-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Express Route] IPv6 Global Reach Add/Set-AzExpressRouteCircuitConnec…
…tion cmdlet changes. (#11501) * Updated ChangeLog.md * Added Set-Cmdlet * Added Set/Add AzExpressRouteConnection Cmdlets * Updated with review comments. * ReNamed the new parameter from PeerAddressType to AddressPrefixType. * Added Set/Add AzExpressRouteConnection Cmdlets * Updated with review comments. * Fixed Ipv6CircuitConnectionParameter * Added help files for Express Route Circuit Connection Config * Minor fixes * Fixed indentation in Add-AzExpressRouteCircuitConnectionConfig.cs and updated help text in documentation. * Addressed Review comments. * Updated the help message * Updated the help text. * a. Added test cases b. Incorporated review comments. * Added Resources.Designer.cs for Add/SetAzureExpressRouteCircuitConnectionConfigCommand * Minor updates to ChangeLog.md * Fixed indentation * Fixed online help/Set-AzExpressRouteCircuitConnectionConfig .md * Fixed test case * Fixing online help/Set-AzExpressRouteCircuitConnectionConfig .md * removed online version from the file
- Loading branch information
Showing
18 changed files
with
7,844 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
950 changes: 698 additions & 252 deletions
950
src/Network/Network.Test/ScenarioTests/ExpressRouteCircuitTests.ps1
Large diffs are not rendered by default.
Oops, something went wrong.
4,183 changes: 4,183 additions & 0 deletions
4,183
...est.ScenarioTests.ExpressRouteCircuitTests/TestExpressRouteCircuitConnectionIPv6CRUD.json
Large diffs are not rendered by default.
Oops, something went wrong.
2,435 changes: 2,435 additions & 0 deletions
2,435
...ioTests.ExpressRouteCircuitTests/TestExpressRouteCircuitConnectionIPv6PrecreatedCRUD.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
...ressRouteCircuit/Peering/Connection/SetAzureExpressRouteCircuitConnectionConfigCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
// ---------------------------------------------------------------------------------- | ||
// | ||
// Copyright Microsoft Corporation | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// ---------------------------------------------------------------------------------- | ||
|
||
using Microsoft.Azure.Commands.Network.Models; | ||
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; | ||
using System; | ||
using System.Linq; | ||
using System.Management.Automation; | ||
|
||
namespace Microsoft.Azure.Commands.Network { | ||
[CmdletOutputBreakingChange(typeof(PSExpressRouteCircuit), DeprecatedOutputProperties = new[] { "AllowGlobalReach" })] | ||
[Cmdlet("Set", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ExpressRouteCircuitConnectionConfig", DefaultParameterSetName = "SetByResource", SupportsShouldProcess = true), OutputType(typeof(PSExpressRouteCircuit))] | ||
public class SetAzureExpressRouteCircuitConnectionConfigCommand : AzureExpressRouteCircuitConnectionConfigBase | ||
{ | ||
[Parameter( | ||
Position = 0, | ||
Mandatory = true, | ||
HelpMessage = "The name of the Circuit Connection")] | ||
[ValidateNotNullOrEmpty] | ||
public override string Name { get; set; } | ||
|
||
[Parameter( | ||
Position = 1, | ||
Mandatory = true, | ||
ValueFromPipeline = true, | ||
HelpMessage = "Express Route Circuit Peering initiating connection")] | ||
[ValidateNotNullOrEmpty] | ||
public PSExpressRouteCircuit ExpressRouteCircuit { get; set; } | ||
|
||
public override void Execute() | ||
{ | ||
base.Execute(); | ||
|
||
var peering = this.ExpressRouteCircuit.Peerings.SingleOrDefault( | ||
resource => | ||
string.Equals(resource.Name, "AzurePrivatePeering", System.StringComparison.CurrentCultureIgnoreCase)); | ||
|
||
if (peering == null) | ||
{ | ||
throw new ArgumentException(Properties.Resources.ExpressRoutePrivatePeeringNotFound); | ||
} | ||
|
||
var circuitconnection = peering.Connections.SingleOrDefault( | ||
resource => | ||
string.Equals(resource.Name, Name, StringComparison.CurrentCultureIgnoreCase)); | ||
|
||
if (null == circuitconnection) | ||
{ | ||
throw new ArgumentException(string.Format(Properties.Resources.ExpressRouteCircuitConnectionNotFound, Name)); | ||
} | ||
|
||
circuitconnection.Name = this.Name; | ||
|
||
if (null != peering.Id) | ||
{ | ||
circuitconnection.ExpressRouteCircuitPeering.Id = peering.Id; | ||
} | ||
|
||
if (null != this.PeerExpressRouteCircuitPeering) | ||
{ | ||
circuitconnection.PeerExpressRouteCircuitPeering.Id = this.PeerExpressRouteCircuitPeering; | ||
} | ||
|
||
if (!string.IsNullOrWhiteSpace(this.AuthorizationKey)) | ||
{ | ||
circuitconnection.AuthorizationKey = this.AuthorizationKey; | ||
} | ||
|
||
if (this.AddressPrefix != null) | ||
{ | ||
if (this.AddressPrefixType == IPv6) | ||
{ | ||
if (circuitconnection.IPv6CircuitConnectionConfig != null) | ||
{ | ||
circuitconnection.IPv6CircuitConnectionConfig.AddressPrefix = this.AddressPrefix; | ||
} | ||
else | ||
{ | ||
var ipv6AddressPrefix = new PSExpressRouteCircuitConnectionIPv6ConnectionConfig(); | ||
ipv6AddressPrefix.AddressPrefix = this.AddressPrefix; | ||
circuitconnection.IPv6CircuitConnectionConfig = ipv6AddressPrefix; | ||
} | ||
} | ||
else | ||
{ | ||
circuitconnection.AddressPrefix = this.AddressPrefix; | ||
} | ||
} | ||
|
||
WriteObject(this.ExpressRouteCircuit); | ||
} // end of Execute() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/Network/Network/Models/PSExpressRouteCircuitConnectionIPv6ConnectionConfig.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
namespace Microsoft.Azure.Commands.Network.Models | ||
{ | ||
using Microsoft.Azure.Management.Network.Models; | ||
|
||
using Newtonsoft.Json; | ||
using WindowsAzure.Commands.Common.Attributes; | ||
|
||
public class PSExpressRouteCircuitConnectionIPv6ConnectionConfig | ||
{ | ||
[JsonProperty(Order = 1)] | ||
[Ps1Xml(Target = ViewControl.Table)] | ||
public string AddressPrefix { get; set; } | ||
|
||
[JsonProperty(Order = 1)] | ||
[Ps1Xml(Target = ViewControl.Table)] | ||
public string CircuitConnectionStatus { get; set; } | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.