management.psm1
$UserAccountsDefaultProperties = ('name', 'index', 'role', 'external-user', 'inactivity-timeout') $AlertsDefaultProperties = ('description', 'severity') $AlertDefinitionDefaultProperties = ('name', 'class-name', 'alert-code', 'severity', 'activity-mode', 'clearance-mode') $DataProtectionGroupsDefaultProperties = ('name', 'index', 'sys-name', 'num-of-ssds', 'ud-ssd-space-in-use', 'useful-ssd-space') $EventsDefaultProperties = ('id', 'description', 'severity', 'classification', 'entity', 'timestamp') $LDAPConfigsDefaultProperties = ('name', 'bind-dn', 'search-base', 'search-filter', 'user-to-dn-rule', 'server-url') $PerformaceDefaultProperties = ('name', 'entity-type', 'granularity', 'counters', 'date-time') $XEnvsDefaultProperties = ('name', 'index', 'cpu-usage', 'xenv-state', 'sys-name') $AdvisoryNoticesDefaultProperties = ('name', 'index', 'sys-name', 'category', 'creation-time', 'advisory-text') $AdvisoryNoticeDefaultProperties = ('sys-name', 'associated-cluster-psnt', ' creation-time', 'advisory_notice_category', 'advisory-notice-id', 'advisory-text') .(commonLib) Function Get-XtremAdvisoryNotices { [cmdletbinding()] Param( [parameter()] $XtremClusterName = (Get-XtremDefaultSession)._XtremClusterName, [parameter()] [Alias("Properties")] [array]$Property = $AdvisoryNoticesDefaultProperties, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [parameter()] [Alias("Filters")] [array]$Filter, [Parameter()] [switch]$ShowRest, [Parameter()] [switch]$Full = $false ) initCommand $Route = '/types/advisory-notices' if ($Full) { $Property = '' } $result = NewXtremRequest -Method GET -Endpoint $Route -Session $Session -XtremClusterName $XtremClusterName -Properties $Property -ObjectSelection $ObjectSelection -Filters $Filter -ShowRest:$ShowRest.IsPresent -Multi -Full:$Full.IsPresent $result = formatOutPut $Property $result finalizeCommand return $result } Function Get-XtremAdvisoryNotice { [cmdletbinding()] Param ( [parameter()] $XtremClusterName = (Get-XtremDefaultSession)._XtremClusterName, [Alias("Name","Index")] [parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true,Position=0)] [Argumentcompleter( { doComplete $args 'advisory-notices' name })] $AdvisoryNotice, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Alias("Properties")] [array]$Property = $AdvisoryNoticeDefaultProperties, [Parameter()] [switch]$ShowRest ) initCommand $Route = '/types/advisory-notices' $Route, $GetProperty = SetParametersForRequest $Route $AdvisoryNotice $result = NewXtremRequest -Method GET -Endpoint $Route -Session $Session -XtremClusterName $XtremClusterName -ObjectSelection $ObjectSelection -GetProperty $GetProperty -Properties $Property -ShowRest:$ShowRest.IsPresent $result = formatOutPut $Property $result finalizeCommand return $result } Function Set-XtremAdvisoryNotice { <# .DESCRIPTION Command used to acknowledge a specific Advisory Notice or refresh. .PARAMETER AdvisoryNotice The Id of the Advisory notice object .EXAMPLE Set-XtremAdvisoryNotice -AdvisoryNoticeId 1 -Operation Acknowledge #> [CmdletBinding()] Param ( [Parameter()] $XtremClusterName = (Get-XtremDefaultSession)._XtremClusterName, [Alias("Name", "Index")] [Parameter(ValueFromPipelineByPropertyName = $true, Position = 0)] $AdvisoryNotice, [Parameter(Mandatory = $true)] [ValidateSet("Acknowledge", "Refresh")] [string]$Operation, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Parameter()] [switch]$ShowRest ) if ($Operation -eq "Acknowledge") { $Route = '/types/advisory-notices/acknowledge' $Route, $GetProperty = SetParametersForRequest $Route $AdvisoryNotice } else { $Route = '/types/advisory-notices/refresh' } NewXtremRequest -Method PUT -Endpoint $Route -Session $Session -XtremClusterName $XtremClusterName -GetProperty $GetProperty -ShowRest:$ShowRest.IsPresent } ######### USER ACCOUNTS COMMANDS ######### Function Get-XtremUserAccounts { <# .DESCRIPTION Displays the list of User Accounts. .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-XtremUserAccounts #> [cmdletbinding()] Param ( [parameter()] [Alias("Properties")] [string[]]$Property = $UserAccountsDefaultProperties, [parameter()] [Alias("Filters")] [string[]]$Filter, [Parameter()] [switch]$ShowRest, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Parameter()] [switch]$Full = $false ) initCommand $Route = '/types/user-accounts' if ($Full) { $Property = '' } $result = NewXtremRequest -Method GET -Endpoint $Route -Session $Session -Properties $Property -Filters $Filter -ObjectSelection $ObjectSelection -ShowRest:$ShowRest.IsPresent -Multi -Full:$Full.IsPresent $result = formatOutPut $Property $result finalizeCommand return $result } Function Get-XtremUserAccount { <# .DESCRIPTION Displays details of a User Account. .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-XtremUserAccount -UserAccountName user #> [cmdletbinding()] Param ( [Alias("Name", "Index")] [parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] [Argumentcompleter( { doComplete $args 'user-accounts' name })] $UserAccountName, [Parameter()] [Alias("Properties")] [string[]]$Property, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Parameter()] [switch]$ShowRest ) initCommand $Route = '/types/user-accounts' $Route, $GetProperty = SetParametersForRequest $Route $UserAccountName $result = NewXtremRequest -Method GET -Endpoint $Route -Session $Session -ObjectSelection $ObjectSelection -GetProperty $GetProperty -Properties $Property -ShowRest:$ShowRest.IsPresent $result = formatOutPut $Property $result finalizeCommand return $result } #Deletes an User Account Function Remove-XtremUserAccount { <# .DESCRIPTION Enables you to delete a User Account. .PARAMETER ShowRest Return an object represents the REST operation including URI , Method and JSON .EXAMPLE Remove-XtremUserAccount -AccountName user #> [cmdletbinding()] Param ( [Alias("Name", "Index")] [parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] $UserAccountName, [Parameter()] [bool]$Confirm = (Get-XtremDefaultSession)._XtremCLIMode, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Parameter()] [switch]$ShowRest ) $confirmed = IsConfirmed $Confirm if (!$confirmed) { return } $Route = '/types/user-accounts' $Route, $GetProperty = SetParametersForRequest $Route $UserAccountName NewXtremRequest -Method DELETE -Endpoint $Route -Session $Session -GetProperty $GetProperty -ShowRest:$ShowRest.IsPresent } #Creates a new UserAccount Function New-XtremUserAccount { <# .DESCRIPTION enables you to create a new User Account. .PARAMETER Role User role. .PARAMETER UsrName User Name. .PARAMETER Password User password. .PARAMETER PublicKey User public key. .PARAMETER InactivityTimeout Inactivity timeout in minutes. .PARAMETER ShowRest Return an object represents the REST operation including URI , Method and JSON .EXAMPLE New-XtremUserAccount -UsrName elad -Role "read_only" -password 1234 #> [CmdletBinding()] Param ( [Parameter(Mandatory = $true, Position = 1)] [ValidateSet("read_only", "admin", "configuration", "technician")] [String]$Role, [Alias("Name", "Index")] [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] [String]$UsrName, [Parameter()] [AllowNull()] [String]$Password = $null, [Parameter()] [String]$PublicKey, [Parameter()] [AllowNull()] [System.Nullable[Int]]$InactivityTimeout, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Parameter()] [switch]$ShowRest ) $Route = '/types/user-accounts' $BodyList = @{ } AddIfExists -name "role" -value $Role -list $BodyList AddIfExists -name "usr-name" -value $UsrName -list $BodyList AddIfExists -name "password" -value $Password -list $BodyList AddIfExists -name "public-key" -value $PublicKey -list $BodyList AddIfExists -name "inactivity-timeout" -value $InactivityTimeout -list $BodyList $Body = BuildXtremJson -list $BodyList $ObjectSelection = 'content' NewXtremRequest -Method POST -Endpoint $Route -Session $Session -Body $Body -ObjectSelection $ObjectSelection -ShowRest:$ShowRest.IsPresent } Function Set-XtremUserAccount { <# .DESCRIPTION Enables you to modify a User Account. .PARAMETER Role User role. .PARAMETER UserAccountName User Name. .PARAMETER Password User password. .PARAMETER PublicKey User public key. .PARAMETER InactivityTimeout Inactivity timeout in minutes. .PARAMETER ShowRest Return an object represents the REST operation including URI , Method and JSON .EXAMPLE Set-XtremUserAccount -UsrName elad -Role "configuration" #> [CmdletBinding()] Param ( [Alias("Name", "Index")] [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] $UserAccountName, [Parameter()] [ValidateSet("read_only", "admin", "configuration", "technician")] [String]$Role, [Parameter()] [String]$UsrName, [Parameter()] [String]$Password, [Parameter()] [String]$PublicKey, [Parameter()] [AllowNull()] [System.Nullable[Int]]$InactivityTimeout, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Parameter()] [switch]$ShowRest ) $Route = '/types/user-accounts' $Route, $GetProperty = SetParametersForRequest $Route $UserAccountName $BodyList = @{ } AddIfExists -name "usr-name" -value $UsrName -list $BodyList AddIfExists -name "role" -value $Role -list $BodyList AddIfExists -name "password" -value $Password -list $BodyList AddIfExists -name "public-key" -value $PublicKey -list $BodyList AddIfExists -name "inactivity-timeout" -value $InactivityTimeout -list $BodyList $Body = BuildXtremJson -list $BodyList NewXtremRequest -Method PUT -Endpoint $Route -Session $Session -XtremClusterName $XtremClusterName -Body $Body -GetProperty $GetProperty -ShowRest:$ShowRest.IsPresent } Function Get-XtremXMS { <# .DESCRIPTION displays details of the XMS .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-XtremXMS #> [cmdletbinding()] Param ( [Parameter()] [Alias("Properties")] [string[]]$Property, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Parameter()] [switch]$ShowRest ) $Route = '/types/xms' $Route, $GetProperty = SetParametersForRequest $Route 1 $result = NewXtremRequest -Method GET -Endpoint $Route -Session $Session -ObjectSelection $ObjectSelection -GetProperty $GetProperty -Properties $Property -ShowRest:$ShowRest.IsPresent $result = formatOutPut $Property $result return $result } ####### DATA PROTECTION GROUPS COMMANDS ####### Function Get-XtremDataProtectionGroups { <# .DESCRIPTION lists the XtremIO Data Protection Groups (DPGs). .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-XtremDataProtectionGroups #> [cmdletbinding()] Param ( [parameter()] $XtremClusterName = (Get-XtremDefaultSession)._XtremClusterName, [parameter()] [Alias("Properties")] [string[]]$Property = $DataProtectionGroupsDefaultProperties, [parameter()] [Alias("Filters")] [string[]]$Filter, [Parameter()] [switch]$ShowRest, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Parameter()] [switch]$Full = $false ) initCommand $Route = '/types/data-protection-groups' if ($Full) { $Property = '' } $result = NewXtremRequest -Method GET -Endpoint $Route -Session $Session -XtremClusterName $XtremClusterName -Properties $Property -Filters $Filter -ObjectSelection $ObjectSelection -ShowRest:$ShowRest.IsPresent -Multi -Full:$Full.IsPresent $result = formatOutPut $Property $result finalizeCommand return $result } Function Get-XtremDataProtectionGroup { <# .DESCRIPTION displays the selected XtremIO Data Protection Group (DPG) details. .PARAMETER DataProtectionGroupName DPG's 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-XtremDataProtectionGroup -DataProtectionGroupName name #> [cmdletbinding()] Param ( [parameter()] $XtremClusterName = (Get-XtremDefaultSession)._XtremClusterName, [Alias("Name", "Index")] [parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] [Argumentcompleter( { doComplete $args 'data-protection-groups' name })] $DataProtectionGroupName, [Parameter()] [Alias("Properties")] [string[]]$Property, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Parameter()] [switch]$ShowRest ) initCommand $Route = '/types/data-protection-groups' $Route, $GetProperty = SetParametersForRequest $Route $DataProtectionGroupName $result = NewXtremRequest -Method GET -Endpoint $Route -Session $Session -XtremClusterName $XtremClusterName -ObjectSelection $ObjectSelection -GetProperty $GetProperty -Properties $Property -ShowRest:$ShowRest.IsPresent $result = formatOutPut $Property $result finalizeCommand return $result } ####### ALERTS COMMANDS ####### Function Get-XtremAlerts { <# .DESCRIPTION displays the list of Alerts. .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-XtremAlerts #> [cmdletbinding()] Param ( [parameter()] $XtremClusterName = (Get-XtremDefaultSession)._XtremClusterName, [parameter()] [Alias("Properties")] [string[]]$Property = $AlertsDefaultProperties, [parameter()] [Alias("Filters")] [string[]]$Filter, [Parameter()] [switch]$ShowRest, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Parameter()] [switch]$Full = $false ) initCommand $Route = '/types/alerts' if ($Full) { $Property = '' } $result = NewXtremRequest -Method GET -Endpoint $Route -Session $Session -XtremClusterName $XtremClusterName -Properties $Property -Filters $Filter -ObjectSelection $ObjectSelection -ShowRest:$ShowRest.IsPresent -Full:$Full.IsPresent $result = formatOutPut $Property $result finalizeCommand return $result } Function Get-XtremAlert { <# .DESCRIPTION displays the details of the selected Alert. .PARAMETER AlertName Alert 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-XtremAlert -AlertName 1 #> [cmdletbinding()] Param ( [parameter()] $XtremClusterName = (Get-XtremDefaultSession)._XtremClusterName, [parameter(Mandatory = $true, Position = 0)] [Alias("Name", "Index")] [Argumentcompleter( { doComplete $args 'alerts' name })] [int]$AlertName, [Parameter()] [Alias("Properties")] [string[]]$Property, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Parameter()] [switch]$ShowRest ) initCommand $Route = '/types/alerts' $Route, $GetProperty = SetParametersForRequest $Route $AlertName $result = NewXtremRequest -Method GET -Endpoint $Route -Session $Session -XtremClusterName $XtremClusterName -ObjectSelection $ObjectSelection -GetProperty $GetProperty -Properties $Property -ShowRest:$ShowRest.IsPresent $result = formatOutPut $Property $result finalizeCommand return $result } ####### ALERT DEFINITIONS COMMANDS ####### Function Get-XtremAlertDefinitions { <# .DESCRIPTION displays the list of Alert Definitions. .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-XtremAlertDefinitions #> [cmdletbinding()] Param ( [parameter()] $XtremClusterName = (Get-XtremDefaultSession)._XtremClusterName, [parameter()] [Alias("Properties")] [string[]]$Property = $AlertDefinitionDefaultProperties, [parameter()] [Alias("Filters")] [string[]]$Filter, [Parameter()] [switch]$ShowRest, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Parameter()] [switch]$Full = $false ) initCommand $Route = '/types/alert-definitions' if ($Full) { $Property = '' } $result = NewXtremRequest -Method GET -Endpoint $Route -Session $Session -XtremClusterName $XtremClusterName -Properties $Property -Filters $Filter -ObjectSelection $ObjectSelection -ShowRest:$ShowRest.IsPresent -Multi -Full:$Full.IsPresent $result = formatOutPut $Property $result finalizeCommand return $result } Function Get-XtremAlertDefinition { <# .DESCRIPTION displays the details of the selected Alert Definition. .PARAMETER AlertDefinitionName Alert Definition name .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-XtremAlertDefintion -AlertDefinitionName alert_name #> [cmdletbinding()] Param ( [parameter()] $XtremClusterName = (Get-XtremDefaultSession)._XtremClusterName, [Alias("Name", "Index")] [parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] [Argumentcompleter( { doComplete $args 'alert-definitions' name })] [string]$AlertDefinitionName, [Parameter()] [Alias("Properties")] [string[]]$Property, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Parameter()] [switch]$ShowRest ) initCommand $Route = '/types/alert-definitions' $Route, $GetProperty = SetParametersForRequest $Route $AlertDefinitionName $result = NewXtremRequest -Method GET -Endpoint $Route -Session $Session -XtremClusterName $XtremClusterName -ObjectSelection $ObjectSelection -GetProperty $GetProperty -Properties $Property -ShowRest:$ShowRest.IsPresent $result = formatOutPut $Property $result finalizeCommand return $result } Function Set-XtremAlertDefinition { <# .DESCRIPTION enables you to modify the selected Alert Definition. .PARAMETER AlertDefinitionName Alert Definition name. .PARAMETER ActivityMode Determines whether the Alert is enabled or disabled. .PARAMETER CleranceMode Clerance Mode .PARAMETER Severity Level of severity .PARAMETER ShowRest Return an object represents the REST operation including URI , Method and JSON .EXAMPLE Set-XtremAlertDefinition -AlertDefinitionName alertName #> [cmdletbinding()] Param ( [parameter()] $XtremClusterName = (Get-XtremDefaultSession)._XtremClusterName, [Alias("Name", "Index")] [parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] $AlertDefinitionName, [Parameter()] [string]$AlertType, [Parameter()] [string]$ActivityMode, [Parameter()] [string]$ClearnceMode, [Parameter()] [string]$Severity, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Parameter()] [switch]$ShowRest ) $Route = '/types/alert-definitions/' $Route, $GetProperty = SetParametersForRequest $Route $AlertDefinitionName $ObjectSelection = 'content' $BodyList = @{ } AddIfExists -name "alert-type" -value $AlertType -list $BodyList AddIfExists -name "activity-mode" -value $ActivityMode -list $BodyList AddIfExists -name "clerance-mode" -value $CleranceMode -list $BodyList AddIfExists -name "severity" -value $Severity -list $BodyList $Body = BuildXtremJson -list $BodyList NewXtremRequest -Method PUT -Endpoint $Route -Session $Session -XtremClusterName $XtremClusterName -Body $Body -ObjectSelection $ObjectSelection -GetProperty $GetProperty -Properties $Property -ShowRest:$ShowRest.IsPresent } ####### EVENTS COMMANDS ####### Function Get-XtremEvents { <# .DESCRIPTION displays the list of Events. .PARAMETER ToDateTime Date and time from which to filter Events: Format: "yyyy-mm-dd hh:mm:ss" Example: "2014-04-15 10:00:00" .PARAMETER FromDateTime Date and time until which to filter Events: Format: "yyyy-mm-dd hh:mm:ss" Example: "2014-04-15 10:00:00" .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-XtremEvents #> [cmdletbinding()] Param ( [parameter()] $XtremClusterName = (Get-XtremDefaultSession)._XtremClusterName, [Parameter()] [DateTime]$ToDateTime = (Get-Date), [Parameter()] [DateTime]$FromDateTime = (Get-Date $ToDateTime.AddDays(-30)), [parameter()] [Alias("Filters")] [string[]]$Filter, [Parameter()] [switch]$ShowRest, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Parameter()] [switch]$Full = $false ) $Route = '/types/events' $GetProperty = "" if ($Full) { $Property = '' } $Params = @{ "to-date-time" = (Get-Date $ToDateTime -format yyyy-MM-dd+H:mm:ss); "from-date-time" = (Get-Date $FromDateTime -format yyyy-MM-dd+H:mm:ss) } $Props = @() $Params.GetEnumerator() | ForEach-Object { if ($_.Value -ne "") { $Prop = $_.Name + "=" + $_.Value $Props += $Prop } $GetProperty = $Props -join '&' } $result = NewXtremRequest -Method GET -Endpoint $Route -Session $Session -XtremClusterName $XtremClusterName -GetProperty $GetProperty -Filters $Filter -ObjectSelection $ObjectSelection -ShowRest:$ShowRest.IsPresent -Full:$Full.IsPresent return $result } ######### XENVS COMMANDS ######### Function Get-XtremXEnvs { <# .DESCRIPTION displays the list of XEnvs. .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-XtremXEnvs #> [cmdletbinding()] Param ( [parameter()] $XtremClusterName = (Get-XtremDefaultSession)._XtremClusterName, [parameter()] [Alias("Properties")] [string[]]$Property = $XEnvsDefaultProperties, [parameter()] [Alias("Filters")] [string[]]$Filter, [Parameter()] [switch]$ShowRest, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Parameter()] [switch]$Full = $false ) initCommand $Route = '/types/xenvs' 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-XtremXEnv { <# .DESCRIPTION displays details of the selected XEnvs. .PARAMETER XEnvName XEnv's 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-XtremXEnv -XEnvName name #> [cmdletbinding()] Param ( [parameter()] $XtremClusterName = (Get-XtremDefaultSession)._XtremClusterName, [Alias("Name", "Index")] [parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] [Argumentcompleter( { doComplete $args 'xenvs' name })] $XEnvName, [Parameter()] [Alias("Properties")] [string[]]$Property, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Parameter()] [switch]$ShowRest ) initCommand $Route = '/types/xenvs' $Route, $GetProperty = SetParametersForRequest $Route $XEnvName $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 } ######### LDAP CONFIGS COMMANDS ######### Function Get-XtremLDAPConfigs { <# .DESCRIPTION displays the list of LDAP Configurations. .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-XtremLDAPConfigs #> [cmdletbinding()] Param ( [parameter()] $XtremClusterName = (Get-XtremDefaultSession)._XtremClusterName, [parameter()] [Alias("Properties")] [string[]]$Property = $LDAPConfigsDefaultProperties, [parameter()] [Alias("Filters")] [string[]]$Filter, [Parameter()] [switch]$ShowRest, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Parameter()] [switch]$Full = $false ) initCommand $Route = '/types/ldap-configs' 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-XtremLDAPConfig { <# .DESCRIPTION displays the details of the selected LDAP Configuration. .PARAMETER LDAPConfigName LDAP Configuration's name or index numbe .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-XtremLDAPConfig -LDAPConfigName name #> [cmdletbinding()] Param ( [parameter()] $XtremClusterName = (Get-XtremDefaultSession)._XtremClusterName, [Alias("Name", "Index")] [parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, Position = 0)] [Argumentcompleter( { doComplete $args 'ldap-configs' name })] $LDAPConfigName, [Parameter()] [Alias("Properties")] [string[]]$Property, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Parameter()] [switch]$ShowRest ) initCommand $Route = '/types/ldap-configs' $Route, $GetProperty = SetParametersForRequest $Route $LDAPConfigName $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 } Function Get-XtremPerformance { <# .DESCRIPTION displays the performance of the defined entity type (object). .PARAMETER Entity, A type of entity on which performance can be queried .PARAMETER AggregationType Aggregation function of the request .PARAMETER EntityIndex The index of the entity .PARAMETER EntityName The name of the entity .PARAMETER Granularity Time granularity of the output data .PARAMETER Timeframe Time frame of the request .PARAMETER Limit Number of row records to be returned .PARAMETER FromTime The defined commencement time of the report .PARAMETER ToTime The defined end time of the report .EXAMPLE Get-XtremPerformance -Entity Volume -limit:100 -timeframe:custom_time #> [cmdletbinding()] Param ( [parameter()] $XtremClusterName = (Get-XtremDefaultSession)._XtremClusterName, [parameter(Mandatory = $true)] [ValidateSet('SnapshotGroup', 'Initiator', 'Target', 'XEnv', 'DataProtectionGroup', 'Volume', 'Cluster', 'Tag', 'InitiatorGroup', 'SSD', 'TargetGroup', 'Xms')] [string]$Entity, [parameter()] [ValidateSet('avg', 'max', 'min')] [string]$AggregationType, [parameter()] [string]$EntityIndex, [parameter()] [string]$EntityName, [parameter()] [ValidateSet('one_minute', 'ten_minutes', 'one_hour', 'one_day', 'auto', 'raw')] [String]$Granularity = 'one_hour', [ValidateSet('custom_time', 'last_day', 'last_hour', 'last_week', 'last_year', 'real_time')] [String]$Timeframe = 'custom_time', [Parameter()] [AllowNull()] [System.Nullable[Int]]$Limit = 100, [Parameter()] [DateTime]$ToTime = (Get-Date), [Parameter()] [DateTime]$FromTime = (Get-Date $ToTime.AddDays(-30)), [Parameter()] [String]$ExportToFile, [Parameter()] [Alias("Properties")] [string[]]$Property = $PerformaceDefaultProperties, [Parameter()] [object]$Session = (Get-XtremDefaultSession), [Parameter()] [switch]$ShowRest ) initCommand $Route = '/types/performance' $Params = @{ "entity" = $Entity; "aggregation-type" = $AggregationType; "entity-index" = $EntityIndex; "entity-name" = $EntityName; "granularity" = $Granularity; "time-frame" = $TimeFrame; "limit" = $Limit; "to-time" = (Get-Date $ToTime -format yyyy-MM-dd+H:mm:ss); "from-time" = (Get-Date $FromTime -format yyyy-MM-dd+H:mm:ss); "export-to-file" = $ExportToFile } $GetProperty = "" $Props = @() $Params.GetEnumerator() | ForEach-Object { if ($_.Value -ne "") { $Prop = $_.Name + "=" + $_.Value $Props += $Prop } $GetProperty = $Props -join '&' } $result = NewXtremRequest -Method GET -Endpoint $Route -Session $Session -XtremClusterName $XtremClusterName -ObjectSelection $ObjectSelection -GetProperty $GetProperty -Properties $Property -ShowRest:$ShowRest.IsPresent $result = formatOutPut $Property $result finalizeCommand return $result } Export-ModuleMember Get-XtremAdvisoryNotice Export-ModuleMember Get-XtremAdvisoryNotices Export-ModuleMember Set-XtremUserAccount Export-ModuleMember New-XtremUserAccount Export-ModuleMember Remove-XtremUserAccount Export-ModuleMember Get-XtremUserAccount Export-ModuleMember Get-XtremUserAccounts Export-ModuleMember Get-XtremEvents Export-ModuleMember Set-XtremAlertDefinition Export-ModuleMember Get-XtremAlertDefinition Export-ModuleMember Get-XtremAlertDefinitions Export-ModuleMember Get-XtremAlert Export-ModuleMember Get-XtremAlerts Export-ModuleMember Get-XtremDataProtectionGroup Export-ModuleMember Get-XtremDataProtectionGroups Export-ModuleMember Get-XtremXMS Export-ModuleMember Set-XtremUserAccount Export-ModuleMember New-XtremUserAccount Export-ModuleMember Remove-XtremUserAccount Export-ModuleMember Get-XtremUserAccount Export-ModuleMember Get-XtremUserAccounts Export-ModuleMember Get-XtremLDAPConfig Export-ModuleMember Get-XtremLDAPConfigs Export-ModuleMember Get-XtremXEnv Export-ModuleMember Get-XtremXEnvs Export-ModuleMember Get-XtremPerformance Export-ModuleMember Set-XtremAdvisoryNotice |