-
Notifications
You must be signed in to change notification settings - Fork 4k
[Express Route] IPv6 Global Reach Add/Set-AzExpressRouteCircuitConnection cmdlet changes. #11501
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
Changes from all commits
a2e5b40
d134367
b7764a2
4ff451d
08e95c2
1c59066
f95cfa3
cab5b86
66c524d
358ae7e
d217e8c
968ada9
5096219
ab9ba16
5eaa0d9
05539ab
887cf7f
3b4144e
1edcb5b
6d0cedb
115ff18
8717034
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -769,6 +769,7 @@ private static void Initialize() | |
cfg.CreateMap<CNM.PSPeering, MNM.ExpressRouteCircuitPeering>(); | ||
cfg.CreateMap<CNM.PSExpressRouteCircuitAuthorization, MNM.ExpressRouteCircuitAuthorization>(); | ||
cfg.CreateMap<CNM.PSExpressRouteCircuitConnection, MNM.ExpressRouteCircuitConnection>(); | ||
cfg.CreateMap<CNM.PSExpressRouteCircuitConnectionIPv6ConnectionConfig, MNM.Ipv6CircuitConnectionConfig>(); | ||
|
||
// MNM to CNM | ||
cfg.CreateMap<MNM.ExpressRouteCircuit, CNM.PSExpressRouteCircuit>(); | ||
|
@@ -781,6 +782,7 @@ private static void Initialize() | |
cfg.CreateMap<CNM.PSExpressRouteCircuitRoutesTable, MNM.ExpressRouteCircuitRoutesTable>(); | ||
cfg.CreateMap<CNM.PSExpressRouteCircuitRoutesTableSummary, MNM.ExpressRouteCircuitRoutesTableSummary>(); | ||
cfg.CreateMap<MNM.ExpressRouteCircuitConnection, CNM.PSExpressRouteCircuitConnection>(); | ||
cfg.CreateMap<MNM.Ipv6CircuitConnectionConfig, CNM.PSExpressRouteCircuitConnectionIPv6ConnectionConfig>(); | ||
|
||
// ExpressRouteCircuitPeering | ||
// CNM to MNM | ||
|
@@ -796,10 +798,10 @@ private static void Initialize() | |
// Express Route Circuit Connection | ||
// CNM to MNM | ||
cfg.CreateMap<CNM.PSExpressRouteCircuitConnection, MNM.ExpressRouteCircuitConnection>(); | ||
|
||
// MNM to CNM | ||
cfg.CreateMap<MNM.ExpressRouteCircuitConnection, CNM.PSExpressRouteCircuitConnection>(); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove redundant spaces There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
// Peer Express Route Circuit Connection | ||
// CNM to MNM | ||
cfg.CreateMap<CNM.PSPeerExpressRouteCircuitConnection, MNM.PeerExpressRouteCircuitConnection>(); | ||
|
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() | ||
} | ||
} |
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; } | ||
|
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove redundant spaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done