HP OneView REST API Reference

Common REST API Parameters
stdparams.html[10/17/2013 10:36:08 AM]
Equals (==, seq, SEQ, sEQ), Not Equals(sne, SNE, sNE), sregex and smatches can be used for
case-sensitive string comparisons on 'values'.
This parameter usually requires quoting as shown in the examples here (double quotes around the
entire filter parameter, and single-quotes around the {value} field)
Use dot-notation to reference attributes that are members of objects contained within the primary
resource object. For example, the following expression applies a filter on the networkURI attribute
of the connections attribute of the resource:
filter="connections.networkURI='/rest/ethernet-networks/e4d6e7b4-2ad7-
418a-9a89-974f347441c5'"
Filters supports 'regex' and 'matches' operations and these operations are case-insensitive.
'smaches' and 'sregex' are case-sensitive versions of 'matches' and 'regex' respectively.
Note : Per the RFC , substitute the URL encoding characters for reserved characters that should
not be used in sending requests. RFC link : http://www.ietf.org/rfc/rfc2396.txt URL encoding:-
http://www.w3schools.com/tags/ref_urlencode.asp
More details on Pattern Matching
Example for Equals:
name with value 'alertMax' (Case insensitive):
https://{appl}/settings/rest/resources?filter="'name' = 'alertMax'"
https://{appl}/settings/rest/resources?filter="'name' eq 'alertMax'"
name with value exactly 'alertMax' (Case sensitive):
https://{appl}/settings/rest/resources?filter="'name' == 'alertMax'"
https://{appl}/settings/rest/resources?filter="'name' seq 'alertMax'"
Example for Not Equals:
name with value 'alertMax' (Case insensitive):
https://{appl}/settings/rest/resources?filter=NOT "'name' =
'alertMax'"
https://{appl}/settings/rest/resources?filter="'name' ne 'alertMax'"
https://{appl}/settings/rest/resources?filter=NOT "'name' = NULL"
'matches' support the SQL Wildcard notations % (0 or more chars) , _ (any single char), and exact
match. This pattern matches the entire string.
Note: In some cases, '*' must be encoded as '%25' on the URL. If you do not get the expected results with
'*', use '%25'.
Example for matches:
name with value 'alertMax'(Case insensitively):
https://{appl}/settings/rest/resources?filter="'name' matches
'alertMax'"
name with value exactly 'alertMax' (Case sensitively):
https://{appl}/settings/rest/resources?filter="'name' smatches
'alertMax'"
name starts with 'a' followed by %(0 or more characters)
https://{appl}/settings/rest/resources?filter="filter="'name' matches
'a%'" https://{appl}/settings/rest/resources?filter="filter="'name'
matches 'a%25'"
name starts with _(any single character), followed by 'l' and %(0 or more characters).
https://{appl}/settings/rest/resources?filter="filter="'name'
matches'_l%'
'regex' supports POSSIX regular expression. And regex pattern can match any part of the string.