From 6054c7aae44ca9583854bb16a7028c183aa943b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Moreau?= Date: Fri, 13 Sep 2024 15:26:19 +0200 Subject: [PATCH] Add Get-FGTMonitorSystemInterfaceDHCPStatus --- .../monitor/system/interface/dhcp-status.ps1 | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 PowerFGT/Public/monitor/system/interface/dhcp-status.ps1 diff --git a/PowerFGT/Public/monitor/system/interface/dhcp-status.ps1 b/PowerFGT/Public/monitor/system/interface/dhcp-status.ps1 new file mode 100644 index 000000000..5fe3719d9 --- /dev/null +++ b/PowerFGT/Public/monitor/system/interface/dhcp-status.ps1 @@ -0,0 +1,41 @@ +# +# Copyright 2024, Cedric Moreau +# +# SPDX-License-Identifier: Apache-2.0 +# +function Get-FGTMonitorSystemInterfaceDHCPStatus { + + <# + .SYNOPSIS + Get Interface DHCP Status + + .DESCRIPTION + Get Client DHCP Status for an interface (Fortiguard, forticare....) + + .EXAMPLE + Get-FGTMonitorSystemInterfaceDHCPStatus + + Get License Status with status, version and last_update + + #> + + Param( + [Parameter (Mandatory = $true, Position = 1)] + [string]$interface, + [Parameter(Mandatory = $false)] + [psobject]$connection = $DefaultFGTConnection + ) + + Begin { + } + + Process { + + $uri = "api/v2/monitor/system/interface/dhcp-status?mkey=$($interface)" + $response = Invoke-FGTRestMethod -uri $uri -method 'GET' -connection $connection + $response.results + } + + End { + } +}