Skip to content

Commit 8a95849

Browse files
added/updated 2.47.190 about_ files
1 parent 48ca0a5 commit 8a95849

1 file changed

Lines changed: 92 additions & 101 deletions

File tree

about_Pfa2Filtering.help.txt

Lines changed: 92 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,92 @@
1-
TOPIC
2-
about_Pfa2Filtering
3-
4-
SHORT DESCRIPTION
5-
Describes how the Pure Storage PowerShell SDK2 cmdlets support filtering to narrow down results.
6-
7-
LONG DESCRIPTION
8-
The Pure Storage PowerShell SDK2 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.
9-
10-
FILTERING WITH OPERATORS
11-
12-
The Pure Storage PowerShell SDK2 filter parameter supports common comparison operators.
13-
14-
Syntax: -Filter <field_name> <operator> <field_value>
15-
16-
field_name
17-
Name of the field on which to create the filter. Field_name can be any of the fields in the response.
18-
19-
operator
20-
Type of filter match used to compare <field_name> to <field_value>.
21-
22-
field_value
23-
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.
24-
25-
Filters support the following operators:
26-
=
27-
Example: Get a list of all volumes with volume names that include v1.
28-
Get-Pfa2Volume $arr -Filter "name='*v1*'"
29-
!=
30-
Example: Get a list of all volumes with volume names that do not include v1.
31-
Get-Pfa2Volume $arr -Filter "name!='*v1*'"
32-
<
33-
Example: Get a list of all volumes that are less than 100 gigabytes in size.
34-
Get-Pfa2Volume $arr -Filter size<107374182400
35-
>
36-
Example: Get a list of all volumes that were created after 2016-04-25T23:02:23Z.
37-
Get-Pfa2Volume $arr -Filter "created>'2016-04-25T23:02:23Z'"
38-
<=
39-
Example: Get a list of all volumes that were created on or before 2016-04-25T23:02:23Z.
40-
Get-Pfa2Volume $arr -Filter "created<='2016-04-25T23:02:23Z'"
41-
>=
42-
Example: Get a list of all volumes that are greater than or equal to 100 gigabytes in size.
43-
Get-Pfa2Volume $arr -Filter size>=107374182400
44-
45-
All comparison operators are case-insensitive
46-
47-
48-
FILTERING WITH FUNCTIONS
49-
50-
The Pure Storage PowerShell SDK2 filter parameter supports the CONTAINS and NOT functions.
51-
52-
Syntax: -Filter function(parameters)
53-
54-
Filters support the following functions:
55-
56-
contains(<field_name<,<string>)
57-
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.
58-
Example: Get a list of all host groups with names that include cluster02.
59-
Get-Pfa2Volume $arr -Filter "contains(hgroup,'cluster02')"
60-
61-
not(<expression>)
62-
Description: Inverse of the enclosed expression.
63-
Example: Get a list of all host groups with names that do not include cluster02.
64-
Get-Pfa2Volume $arr -Filter "not(hgroup='cluster02')"
65-
66-
67-
FILTERING WITH EXISTENCE CHECKS
68-
69-
PureStoragePowerShellSDK2 filter parameter supports existence checks. For example, the operation Get-Pfa2Volume $arr -Filter "source" returns volumes where the "source" exists for the volume.
70-
71-
EXAMPLES
72-
73-
Example 1: Get the volume with serial number 31F52075433543110001103F.
74-
Get-Pfa2Volume $arr -Filter "serial='31F52075433543110001103F'"
75-
76-
Example 2: Get a list of hosts that are associated with host group ESXi-IT-Cluster02-hg2.
77-
Get-Pfa2Host $arr -Filter "hgroup='ESXi-IT-Cluster02-hg2'"
78-
79-
Example 3: Get a list of all Fibre Channel ports on controller ct0.
80-
Get-Pfa2Volume $arr -Filter "name='ct0.fc*'"
81-
82-
Example 4: Get a list of all volumes that have been destroyed and will be eradicated within the next 2 hours (7200 seconds).
83-
Get-Pfa2Volume $arr -Filter "time_remaining<=7200"
84-
85-
Example 5: Get a list of all hosts that are associated with host groups that include hg3 in the host group name.
86-
Get-Pfa2Host $arr -Filter "contains(hgroup,'hg3')"
87-
88-
Example 6: Get a list of all volumes with names that do not include vol01.
89-
Get-Pfa2Volume $arr -Filter "not(contains(name,'vol01'))"
90-
91-
Example 7: Get a list of all hosts that are associated with a host group.
92-
Get-Pfa2Host $arr -Filter "hgroup"
93-
94-
Example 8: Get a list of all volumes that were not created from another source.
95-
Get-Pfa2Volume $arr -Filter "not(source)"
96-
97-
KEYWORDS
98-
filtwer, filtering, PowerShell, SDK, SDK2, PureStorage,FlashArray
99-
100-
SEE ALSO
101-
See the "Sorting, Filtering, and Pagination" section of the FlashArray REST API guide.
1+
TOPIC
2+
about_Pfa2Configuration
3+
4+
SHORT DESCRIPTION
5+
Describes how to set global PureStoragePowerShellSDK2 options.
6+
7+
LONG DESCRIPTION
8+
The PureStoragePowerShellSDK2 supports configuration of several options globally to allow
9+
an administrator to set some default behaviors.
10+
11+
The configuration file is always named:
12+
App.Config.JSON
13+
14+
This file is located in the same folder at the PureStoragePowerShellSDK2 module.
15+
Typically this will be in one of a several locations
16+
17+
%ProgramFiles%\WindowsPowerShell\Modules\PureStoragePowerShellSDK2\
18+
%USERPROFILE%\Documents\WindowsPowerShell\Modules\PureStoragePowerShellSDK2
19+
20+
The exact location can be determined with PowerShell after importing the SDK
21+
22+
Import-Module PureStoragePowerShellSDK2
23+
Get-Module PureStoragePowerShellSDK2 | Select-Object Name, Path | Format-List
24+
25+
PureRest.HttpTimeoutInMilliseconds:
26+
Gets or sets the timeout value for the HTTP requests.
27+
The default is 30000ms (30 seconds).
28+
29+
PureRest.NoOfRetries:
30+
How many times to retry on network failure.
31+
The default value is 3.
32+
33+
PureRest.RetryIntervalBase:
34+
The time (in ms) to wait before retrying a web request. Only retries on network issues,
35+
not for HTTP errors.
36+
The default value is 100ms.
37+
38+
PureRest.RetryIntervalGrowthFactor:
39+
The growth factor of the retryIntervalBase for subsequent retries.
40+
The default value is 3.
41+
42+
PureRest.SshPublicKeyTimeoutInMilliseconds:
43+
Time to wait for the "Please enter public key" prompt from SSH.
44+
The default value is 5000ms.
45+
46+
PureRest.SshPublicKeyResponseTimeoutInMilliseconds:
47+
Time to wait for response or error from pureapiclient create.
48+
The default value is 1000ms.
49+
50+
PureRest.SshPublicKeyWriteTimeoutInMilliseconds:
51+
Time to wait after writing public key before reading response from pureapiclient create.
52+
The default value is 5ms.
53+
54+
PureRest.LoggingToArrayEnabled:
55+
Can be set to false to disable logging REST commands to the array.
56+
The default value is true.
57+
58+
EXAMPLES
59+
60+
Example 1: Set the default HTTP timeout to 60 seconds
61+
{
62+
"PureRest.HttpTimeoutInMilliseconds": "60000"
63+
}
64+
65+
Example 2: All of the supported options specified with their default values
66+
{
67+
"PureRest.HttpTimeoutInMilliseconds": "30000",
68+
"PureRest.NoOfRetries": 3,
69+
"PureRest.RetryIntervalBase": 100,
70+
"PureRest.RetryIntervalGrowthFactor": 3,
71+
"PureRest.SshPublicKeyResponseTimeoutInMilliseconds": 1000,
72+
"PureRest.SshPublicKeyTimeoutInMilliseconds": 5000,
73+
"PureRest.SshPublicKeyWriteTimeoutInMilliseconds": 5
74+
}
75+
76+
Example 3: Opening the configuration file with Notepad:
77+
78+
PS C:\> Import-Module PureStoragePowerShellSDK2
79+
PS C:\> Get-Module PureStoragePowerShellSDK2 | Select-Object Name, Path | Format-List
80+
Name : PureStoragePowerShellSDK2
81+
Path : C:\Program Files\WindowsPowerShell\Modules\PureStoragePowerShellSDK2\PureStoragePowerShellSDK2.dll
82+
83+
PS C:\> Notepad "C:\Program Files\WindowsPowerShell\Modules\PureStoragePowerShellSDK2\App.Config.JSON"
84+
85+
86+
87+
KEYWORDS
88+
89+
90+
SEE ALSO
91+
- Connect-Pfa2Array
92+

0 commit comments

Comments
 (0)