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://one-srv:1239/api/v2.2/<endpoint>?filter={"property":"<property>","operation":"<operation>","collation":"<collation>","value":"<value>"}

where:

  • endpoint is a resource collection endpoint.
  • property is the searched property name.

Filter Parameter 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 (only for case-sensitive databases)
  • ignorecase — compare strings symbol-by-symbol ignoring character case
  • lexicographic — compare words with words and numbers with numbers

The default value is ignorecase.

  • value is a resource property value.

The Veeam ONE 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 the item property in the following format:

GET https://one-srv:1239/api/v2.2/<endpoint>?filter={"operation":"<operation>","items":[{"property":"<property>","operation":"<operation>","collation":"<collation>","value":"<value>"},{"property":"<property>","operation":"<operation>","collation":"<collation>","value":"<value>"}]}

To combine 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.

Example

To get all data collection tasks with the Failed status, send the following request:

GET https://one-srv:1239/api/v2.2/dataCollection/tasks?Filter={"property":"status","operation":"equals","collation":"ignorecase","value":"failed"}