Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Network/Network/Az.Network.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ RequiredAssemblies = 'Microsoft.Azure.PowerShell.AutoMapper.dll',
# TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = 'Network.format.ps1xml'
FormatsToProcess = 'Network.generated.format.ps1xml'

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
NestedModules = @('Microsoft.Azure.PowerShell.Cmdlets.Network.dll')
Expand Down Expand Up @@ -431,7 +431,8 @@ CmdletsToExport = 'Add-AzApplicationGatewayAuthenticationCertificate',
'Remove-AzVirtualHub', 'Set-AzVirtualHub', 'New-AzVirtualHubRoute',
'Add-AzVirtualHubRoute', 'New-AzVirtualHubRouteTable',
'Add-AzVirtualHubRouteTable', 'Get-AzVirtualHubRouteTable',
'Remove-AzVirtualHubRouteTable', 'New-AzRoutingPolicy',
'Remove-AzVirtualHubRouteTable', 'New-AzRoutingPolicy',
'New-AzVirtualRouterAutoScaleConfiguration',
'Get-AzRoutingPolicy', 'Add-AzRoutingPolicy',
'Remove-AzRoutingPolicy', 'Set-AzRoutingPolicy',
'New-AzRoutingIntent', 'Get-AzRoutingIntent', 'Set-AzRoutingIntent',
Expand Down
3 changes: 3 additions & 0 deletions src/Network/Network/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
--->

## Upcoming Release
* Updated `New-AzVirtualHub`, `Get-AzVirtualHub`, and `Update-AzVirtualHub` to include VirtualRouterAutoScaleConfiguration.
- Added `New-AzVirtualRouterAutoScaleConfiguration`.
* Updated default formatting on all Network-related objects.

## Version 5.6.0
* Updated `New-AzLoadBalancer` and `Set-AzLoadBalancer` to validate surface level parameters for global tier load balancers
Expand Down
2 changes: 2 additions & 0 deletions src/Network/Network/Common/NetworkResourceManagerProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,7 @@ private static void Initialize()
cfg.CreateMap<CNM.PSVirtualHubRoute, MNM.VirtualHubRoute>();
cfg.CreateMap<CNM.PSVirtualHubRouteTable, MNM.VirtualHubRouteTableV2>();
cfg.CreateMap<CNM.PSVirtualHubRoute, MNM.VirtualHubRouteV2>();
cfg.CreateMap<CNM.PSVirtualRouterAutoScaleConfiguration, MNM.VirtualRouterAutoScaleConfiguration>();
cfg.CreateMap<CNM.PSVpnGateway, MNM.VpnGateway>();
cfg.CreateMap<CNM.PSVpnGatewayNatRule, MNM.VpnGatewayNatRule>();
cfg.CreateMap<CNM.PSVpnNatRuleMapping, MNM.VpnNatRuleMapping>();
Expand Down Expand Up @@ -1219,6 +1220,7 @@ private static void Initialize()
cfg.CreateMap<MNM.VirtualHubRoute, CNM.PSVirtualHubRoute>();
cfg.CreateMap<MNM.VirtualHubRouteTableV2, CNM.PSVirtualHubRouteTable>();
cfg.CreateMap<MNM.VirtualHubRouteV2, CNM.PSVirtualHubRoute>();
cfg.CreateMap<MNM.VirtualRouterAutoScaleConfiguration, CNM.PSVirtualRouterAutoScaleConfiguration>();
cfg.CreateMap<MNM.VpnGateway, CNM.PSVpnGateway>();
cfg.CreateMap<MNM.VpnGatewayNatRule, CNM.PSVpnGatewayNatRule>();
cfg.CreateMap<MNM.VpnNatRuleMapping, CNM.PSVpnNatRuleMapping>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ public class NewAzureRmVirtualHubCommand : VirtualHubBaseCmdlet
HelpMessage = "The ASN of this virtual hub")]
public uint VirtualRouterAsn { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "Autoscale configuration for the hub router")]
public PSVirtualRouterAutoScaleConfiguration VirtualRouterAutoScaleConfiguration { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "Run cmdlet in the background")]
Expand Down Expand Up @@ -175,7 +180,8 @@ public override void Execute()
VirtualWan = new PSResourceId() { Id = resolvedVirtualWan.Id },
AddressPrefix = this.AddressPrefix,
Location = this.Location,
VirtualRouterAsn = this.VirtualRouterAsn
VirtualRouterAsn = this.VirtualRouterAsn,
VirtualRouterAutoScaleConfiguration = this.VirtualRouterAutoScaleConfiguration
};

