about_Purity_Filtering.help.txt
TOPIC about_Purity_Filtering SHORT DESCRIPTION Describes how the PureStoragePowerShellSDK cmdlets support filtering to narrow down results. LONG DESCRIPTION The PureStoragePowerShellSDK supports filtering for various methods that might return multiple objects. The filter query parameter narrows down the results of a request to only the response objects that satisfy the filter criteria. Cmdlets that support filtering expose the -Filter parameter that takes a string representing the filter criteria. It should be noted that filtering is only supported for certain cmdlets in the SDK v1.19 (See "SUPPORTED CMDLETS" below). FILTERING WITH OPERATORS PureStoragePowerShellSDK filter parameter support common comparison operators. Syntax: -Filter <field_name> <operator> <field_value> field_name Name of the field on which to create the filter. Field_name can be any of the fields in the response. operator Type of filter match used to compare <field_name> to <field_value>. field_value A search value (number, date, or string) that determines the fields to be included in or excluded from the response. Literal strings must be wrapped in quotes. To refine the filter, include the asterisk (*) symbol as a wildcard character in the field value to represent zero or more characters. Field_value can include multiple asterisks, and the asterisks can appear anywhere in the value. For example, the filter name='*cat*' lists all hosts with names that contain cat, including ones that begin or end with cat, such as cat, catnap, happycats, and lolcat. If the asterisks were not included, only the host named cat would be returned. Filters support the following operators: = Example: Get a list of all volumes with volume names that include "v1". Get-PfaVolumes -Array $array -Filter "name='*v1*'" != Example: Get a list of all volumes with volume names that do not include "v1". Get-PfaVolumes -Array $array -Filter "name!='*v1*'" < Example: Get a list of all volumes that are less than 100 gigabytes in size. Get-PfaVolumes -Array $array -Filter size<107374182400 > Example: Get a list of all volumes that were created after 2016-04-25T23:02:23Z. Get-PfaVolumes -Array $array -Filter "created>'2016-04-25T23:02:23Z'" <= Example: Get a list of all volumes that were created on or before 2016-04-25T23:02:23Z. Get-PfaVolumes -Array $array -Filter "created<='2016-04-25T23:02:23Z'" >= Example: Get a list of all volumes that are greater than or equal to 100 gigabytes in size. Get-PfaVolumes -Array $array -Filter size>=107374182400 All comparison operators are case-insensitive. FILTERING WITH FUNCTIONS PureStoragePowerShellSDK filter parameter support the CONTAINS and NOT functions. Syntax: -Filter function(parameters) Filters support the following functions: contains(<field_name>,<string>) Description: Contains the enclosed string. Takes exactly two parameters, where <field_name> represents the name of the field on which to create the filter, and <string> represents the string to search within field_name. Example: Get a list of all host groups with names that include "cluster02". Get-PfaVolumes -Array $array -Filter "contains(hgroup,'cluster02')" not(<expression>) Description: Inverse of the enclosed expression. Example: Get a list of all host groups with names that do not include "cluster02". Get-PfaVolumes -Array $array -Filter "not(hgroup='cluster02')" FILTERING WITH EXISTENCE CHECKS PureStoragePowerShellSDK filter parameter supports existence checks. For example, the operation Get-PfaVolumes $array -Filter "source" returns volumes where the "source" exists for the volume. SUPPORTED CMDLETS (v1.19+) Get-PfaAllHostIOLatencyMetrics Get-PfaAllHostIOLatencyMetricsMirrored Get-PfaAllHostIOLatencyMetricsTotal Get-PfaAllHostIOMetricsAverage Get-PfaAllHostIOMetrics Get-PfaAllHostIOMetricsMirrored Get-PfaAllHostIOMetricsTotal Get-PfaAllHostSpaceMetrics Get-PfaAllProtectedHosts Get-PfaChapStatuses Get-PfaHostPrivateVolumeConnections Get-PfaHostProtectionGroups Get-PfaHosts Get-PfaHostSharedVolumeConnections Get-PfaHostVolumeConnections Get-PfaNamedHosts Get-PfaPersonalities Get-PfaRemoteHosts Get-PfaAllHostGroupIOLatencyMetrics Get-PfaAllHostGroupIOLatencyMetricsMirrored Get-PfaAllHostGroupIOLatencyMetricsTotal Get-PfaAllHostGroupIOMetricsAverage Get-PfaAllHostGroupIOMetrics Get-PfaAllHostGroupIOMetricsMirrored Get-PfaAllHostGroupIOMetricsTotal Get-PfaAllHostGroupSpaceMetrics Get-PfaAllProtectedHostGroups Get-PfaHostGroupProtectionGroups Get-PfaHostGroups Get-PfaHostGroupVolumeConnections Get-PfaNamedHostGroups Get-PfaRemoteHostGroups Get-PfaRemoteHostGroupVolumeConnections Get-PfaArrayPorts Get-PfaInitiatorPorts Get-PfaAllProtectionGroupOffloadSnapshot Get-PfaAllProtectionGroupReplicationBandwidthByTimeRange Get-PfaAllProtectionGroupReplicationBandwidth Get-PfaNamedProtectionGroups Get-PfaPendingDeleteProtectionGroups Get-PfaProtectionGroupOffloadSnapshot Get-PfaProtectionGroupReplicationBandwidthByTimeRange Get-PfaProtectionGroupReplicationBandwidth Get-PfaProtectionGroupRetentions Get-PfaProtectionGroupSchedules Get-PfaProtectionGroups Get-PfaProtectionGroupSnapshotReplicationStatus Get-PfaProtectionGroupSnapshots Get-PfaProtectionGroupSnapshotSpaceMetrics Get-PfaProtectionGroupVolumeSnapshots Get-PfaSourceProtectionGroupRetentions Get-PfaSourceProtectionGroupSchedules Get-PfaSourceProtectionGroups Get-PfaTargetProtectionGroups Get-PfaTotalSnapshotSpaceMetrics Get-PfaAllProtectedVolumes Get-PfaAllSnapshotSpaceMetrics Get-PfaAllVolumeHostEncryptionKeyStatus Get-PfaAllVolumeIOLatencyMetricsByTimeRange Get-PfaAllVolumeIOLatencyMetrics Get-PfaAllVolumeIOLatencyMetricsTotal Get-PfaAllVolumeIOMetricsAverage Get-PfaAllVolumeIOMetricsByTimeRange Get-PfaAllVolumeIOMetrics Get-PfaAllVolumeIOMetricsMirrored Get-PfaAllVolumeIOMetricsTotal Get-PfaAllVolumeOffloadSnapshot Get-PfaAllVolumeOffloadSnapshotRestoreStatus Get-PfaAllVolumeSnapshots Get-PfaAllVolumeSpaceMetricsByTimeRange Get-PfaAllVolumeSpaceMetrics Get-PfaAllVolumeSpaceMetricsTotal Get-PfaAllVolumeTotal Get-PfaBlockDifferences Get-PfaNamedVolumes Get-PfaNamedVolumesIOLatencyMetricsByTimeRange Get-PfaNamedVolumesIOMetricsByTimeRange Get-PfaOffloadSnapshot Get-PfaOffloadSnapshotRestoreStatus Get-PfaPendingDeleteVolumes Get-PfaPendingDeleteVolumeSnapshots Get-PfaPendingDeleteVolumesTags Get-PfaProtocolEndpointVolumes Get-PfaRemoteVolumeHostConnections Get-PfaRemoteVolumeHostGroupConnections Get-PfaSnapshotSpaceMetrics Get-PfaVolumeConnection Get-PfaVolumeHostConnections Get-PfaVolumeHostGroupConnections Get-PfaVolumeIOLatencyMetricsByTimeRange Get-PfaVolumeIOLatencyMetrics Get-PfaVolumeIOLatencyMetricsMirroredByTimeRange Get-PfaVolumeIOMetricsAverage Get-PfaVolumeIOMetricsByTimeRange Get-PfaVolumeIOMetrics Get-PfaVolumeIOMetricsMirroredByTimeRange Get-PfaVolumeIOMetricsMirrored Get-PfaVolumeProtectionGroups Get-PfaVolumes Get-PfaVolumeSnapshot Get-PfaVolumeSnapshots Get-PfaVolumeSpaceMetricsByTimeRange Get-PfaVolumesTags Get-PfaVolumeTags Get-PfaAllVolumeGroupIOLatencyMetricsByTimeRange Get-PfaAllVolumeGroupIOLatencyMetrics Get-PfaAllVolumeGroupIOMetricsByTimeRange Get-PfaAllVolumeGroupIOMetrics Get-PfaAllVolumeGroupsIOLatencyMetricsTotal Get-PfaAllVolumeGroupsIOMetricsAverage Get-PfaAllVolumeGroupsIOMetricsTotal Get-PfaAllVolumeGroupSpaceMetrics Get-PfaNamedVolumeGroups Get-PfaNamedVolumeGroupsIOLatencyMetricsByTimeRange Get-PfaNamedVolumeGroupsIOMetricsByTimeRange Get-PfaPendingDeleteVolumeGroups Get-PfaVolumeGroupIOLatencyMetricsByTimeRange Get-PfaVolumeGroupIOLatencyMetrics Get-PfaVolumeGroupIOMetricsAverage Get-PfaVolumeGroupIOMetricsByTimeRange Get-PfaVolumeGroupIOMetrics Get-PfaVolumeGroups EXAMPLES Example 1: Get the volume with serial number 31F52075433543110001103F. Get-PfaVolumes -Array $array -Filter "serial='31F52075433543110001103F'" Example 2: Get a list of hosts that are associated with host group "Cluster02-hg2". Get-PfaHosts -Array $array -Filter "hgroup='Cluster02-hg2'" Example 3: Get a list of all Fibre Channel ports on controller ct0. Get-PfaVolumes -Array $array -Filter "name='ct0.fc*'" Example 4: Get a list of all volumes that have been destroyed and will be eradicated within the next 2 hours (7200 seconds). Get-PfaPendingDeleteVolumes $array -Filter "time_remaining<=7200" Example 5: Get a list of all hosts that are associated with host groups that include "hg3" in the host group name. Get-PfaHosts $array -Filter "contains(hgroup,'hg3')" Example 6: Get a list of all volumes with names that do not include "vol01". Get-PfaVolumes $array -Filter "not(contains(name,'vol01'))" Example 7: Get a list of all hosts that are associated with a host group. Get-PfaHosts $array -Filter "hgroup" Example 8: Get a list of all volumes that were not created from another source. Get-PfaVolumes $array -Filter "not(source)" KEYWORDS filter. filtering, pagination, sorting SEE ALSO See the "Sorting, Filtering, and Pagination" section of the FlashArray REST API guide available at https://www.purestorage.com. |