From 0d18266ef496758534d03e0546138e3369c71be8 Mon Sep 17 00:00:00 2001 From: litchiyangMSFT <64560090+litchiyangMSFT@users.noreply.github.com> Date: Fri, 9 Oct 2020 00:25:01 -0700 Subject: [PATCH 1/3] Fix a output of HostedSubnet under virtual router (#13102) * Change output of virtual router * fix output of hostedsubnet --- .../Generated/Models/PSHubIpConfiguration.cs | 2 +- .../Network/Generated/Models/PSVirtualRouter.cs | 17 ++--------------- src/Network/Network/Network.format.ps1xml | 4 ++-- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/src/Network/Network/Generated/Models/PSHubIpConfiguration.cs b/src/Network/Network/Generated/Models/PSHubIpConfiguration.cs index f1a78acfda78..bf16f949a253 100644 --- a/src/Network/Network/Generated/Models/PSHubIpConfiguration.cs +++ b/src/Network/Network/Generated/Models/PSHubIpConfiguration.cs @@ -5,7 +5,7 @@ namespace Microsoft.Azure.Commands.Network.Models public partial class PSHubIpConfiguration : PSChildResource { [Ps1Xml(Target = ViewControl.Table)] - public string HostedSubnet { get; set; } + public PSSubnet Subnet { get; set; } [Ps1Xml(Target = ViewControl.Table)] public string ProvisioningState { get; set; } } diff --git a/src/Network/Network/Generated/Models/PSVirtualRouter.cs b/src/Network/Network/Generated/Models/PSVirtualRouter.cs index 0925980abd52..83d2caa1e1da 100644 --- a/src/Network/Network/Generated/Models/PSVirtualRouter.cs +++ b/src/Network/Network/Generated/Models/PSVirtualRouter.cs @@ -35,15 +35,8 @@ public PSVirtualRouter(PSVirtualHub virtualHub) this.Location = virtualHub.Location; this.ResourceGuid = virtualHub.ResourceGuid; this.Type = virtualHub.Type; - this.VirtualNetworkConnections = new List(); var ipconfig = virtualHub.IpConfigurations.FirstOrDefault(); - var virtualNetworkConnection = new PSHubIpConfiguration() - { - Name = ipconfig.Name, - HostedSubnet = ipconfig.Id, - ProvisioningState = ipconfig.ProvisioningState - }; - this.VirtualNetworkConnections.Add(virtualNetworkConnection); + this.HostedSubnet = ipconfig.Subnet.Id; this.VirtualRouterAsn = virtualHub.VirtualRouterAsn; this.VirtualRouterIps = virtualHub.VirtualRouterIps; this.ProvisioningState = virtualHub.ProvisioningState; @@ -67,7 +60,7 @@ public PSVirtualRouter(PSVirtualHub virtualHub) public List VirtualRouterIps { get; set; } [Ps1Xml(Target = ViewControl.Table)] public string ProvisioningState { get; set; } - public List VirtualNetworkConnections { get; set; } + public string HostedSubnet { get; set; } public List Peerings { get; set; } [JsonIgnore] @@ -75,11 +68,5 @@ public string PeeringsText { get { return JsonConvert.SerializeObject(Peerings, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); } } - - [JsonIgnore] - public string VirtualNetworkConnectionsText - { - get { return JsonConvert.SerializeObject(VirtualNetworkConnections, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); } - } } } \ No newline at end of file diff --git a/src/Network/Network/Network.format.ps1xml b/src/Network/Network/Network.format.ps1xml index 7b7d01d8bc8c..e004916ee57d 100644 --- a/src/Network/Network/Network.format.ps1xml +++ b/src/Network/Network/Network.format.ps1xml @@ -5409,8 +5409,8 @@ ProvisioningState - - VirtualNetworkConnectionsText + + HostedSubnet From d15aee1e80f5f96ad05637ad6fe3c561da5f7d1e Mon Sep 17 00:00:00 2001 From: Yeming Liu Date: Tue, 13 Oct 2020 10:19:55 +0800 Subject: [PATCH 2/3] suppress breaking change warning --- .../Exceptions/Az.Network/BreakingChangeIssues.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/StaticAnalysis/Exceptions/Az.Network/BreakingChangeIssues.csv b/tools/StaticAnalysis/Exceptions/Az.Network/BreakingChangeIssues.csv index 1886b5d95cb7..289a8011abee 100644 --- a/tools/StaticAnalysis/Exceptions/Az.Network/BreakingChangeIssues.csv +++ b/tools/StaticAnalysis/Exceptions/Az.Network/BreakingChangeIssues.csv @@ -585,3 +585,4 @@ "Microsoft.Azure.PowerShell.Cmdlets.Network.dll","Microsoft.Azure.Commands.Network.RemoveAzureVirtualRouterCommand","Remove-AzVirtualRouter","0","3010","The property 'HostedGateway' of type 'Microsoft.Azure.Commands.Network.Models.PSVirtualRouter' has been removed.","Add the property 'HostedGateway' back to type 'Microsoft.Azure.Commands.Network.Models.PSVirtualRouter'." "Microsoft.Azure.PowerShell.Cmdlets.Network.dll","Microsoft.Azure.Commands.Network.RemoveAzureVirtualRouterCommand","Remove-AzVirtualRouter","0","3010","The property 'HostedGatewayText' of type 'Microsoft.Azure.Commands.Network.Models.PSVirtualRouter' has been removed.","Add the property 'HostedGatewayText' back to type 'Microsoft.Azure.Commands.Network.Models.PSVirtualRouter'." "Microsoft.Azure.PowerShell.Cmdlets.Network.dll","Microsoft.Azure.Commands.Network.GetAzureRmVirtualRouterPeer","Get-AzVirtualRouterPeer","0","3010","The property 'Type' of type 'Microsoft.Azure.Commands.Network.Models.PSVirtualRouterPeer' has been removed.","Add the property 'Type' back to type 'Microsoft.Azure.Commands.Network.Models.PSVirtualRouterPeer'." +"Microsoft.Azure.PowerShell.Cmdlets.Network.dll","Microsoft.Azure.Commands.Network.NewAzureRmExpressRouteGatewayCommand","New-AzExpressRouteGateway","0","3010","The property 'HostedSubnet' of type 'Microsoft.Azure.Commands.Network.Models.PSHubIpConfiguration' has been removed.","Add the property 'HostedSubnet' back to type 'Microsoft.Azure.Commands.Network.Models.PSHubIpConfiguration'." From 68a230ef5da1cfc92f79a5d7184c88518ee12afd Mon Sep 17 00:00:00 2001 From: Yabo Hu Date: Tue, 13 Oct 2020 16:58:35 +0800 Subject: [PATCH 3/3] Update ChangeLog.md --- src/Network/Network/ChangeLog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Network/Network/ChangeLog.md b/src/Network/Network/ChangeLog.md index a5523e264c4d..373a5e53649f 100644 --- a/src/Network/Network/ChangeLog.md +++ b/src/Network/Network/ChangeLog.md @@ -19,6 +19,7 @@ ---> ## Upcoming Release +* [Breaking Change] Removed parameter `HostedSubnet` and add `Subnet` instead ## Version 3.5.0 * Added Office365 Policy to VPNSite Resource