virtualHub.RouteTable = this.RouteTable;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// ----------------------------------------------------------------------------------
//
// 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.
// ----------------------------------------------------------------------------------

namespace Microsoft.Azure.Commands.Network
{
using System.Management.Automation;
using Microsoft.Azure.Commands.Network.Models;

[Cmdlet(VerbsCommon.New,
ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "VirtualRouterAutoScaleConfiguration",
SupportsShouldProcess = false),
OutputType(typeof(PSVirtualRouterAutoScaleConfiguration))]
public class NewAzureRmVirtualRouterAutoScaleConfigurationCommand : NetworkBaseCmdlet
{
[Parameter(
Mandatory = true,
HelpMessage = "The minimum number of scale units for VirtualHub Router.")]
[ValidateNotNullOrEmpty]
[ValidateRange(1, int.MaxValue)]
public int MinCapacity { get; set; }


public override void Execute()
{
base.Execute();

var autoscaleconfig = new PSVirtualRouterAutoScaleConfiguration
{
MinCapacity = this.MinCapacity
};

WriteObject(autoscaleconfig);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ public class UpdateAzureRmVirtualHubCommand : VirtualHubBaseCmdlet
HelpMessage = "The ASN of this virtual hub")]
public uint VirtualRouterAsn { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "Autoscale configuration for the hub router")]
public PSVirtualRouterAutoScaleConfiguration VirtualRouterAutoScaleConfiguration { get; set; }

[Parameter(
Mandatory = false,
HelpMessage = "Run cmdlet in the background")]
Expand Down Expand Up @@ -221,6 +226,11 @@ public override void Execute()
virtualHubToUpdate.VirtualRouterAsn = this.VirtualRouterAsn;
}

if (this.VirtualRouterAutoScaleConfiguration != null)
{
virtualHubToUpdate.VirtualRouterAutoScaleConfiguration = this.VirtualRouterAutoScaleConfiguration;
}

//// Update the virtual hub
ConfirmAction(
Properties.Resources.SettingResourceMessage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public PSVirtualHub ToPsVirtualHub(Management.Network.Models.VirtualHub virtualH

return psVirtualHub;
}

public PSVirtualHub GetVirtualHub(string resourceGroupName, string name)
{
try
Expand Down
3 changes: 3 additions & 0 deletions src/Network/Network/Models/Cortex/PSVirtualHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ namespace Microsoft.Azure.Commands.Network.Models
using System.Collections.Generic;
using System.Management.Automation;
using Microsoft.WindowsAzure.Commands.Common.Attributes;
using Newtonsoft.Json;

public class PSVirtualHub : PSTopLevelResource
{
Expand Down Expand Up @@ -47,6 +48,8 @@ public class PSVirtualHub : PSTopLevelResource

public List<string> VirtualRouterIps { get; set; }

public PSVirtualRouterAutoScaleConfiguration VirtualRouterAutoScaleConfiguration { get; set; }

public SwitchParameter AllowBranchToBranchTraffic { get; set; }

[Ps1Xml(Label = "Address Prefix", Target = ViewControl.Table)]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Microsoft.WindowsAzure.Commands.Common.Attributes;
using System;
using System.Collections.Generic;
using System.Text;

namespace Microsoft.Azure.Commands.Network.Models
{
public class PSVirtualRouterAutoScaleConfiguration
{
[Ps1Xml(Label = "Minimum Capacity", Target = ViewControl.Table)]
public int MinCapacity { get; set; }
}
}
Loading