-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Get-FGTMonitorSystemInterfaceDHCPStatus (#264)
* Add Get-FGTMonitorSystemInterfaceDHCPStatus --------- Co-authored-by: Cédric Moreau <[email protected]>
- Loading branch information
1 parent
78e7599
commit 3c5ac38
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# | ||
# Copyright 2024, Cedric Moreau <moreaucedric0 at gmail dot com> | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
function Get-FGTMonitorSystemInterfaceDHCPStatus { | ||
|
||
<# | ||
.SYNOPSIS | ||
Get Interface DHCP Status | ||
.DESCRIPTION | ||
Get Client DHCP Status for an interface | ||
.EXAMPLE | ||
Get-FGTMonitorSystemInterfaceDHCPStatus -interface wan | ||
Get DHCP Client status for the specified interface wan | ||
#> | ||
|
||
Param( | ||
[Parameter (Mandatory = $true, Position = 1)] | ||
[string]$interface, | ||
[Parameter(Mandatory = $false)] | ||
[String[]]$vdom, | ||
[Parameter(Mandatory = $false)] | ||
[psobject]$connection = $DefaultFGTConnection | ||
) | ||
|
||
Begin { | ||
} | ||
|
||
Process { | ||
|
||
if ( $PsBoundParameters.ContainsKey('vdom') ) { | ||
$invokeParams.add( 'vdom', $vdom ) | ||
} | ||
|
||
$uri = "api/v2/monitor/system/interface/dhcp-status?mkey=$($interface)" | ||
$response = Invoke-FGTRestMethod -uri $uri -method 'GET' -connection $connection | ||
$response.results | ||
} | ||
|
||
End { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters