Filter Parameter
The filter query parameter is used to filter items in a resource collection to return a subset of resources in a response. The subset includes only those resources that satisfy parameter value specified in the query.
To filter a resource collection use the filter query parameter in the following format:
GET https://<hostname>:1280/api/v3/<endpoint>?filter=[{"property":"<property>","operation":"<operation>","collation":"<collation>","value":"<value>"}] |
where:
- endpoint is a resource collection endpoint.
- property is the searched property name.
Note: |
To filter a resource collection based on a property of a resource subschema, use the "<subschema>.<property>" format to specify the resource property name where <subschema> is the subschema name. |
- operation is a relational or logical operator.
- collation is the type of rules that determine how specified values are compared with resource property values. The following types are available:
- ordinal — compare strings symbol-by-symbol
- ignorecase — compare strings symbol-by-symbol ignoring character case
- lexicographic — compare words with words and numbers with numbers
The default value is ordinal.
- value is a resource property value.
The Veeam Service Provider Console REST API supports the following operators:
Operator | Description |
in | Returns resources that match at least one of the values specified for a property. |
contains | Returns resources that contain the value specified for a property. |
subset | Returns resources that contain a subset of values specified for a property. |
superset | Returns resources that contain a superset of values specified for a property. |
equals | Returns resources that match the specified property value. |
notEquals | Returns resources that do not match the specified property value. |
lessThan | Returns resources with the property value that is less than the specified value. |
lessThanOrEqual | Returns resources with the property value that is less than or equal to the specified value. |
greaterThan | Returns resources with the property value that is greater than the specified value. |
greaterThanOrEqual | Returns resources with the property value that is greater than or equal to the specified value. |
To group multiple filter expressions, you can include them into a grouping expression. A grouping expression includes the following elements:
- operation is a relational or logical operator.
- items is an array of filter expressions.
A grouping expression has the following format:
GET https://<hostname>:1280/api/v3/<endpoint>?filter=[{"operation":"<operation>","items":[{"property":"<property>","operation":"<operation>","value":"<value>","collation":"<collation>"},{"property":"<property>","operation":"<operation>","value":"<value>","collation":"<collation>"}]}] |
To combine filter expressions you can use the following operators:
Operator | Description |
exclusiveOr | Returns resources that match one of the filter expressions. |
or | Returns resources that match one or more of the filter expressions. |
and | Returns resources that match all filter expressions. |
not | Returns resources that do not match all filter expressions. |
Examples
To get all triggered alarms with the Error status, send the following request:
GET https://vspc:1280/api/v3/alarms/active?filter=[{"property":"lastActivation.status","operation":"equals","collation":"ignorecase","value":"error"}] |
To get all users with the Portal Operator and Portal Administrator roles:
GET https://vspc:1280/api/v3/users?filter=[{"operation":"or","items":[{"property":"role","operation":"equals","value":"PortalAdministrator"},{"property":"role","operation":"equals","value":"PortalOperator"}]}] |