IBSwitch.psm1
$InfinibandSwitchesDefaultProperties = ('name', 'index', 'serial-number', 'model', 'lifecycle-state') .(commonLib) ######### INFINIBAND SWITCHES COMMANDS ######### Function Get-XtremInfinibandSwitches { <# .DESCRIPTION displays the list of InfiniBand Switches. .PARAMETER Properties Array of properties requested from this call. .PARAMETER Filters Array of filters for this call. .PARAMETER ShowRest Return an object represents the REST operation including URI , Method and JSON .EXAMPLE Get-XtremInfinibandSwitches #> [cmdletbinding()] Param ( [parameter()] $XtremClusterName = (Get-XtremDefaultSession)._XtremClusterName, [parameter()] [Alias("Properties")] [Argumentcompleter( { doComplete $args 'infiniband-switches' prop })] [string[]]$Property = $InfinibandSwitchesDefaultProperties, [parameter()] [Alias("Filters")] [string[]]$Filter, [Parameter()] [switch]$ShowRest, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Parameter()] [switch]$Full = $false ) initCommand $Route = '/types/infiniband-switches' if ($Full) { $Property = '' } $result = NewXtremRequest -Method GET -Endpoint $Route -XtremClusterName $XtremClusterName -Session $Session -Properties $Property -Filters $Filter -ObjectSelection $ObjectSelection -ShowRest:$ShowRest.IsPresent -Multi -Full:$Full.IsPresent $result = formatOutPut $Property $result finalizeCommand return $result } Function Get-XtremInfinibandSwitch { <# .DESCRIPTION displays the details of the selected InfiniBand Switch. .PARAMETER InfinibandSwitchName InfiniBand Switch name or index number .PARAMETER Properties Array of properties requested from this call. .PARAMETER ShowRest Return an object represents the REST operation including URI , Method and JSON .EXAMPLE Get-XtremInfinibandSwitch -InfinibandSwitchName name #> [cmdletbinding()] Param ( [parameter()] $XtremClusterName = (Get-XtremDefaultSession)._XtremClusterName, [Alias("Name", "Index")] [parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] [Argumentcompleter( { doComplete $args 'infiniband-switches' name })] $InfinibandSwitchName, [Parameter()] [Alias("Properties")] [Argumentcompleter( { doComplete $args 'infiniband-switches' prop })] [string[]]$Property, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Parameter()] [switch]$ShowRest ) initCommand $Route = '/types/infiniband-switches' $Route, $GetProperty = SetParametersForRequest $Route $InfinibandSwitchName $result = NewXtremRequest -Method GET -Endpoint $Route -XtremClusterName $XtremClusterName -Session $Session -ObjectSelection $ObjectSelection -GetProperty $GetProperty -Properties $Property -ShowRest:$ShowRest.IsPresent $result = formatOutPut $Property $result finalizeCommand return $result } Export-ModuleMember *-* |