Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AAA Group (Add/Set/Remove) #48

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
87 changes: 87 additions & 0 deletions PowerArubaCX/Private/Confirm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,91 @@ function Confirm-ArubaCXVrfs {
throw "Element specified does not contain a ssh_enable property."
}
$true
}

function Confirm-ArubaCXTacacsServer {

Param (
[Parameter (Mandatory = $true)]
[object]$argument
)
#Check if it looks like a TACACS server element

if ( -not ( $argument | Get-Member -name auth_type -Membertype Properties)) {
throw "Element specified does not contain an auth_type property."
}
if ( -not ( $argument | Get-Member -name default_group_priority -Membertype Properties)) {
throw "Element specified does not contain a default_group_priority property."
}
if ( -not ( $argument | Get-Member -name group -Membertype Properties)) {
throw "Element specified does not contain a group property."
}
if ( -not ( $argument | Get-Member -name passkey -Membertype Properties)) {
throw "Element specified does not contain a passkey property."
}
if ( -not ( $argument | Get-Member -name timeout -Membertype Properties)) {
throw "Element specified does not contain a timeout property."
}
if ( -not ( $argument | Get-Member -name tracking_enable -Membertype Properties)) {
throw "Element specified does not contain a tracking_enable property."
}
if ( -not ( $argument | Get-Member -name user_group_priority -Membertype Properties)) {
throw "Element specified does not contain an user_group_priority property."
}
$true
}

function Confirm-ArubaCXRadiusServer {

Param (
[Parameter (Mandatory = $true)]
[object]$argument
)
#Check if it looks like a TACACS server element

if ( -not ( $argument | Get-Member -name auth_type -Membertype Properties)) {
throw "Element specified does not contain an auth_type property."
}
if ( -not ( $argument | Get-Member -name default_group_priority -Membertype Properties)) {
throw "Element specified does not contain a default_group_priority property."
}
if ( -not ( $argument | Get-Member -name group -Membertype Properties)) {
throw "Element specified does not contain a group property."
}
if ( -not ( $argument | Get-Member -name passkey -Membertype Properties)) {
throw "Element specified does not contain a passkey property."
}
if ( -not ( $argument | Get-Member -name clearpass -Membertype Properties)) {
throw "Element specified does not contain a clearpass property."
}
if ( -not ( $argument | Get-Member -name timeout -Membertype Properties)) {
throw "Element specified does not contain a timeout property."
}
if ( -not ( $argument | Get-Member -name retries -Membertype Properties)) {
throw "Element specified does not contain a retries property."
}
if ( -not ( $argument | Get-Member -name tracking_enable -Membertype Properties)) {
throw "Element specified does not contain a tracking_enable property."
}
if ( -not ( $argument | Get-Member -name user_group_priority -Membertype Properties)) {
throw "Element specified does not contain an user_group_priority property."
}
$true
}

function Confirm-ArubaCXRadiusServerGroup {

Param (
[Parameter (Mandatory = $true)]
[object]$argument
)
#Check if it looks like a RADIUS server group element

if ( -not ( $argument | Get-Member -name group_type -Membertype Properties)) {
throw "Element specified does not contain an auth_type property."
}
if ( -not ( $argument | Get-Member -name origin -Membertype Properties)) {
throw "Element specified does not contain a default_group_priority property."
}
$true
}
Loading