Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
Implement set-listener and remove-listener API to listen to various lifecycle stages of a trigger.
The set-listeners API can be invoked to add a listener to any trigger at any stage of its execution. The parameters are :
- ‘name’ - a unique string identifying the listener so that it can be read, updated and removed
- ‘trigger’ - the name of the trigger to listen to
- ‘stage’ - the stage of the trigger (multiple values can be specified as an array of strings), possible values are:
- STARTED,
- ABORTED,
- FAILED,
- SUCCEEDED
- ‘beforeAction’ - the action name before which the listener should be notified. Multiple values can be specified as an array of strings.
- ‘afterAction’ - the action name after which the listener should be notified. Multiple values can be specified as an array of strings
- ‘class’ - an implementation of ‘TriggerListener’ class
- Other parameters depend on the listener class
An example invocation of this API is:
curl -H 'Content-type:application/json' -d '{ “set-listener” : { “name” : “xyz”, “trigger” : “node_lost_trigger”, “stage” : [“STARTED”,”ABORTED”,”SUCCEEDED”], “beforeAction” : “execute_plan”, “class” : “solr.HttpCallback”, “url” : “http://xyz.com/on_node_lost?node={$LOST_NODE_NAME}” }' http://localhost:8983/solr/admin/cluster