Monitoring and reporting for Veeam Data Platform
Post Reply
anders.westerberg
Lurker
Posts: 2
Liked: 1 time
Joined: Dec 23, 2011 4:56 pm
Full Name: Anders Westerberg
Contact:

Veeam ONE 12.0 RestAPI 2.1 filter with item property

Post by anders.westerberg »

Hi

Been trying for a few hours to figure out how to build the get request to filter multiple expressions when querying the Veeam ONE RestAPI. Using info from here: https://helpcenter.veeam.com/docs/one/r ... ml?ver=120

Using this endpoint: /api/v2.1/alarms/triggeredAlarms

I'm just trying to filter out active alarms.

These ones work:

filter={"property":"status","operation":"notequals","collation":"ignorecase","value":"resolved"}
filter={"property":"status","operation":"notequals","collation":"ignorecase","value":"acknowledged"}

But when trying to combine those into one query like this:

filter={"property":"status","operation":"not","collation":"ignorecase","items":[{"operation":"equals","value":"resolved"},{"operation":"equals","value":"acknowledged"}]}

I receive the "SortAndFindParseException" error and I cant figure out what I'm doing wrong :), anyone have a clue?

/anders
jorgedlcruz
Veeam Software
Posts: 1372
Liked: 619 times
Joined: Jul 17, 2015 6:54 pm
Full Name: Jorge de la Cruz
Contact:

Re: Veeam ONE 12.0 RestAPI 2.1 filter with item property

Post by jorgedlcruz » 2 people like this post

Hello Anders,
I have asked internally to try to reproduce it, and will reply as soon as I hear back from the team.

Thanks so much!
Jorge de la Cruz
Senior Product Manager | Veeam ONE @ Veeam Software

@jorgedlcruz
https://www.jorgedelacruz.es / https://jorgedelacruz.uk
vExpert 2014-2024 / InfluxAce / Grafana Champion
jorgedlcruz
Veeam Software
Posts: 1372
Liked: 619 times
Joined: Jul 17, 2015 6:54 pm
Full Name: Jorge de la Cruz
Contact:

Re: Veeam ONE 12.0 RestAPI 2.1 filter with item property

Post by jorgedlcruz » 1 person likes this post

Hello Anders,
I have been playing with this, this has gave me some results that might be what you are expecing perhaps, give it a try:

Code: Select all

{"operation":"and","items":[{"operation":"not","items":[{"property":"status","operation":"equals","collation":"ignorecase","value":"resolved"}]},{"operation":"not","items":[{"property":"status","operation":"equals","collation":"ignorecase","value":"acknowledged"}]}]}
Paste it like that on the Filter field
Jorge de la Cruz
Senior Product Manager | Veeam ONE @ Veeam Software

@jorgedlcruz
https://www.jorgedelacruz.es / https://jorgedelacruz.uk
vExpert 2014-2024 / InfluxAce / Grafana Champion
anders.westerberg
Lurker
Posts: 2
Liked: 1 time
Joined: Dec 23, 2011 4:56 pm
Full Name: Anders Westerberg
Contact:

Re: Veeam ONE 12.0 RestAPI 2.1 filter with item property

Post by anders.westerberg » 1 person likes this post

Thank you, that seems to do exactly what I want!
RomanK
Veeam Software
Posts: 641
Liked: 168 times
Joined: Nov 01, 2016 11:26 am
Contact:

Re: Veeam ONE 12.0 RestAPI 2.1 filter with item property

Post by RomanK »

Hello Anders,

There are also some options to try.

Grouping with "and"

Code: Select all

{"operation":"and","items":[{"property":"status","operation":"notequals","collation":"ignorecase","value":"resolved"}, {"property":"status","operation":"notequals","collation":"ignorecase","value":"acknowledged"}]}
Grouping with "not"

Code: Select all

{"operation": "not", "items": [{ "operation": "or", "items": [{ "property": "status", "operation": "equals", "collation": "ignorecase", "value": "acknowledged"}, {"property": "status", "operation": "equals", "collation": "ignorecase", "value": "resolved" }]}]}
It seems to me in your case it would be simpler to use the usual filter, but include only the necessary values

Code: Select all

{"property":"status","value":["Information","Error", "Warning"],"operation":"in","collation":"ignorecase"}
Thanks

PS The documentation page example will be updated soon
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests