Skip to content

Commit

Permalink
arp(monitor): add support of VDOM
Browse files Browse the repository at this point in the history
  • Loading branch information
alagoutte committed Dec 27, 2024
1 parent 3f10da7 commit 4440531
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion PowerFGT/Public/monitor/network/arp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,16 @@ function Get-FGTMonitorNetworkARP {
Get Network ARP
.EXAMPLE
Get-FGTMonitorNetworkARP -vdom vdomX
Get Network ARP of vdomX
#>

Param(
[Parameter(Mandatory = $false)]
[String[]]$vdom,
[Parameter(Mandatory = $false)]
[psobject]$connection = $DefaultFGTConnection
)
Expand All @@ -29,13 +36,18 @@ function Get-FGTMonitorNetworkARP {

Process {

$invokeParams = @{ }
if ( $PsBoundParameters.ContainsKey('vdom') ) {
$invokeParams.add( 'vdom', $vdom )
}

#before 6.4.x, it is not available
if ($connection.version -lt "6.4.0") {
Throw "Monitor Network ARP is not available before Forti OS 6.4"
}

$uri = 'api/v2/monitor/network/arp'
$response = Invoke-FGTRestMethod -uri $uri -method 'GET' -connection $connection
$response = Invoke-FGTRestMethod -uri $uri -method 'GET' -connection $connection @invokeParams
$response.results
}

Expand Down

0 comments on commit 4440531

Please sign in to comment.