-
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.
feat(wireless/wag-profile): Add Get-FGTWirelessWAGProfile
for get Wiress Access Gateway Profile with Multi Connection Tests
- Loading branch information
Showing
2 changed files
with
106 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,103 @@ | ||
# | ||
# Copyright 2019, Alexis La Goutte <alexis dot lagoutte at gmail dot com> | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
function Get-FGTWirelessWAGProfile { | ||
|
||
<# | ||
.SYNOPSIS | ||
Get list of Wireless WAG (Wireless Access Gateway) Profile Settings | ||
.DESCRIPTION | ||
Get list of Wireless WAG (Wireless Access Gateway) Profile Settings (Name, SSID, Security ...) | ||
.EXAMPLE | ||
Get-FGTWirelessWAGProfile | ||
Get list of Wireless WAG (Wireless Access Gateway) Profile object | ||
.EXAMPLE | ||
Get-FGTWirelessWAGProfile -name MyVAP | ||
Get list of Wireless WAG (Wireless Access Gateway) Profile object named MyVAP | ||
.EXAMPLE | ||
Get-FGTWirelessWAGProfile -meta | ||
Get list of Wireless WAG (Wireless Access Gateway) Profile object with metadata (q_...) like usage (q_ref) | ||
.EXAMPLE | ||
Get-FGTWirelessWAGProfile -skip | ||
Get list of Wireless WAG (Wireless Access Gateway) Profile object (but only relevant attributes) | ||
.EXAMPLE | ||
Get-FGTWirelessWAGProfile -vdom vdomX | ||
Get list of Wireless WAG (Wireless Access Gateway) Profile object on vdomX | ||
#> | ||
|
||
[CmdletBinding(DefaultParameterSetName = "default")] | ||
Param( | ||
[Parameter (Mandatory = $false, Position = 1, ParameterSetName = "name")] | ||
[string]$name, | ||
[Parameter (Mandatory = $false)] | ||
[Parameter (ParameterSetName = "filter")] | ||
[string]$filter_attribute, | ||
[Parameter (Mandatory = $false)] | ||
[Parameter (ParameterSetName = "filter")] | ||
[ValidateSet('equal', 'contains')] | ||
[string]$filter_type = "equal", | ||
[Parameter (Mandatory = $false)] | ||
[Parameter (ParameterSetName = "filter")] | ||
[psobject]$filter_value, | ||
[Parameter(Mandatory = $false)] | ||
[switch]$meta, | ||
[Parameter(Mandatory = $false)] | ||
[switch]$skip, | ||
[Parameter(Mandatory = $false)] | ||
[String[]]$vdom, | ||
[Parameter(Mandatory = $false)] | ||
[psobject]$connection = $DefaultFGTConnection | ||
) | ||
|
||
Begin { | ||
} | ||
|
||
Process { | ||
|
||
$invokeParams = @{ } | ||
if ( $PsBoundParameters.ContainsKey('meta') ) { | ||
$invokeParams.add( 'meta', $meta ) | ||
} | ||
if ( $PsBoundParameters.ContainsKey('skip') ) { | ||
$invokeParams.add( 'skip', $skip ) | ||
} | ||
if ( $PsBoundParameters.ContainsKey('vdom') ) { | ||
$invokeParams.add( 'vdom', $vdom ) | ||
} | ||
|
||
#Filtering | ||
switch ( $PSCmdlet.ParameterSetName ) { | ||
"name" { | ||
$filter_value = $name | ||
$filter_attribute = "name" | ||
} | ||
default { } | ||
} | ||
|
||
#if filter value and filter_attribute, add filter (by default filter_type is equal) | ||
if ( $filter_value -and $filter_attribute ) { | ||
$invokeParams.add( 'filter_value', $filter_value ) | ||
$invokeParams.add( 'filter_attribute', $filter_attribute ) | ||
$invokeParams.add( 'filter_type', $filter_type ) | ||
} | ||
|
||
$response = Invoke-FGTRestMethod -uri 'api/v2/cmdb/wireless-controller/wag-profile' -method 'GET' -connection $connection @invokeParams | ||
$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