Public/Configuration/vc-ip.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 |
# # Copyright 2020, Alexis La Goutte <alexis dot lagoutte at gmail dot com> # # SPDX-License-Identifier: Apache-2.0 # function Set-ArubaIAPVCIP { <# .SYNOPSIS Set the Virtual Controller (VC) IP Address to Aruba Instant AP Cluster .DESCRIPTION Set the VC IP to Aruba Instant AP Cluster .EXAMPLE Set-ArubaIAPVCIP 192.0.2.1 Set IP Address 192.0.2.1 to virtual controller #> [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'medium')] Param( [Parameter (Mandatory = $true, Position = 1)] [ipaddress]$vc_ip, [Parameter (Mandatory = $false)] [ipaddress]$iap_ip_addr = ${DefaultArubaIAPConnection}.iap_ip_addr ) Begin { } Process { $uri = "rest/virtual-controller-ip" $virtual_controller_ip = @{ "action" = "create" "vc-ip" = $vc_ip.ToString() } $body = @{ "virtual-controller-ip" = $virtual_controller_ip } if ($PSCmdlet.ShouldProcess($iap_ip_addr, 'Set VC IP')) { $response = Invoke-ArubaIAPRestMethod -uri $uri -body $body -method 'POST' $response } } End { } } |