RESTv2 alarm endpoint: Support searching for a single event parameter key-value pair on lastEvent
Description
Acceptance / Success Criteria
blocks
depends on
Lucidchart Diagrams
Activity

Seth Leger September 7, 2017 at 3:33 PM
Note that with the latest changes, it is not possible to query for multiple parameter key-value pairs because the query uses JOIN conditions. If you specify multiple values, the JOIN conditions will cancel out resulting in zero rows being returned.
A future enhancement to support this would have to use a special case for wildcard eventParameter.*
search parameters, doing something like:
/api/v2/alarms?_s=eventParameter.category==ENVIRONMENTAL
This is not particularly easy with the current code (since each FIQL term translates to a single Criteria Restriction) but could be added by supporting wildcard search parameters from the SearchBean that map to a new type of CriteriaBehavior.

Seth Leger September 5, 2017 at 2:41 PM
The filtering for the example given in the description will be implemented in the following way:
/api/v2/alarms?_s=eventParameter.name==category;eventParameter.value==ENVIRONMENTAL
It should be possible to query for multiple parameter values by using parenthetical ORd FIQL statements if necessary.

Seth Leger August 30, 2017 at 9:15 PM
This cannot be a foundation-2017
feature because the event parameters are only available in a separate table in develop
. Retargeting to 21.0.0.
When using the alarms endpoint in the v2 REST API, it should be possible to search based on the event parameters of the associated (last) event.
For example, let's assume an event associated with an alarm has a parameter called 'category' with value 'ENVIRONMENTAL'. It should be possible to retrieve the set of alarms where the associated event has a parameter 'category==ENVIRONMENTAL'.