From eb867c23c1aa168f81445e19ead70ace4101c708 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Fri, 17 May 2024 15:57:18 +0200 Subject: [PATCH 1/2] Interface(Set): Add vsx-sync parameter you can vsx-sync parameter like active-gateway (and ^vsx_virtual.* / virtual_gw_l3_src_mac_enable) --- PowerArubaCX/Public/Interfaces.ps1 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/PowerArubaCX/Public/Interfaces.ps1 b/PowerArubaCX/Public/Interfaces.ps1 index 3baeb29..f23b246 100644 --- a/PowerArubaCX/Public/Interfaces.ps1 +++ b/PowerArubaCX/Public/Interfaces.ps1 @@ -631,6 +631,9 @@ function Set-ArubaCXInterfaces { [Parameter(Mandatory = $false)] [Alias('active_gateway')] [ipaddress[]]$vsx_virtual_ip4, + [Parameter (Mandatory = $false)] + [ValidateSet('active-gateway', IgnoreCase = $false)] + [string[]]$vsx_sync, [Parameter(Mandatory = $false)] [string]$vrf, [Parameter (Mandatory = $false)] @@ -789,6 +792,20 @@ function Set-ArubaCXInterfaces { $_interface.vsx_virtual_ip4 = $ag_ip4 } + if ( $PsBoundParameters.ContainsKey('vsx_sync') ) { + $vsync = @() + + foreach ($vs in $vsx_sync) { + if($vs -eq "active-gateway"){ + $vsync += "^vsx_virtual.*" + $vsync += "virtual_gw_l3_src_mac_enable" + } else { + $vsync += $vs + } + } + $_interface.vsx_sync = $vsync + } + if ( $PsBoundParameters.ContainsKey('vrf') ) { $_interface.vrf = "/rest/" + $($connection.api_version) + "/system/vrfs/" + $vrf } From 2e46cd254166c96439257957b8b62b07b8c6a61d Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Fri, 17 May 2024 17:19:33 +0200 Subject: [PATCH 2/2] Interfaces(Add): Add ip_mtu parameter when add vlan interface need to write some Tests.. --- PowerArubaCX/Public/Interfaces.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/PowerArubaCX/Public/Interfaces.ps1 b/PowerArubaCX/Public/Interfaces.ps1 index f23b246..8979ae5 100644 --- a/PowerArubaCX/Public/Interfaces.ps1 +++ b/PowerArubaCX/Public/Interfaces.ps1 @@ -71,6 +71,9 @@ function Add-ArubaCXInterfaces { [string]$admin, [Parameter(Mandatory = $false)] [string]$description, + [Parameter(Mandatory = $false, ParameterSetName = "vlan")] + [ValidateRange(68, 9198)] + [int]$ip_mtu, [Parameter(Mandatory = $false, ParameterSetName = "lag")] [switch]$routing, [Parameter(Mandatory = $false, ParameterSetName = "lag")] @@ -161,6 +164,10 @@ function Add-ArubaCXInterfaces { $_interface | Add-Member -name "description" -membertype NoteProperty -Value $description } + if ( $PsBoundParameters.ContainsKey('ip_mtu') ) { + $_interface | Add-Member -name "ip_mtu" -membertype NoteProperty -Value $ip_mtu + } + if ( $PsBoundParameters.ContainsKey('routing') ) { if ($routing) { $_interface | Add-Member -name "routing" -membertype NoteProperty -Value $true