-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[Express Route] IPv6 Global Reach Add/Set-AzExpressRouteCircuitConnection cmdlet changes. #10912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
928258e
Added Set-Cmdlet
amwate 0a27008
Added Set/Add AzExpressRouteConnection Cmdlets
amwate be40e15
Updated with review comments.
amwate 4c36b4b
ReNamed the new parameter from PeerAddressType to AddressPrefixType.
amwate 81a30cf
Updated ChangeLog.md
amwate c9acc76
Merge branch 'master' of https://github.com/amwate/azure-powershell
amwate 339edf0
Added Set/Add AzExpressRouteConnection Cmdlets
amwate 4fe47ae
Updated with review comments.
amwate b70a598
Fixed Ipv6CircuitConnectionParameter
amwate c19e1b4
Added help files for Express Route Circuit Connection Config
amwate 72f5b24
Minor fixes
amwate 3b54e47
Fixed indentation in Add-AzExpressRouteCircuitConnectionConfig.cs and…
amwate 9e09b50
Addressed Review comments.
amwate b7e916f
Updated the help message
amwate a5ece8e
Updated the help text.
amwate 499e394
Resolved merge conflict.
amwate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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("Private Peering needs to be configured on the Express Route Circuit"); | ||
| } | ||
|
|
||
| var circuitconnection = peering.Connections.SingleOrDefault( | ||
| resource => | ||
| string.Equals(resource.Name, Name, StringComparison.CurrentCultureIgnoreCase)); | ||
|
|
||
| if (null == circuitconnection) | ||
| { | ||
| throw new ArgumentException(string.Format("Circuit Connection with Name {0} was not added to the private peering", 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.