SEMP v2- get if any one of the condition (where parameter) is true

Manikanta
Manikanta Member Posts: 17

http://applianceIP/SEMP/v2/monitor/msgVpns?where=eventConnectionCountThreshold.clearPercent!=40,eventIngressMsgRateThreshold.clearValue==300,enabled==true&select=msgVpnName
In the above example, i am getting the results if all conditions are true/satisfied. But is there any way to get if any one or more conditions are true?

Comments

  • Manikanta
    Manikanta Member Posts: 17

    Another question, Just to confirm PATCH call will only update what we passing right? It won't reset/change other attributes to default values right?

  • Aaron
    Aaron Member, Administrator, Moderator, Employee Posts: 634 admin

    Hi @Manikanta..! I'm sure you've seen this page, yes? https://docs.solace.com/API-Developer-Online-Ref-Documentation/swagger-ui/monitor/index.html

    So yeah, using the , comma separator is the only (currently only) way to chain multiple conditions together for the where clause. It's an interesting idea, I'll pass it along internally for consideration.

    BUT, you could build the result yourself by just running 3 separate queries, and then de-duping on the Message VPN name. Not too hard, but not as simple as a single command.

    For your 2nd question (two in one thread!), I'll point you to the config schema: https://docs.solace.com/API-Developer-Online-Ref-Documentation/swagger-ui/config/index.html It does list out all the supported HTTP methods, and their behaviour. But yes, your thinking about PATCH is correct.

  • Manikanta
    Manikanta Member Posts: 17

    Yes, have seen the swagger document. Thank you
    Yes we can do separate queries, but we have more numbers of Vpns and need to check multiples attributes with multiple conditions, So the number of hits we will make at a time will be higher.
    The best option we were thinking is GET all the properties of VPN, parse and compare through a custom script.

  • Aaron
    Aaron Member, Administrator, Moderator, Employee Posts: 634 admin

    The best option we were thinking is GET all the properties of VPN, parse and compare through a custom script.

    Agreed, probably easier. The filtering capabilities provided by the SEMPv2 engine are decent, but if you want more advanced Boolean expressions or whatnot, probably much better to fetch everything locally, and then run your query there. Plus, allows you to run multiple queries on your "static" dataset without having to query SEMP repeatedly.