Public/Action/swarm-mode.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# # Copyright 2019, Alexis La Goutte <alexis dot lagoutte at gmail dot com> # # SPDX-License-Identifier: Apache-2.0 # function Set-ArubaIAPSwarmMode { <# .SYNOPSIS Set the Swarm Mode of Aruba Instant AP .DESCRIPTION Configure the Swarm Mode (standalone or cluster) of Aruba Instant AP Need to restart IAP for change mode .EXAMPLE Set-ArubaIAPSwarnMode -swarmmode cluster Set mode cluster on the IAP .EXAMPLE Set-ArubaIAPSwarnMode -swarmmode standalone -iap_ip_addr 192.0.2.2 Set mode standalone on the IAP with address IP 192.0.2.2 #> [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'Low')] Param( [Parameter (Mandatory = $true, Position = 1)] [ValidateSet('Cluster', 'standalone')] [string]$swarmmode, [Parameter (Mandatory = $false)] [ipaddress]$iap_ip_addr = ${DefaultArubaIAPConnection}.iap_ip_addr ) Begin { } Process { $uri = "rest/swarm-mode" $swarmmode_info = @{ "swarm-mode" = $swarmmode } $body = @{ "iap_ip_addr" = $iap_ip_addr.ToString() "swarm-mode" = $swarmmode_info } if ($PSCmdlet.ShouldProcess($iap_ip_addr, 'Set Swarm Mode')) { $response = Invoke-ArubaIAPRestMethod -uri $uri -body $body -method 'POST' $response } } End { } } |