Filter Parameters
Some resource properties of Veeam Backup for Nutanix AHV REST API schemas can be used as filter query parameters. Filter query parameters are used to filter items of 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://127.0.0.1/api/v7/<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 Backup for Nutanix AHV 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://127.0.0.1/api/7/<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. |
Example
For example, to return a list of session of backup jobs with the Success, Failed or Canceling status, send the following the request:
GET https://127.0.0.1/api/v7/sessions?filter=[{"operation":"and","items":[{"operation":"in","collation":"ordinal","property":"status","value":["Success","Failed","Canceling"]},{"operation":"in","collation":"ordinal","property":"sessionType","value":["BackupVmJob"]}]}] |