
Dell PowerStore REST API Developers Guide
Filtering response data
Use one or more filter expressions in a request parameter to specify matching criteria for a list of resources returned by a collection query. A filter expression works like an SQL WHERE clause. You specify a filter expression composed of boolean predicates, and the expression is applied against the attribute values of the requested resource type. Only those instances that cause the filter expression to evaluate to true are returned in the query response. The system ANDs together multiple filter expressions.
Filter expressions use operators such as gt, gte, lt, and lte. The interpretation of these operators is type-dependent. For example, gt used with datetime attributes means the date value to the right of gt must be more recent than the date value to the left of gt.
Filtering is case insensitive for any property called name.
Using a filter expression can save bandwidth, because the server removes extra data before returning data to the client. However a filter expression does not reduce the amount of work the server performs to answer the request.
Syntax
As the first parameter on the request URI: ?<attribute_name>=<filter_expr>
As a subsequent parameter on the request URI: &<attribute_name>=<filter_expr>
where <filter_expr> is defined by the following syntax :
[not.]<operator>.<filter value> You can use nested notation syntax (<reference_attribute_name>(<attr1>,<attr2>...)) in a filter expression to filter by attributes from a related resource type.Supported operators
| Comparator | Description | Applicable data types | Example |
|---|---|---|---|
| eq | Equal.
Returns true when the expression on the left of eq equals the expression on the right. |
All |
?role_id=eq.3
True if the value of role_id is Operator. |
| gt | Greater than.
Returns true when the expression on the left of =eq is greater than the expression on the right. |
All |
?low_value=gt.5
True if the value of low_value is greater than 5. |
| gte | Greater than or equal.
Returns true when the expression on the left of =eq is greater than or equal to the expression on the right. |
All | ?software_version=gte.5.3
True if the value of software_version is greater than or equal to 5.3. |
| lt | Less than
Returns true when the expression on the left of =eq is less than the expression on the right. |
All | ?modify_time=lt.2018-05-07T17:56:28.859+00:00
True if the value of modify_time is earlier than 2018-05-07T17:56:28.859+00:00. |
| lte | Less than or equal.
Returns true when the expression on the left of =eq is less than or equal to the expression on the right. |
All | ?modify_time=lte.2018-05-07T17:56:28.859+00:00
True if the value of modify_time is 2018-05-07T17:56:28.859+00:00 or earlier. |
| neq | Not equal.
Returns true when the expression on the left of =eq is not equal to the expression on the right. |
All |
?role_id=neq.3
True if the value of role_id is anything other than Operator. |
| ilike | Case-insensitive substring match.
Returns true when the expression on the left of =eq, including its case, matches the expression on the right. Use * for a wildcard. |
String |
?name=ilike.User*
True if the value of name starts with User. |
| in | One of a list of values.
Returns true when the expression on the left of =eq matches any value in the comma-separated list on the right. |
All | ?role_id=in.(operator,administrator,service)
True if the value of role_id is Operator, Administrator, or VM Administrator. |
| is | Checks for exact equality to null, true, or false values. | null (All), true, false (Boolean) | ?description=is.null |
| cs | Contains. | List of any type |
?supported_speeds=cs.{1_Gbps,10_Gbps}
True if the speeds array contains 1 Gbps and 10 Gbps. |
| cd | Contained in. | List of any type |
?server_addresses=cd.{"1.2.3.4","5.6.7.8"}
True if the values in the server addresses list are all either 1.2.3.4 or 5.6.7.8. |
| not | Negates the operator that follows. | All |
?resource_type=not.in.(Operator,Administrator,VM Administrator)
True if the value of role_id is not Operator, Administrator, or VM Administrator. |
| and | All the conditions in the parentheses that follow must be true in order for the request to evaluate as true.
NOTE:The default for multiple filters is to AND them, so the use of
and is optional unless you are using both
and and
or in the filter expression.
|
All |
?and=(size.gt.50,performance_policy_id.eq.default_high)
True if the value of size is greater than 50 MB and the value of performance_policy is High. |
| or | At least one of the conditions in the parentheses that follow must be true in order for the request to evaluate as true. | All |
?or=(size.gt.50,performance_policy_id.eq.default_high)
True if either the value of size is greater than 50 MB or the value of performance_policy is High or both. |