Skip to content

Commit

Permalink
Backup(monitor/system/config): now need to use method POST with body …
Browse files Browse the repository at this point in the history
…payload
  • Loading branch information
alagoutte committed Aug 28, 2024
1 parent 96d03ef commit eae1be8
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions PowerFGT/Public/monitor/system/config/backup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,21 @@ function Get-FGTMonitorSystemConfigBackup {
$invokeParams.add( 'vdom', $vdom )
}

$uri = 'api/v2/monitor/system/config/backup?scope=global'
$response = Invoke-FGTRestMethod -uri $uri -method 'GET' -connection $connection @invokeParams
#before 7.6.x, config/backup is available with get method and using paramater
if ($connection.version -lt "7.6.0") {
$method = "get"
$uri = 'api/v2/monitor/system/config/backup?scope=global'
$body = @{ }
}
else {
$method = "post"
$uri = 'api/v2/monitor/system/config/backup'
$body = @{
"scope" = "global"
}
}

$response = Invoke-FGTRestMethod -uri $uri -method $method -body $body -connection $connection @invokeParams
$response
}

Expand Down

0 comments on commit eae1be8

Please sign in to comment.