14.1.1.13. Event endpoints

This endpoint is used to create, modify, list and delete Event Handling Configuration. Event handling configuration is stored in the database table “eventhandling”

The code of this module is tested in tests/test_api_events.py

GET /event/(eventid)
GET /event/

returns a json list of the event handling configuration

Or

returns a list of available events when calling as /event/available

Or

the available handler modules when calling as /event/handlermodules

GET /event/positions/(handlermodule)

Return the list of positions a handlermodule provides.

Parameters:
  • handlermodule – Identifier of the handler module like “UserNotification”

Return:

list oft actions

GET /event/actions/(handlermodule)

Return the list of actions a handlermodule provides.

Parameters:
  • handlermodule – Identifier of the handler module like “UserNotification”

Return:

list oft actions

GET /event/conditions/(handlermodule)

Return the list of conditions a handlermodule provides.

Parameters:
  • handlermodule – Identifier of the handler module like “UserNotification”

Return:

list oft actions

POST /event

This creates a new event handling definition

Parameters:
  • name – A describing name of the event.bool

  • id – (optional) when updating an existing event you need to specify the id

  • event – A comma separated list of events

  • handlermodule – A handlermodule

  • action – The action to perform

  • ordering – An integer number

  • position – “pre” or “post”

  • conditions – Conditions, when the event will trigger

  • options. – A list of possible options.

POST /event/enable/(eventid)

Enable a given event by its id.

JSON Parameters:
  • eventid – ID of the event

Return:

ID in the database

POST /event/disable/(eventid)

Disable a given policy by its name.

JSON Parameters:
  • name – The name of the policy

Return:

ID in the database

DELETE /event/(eid)

this function deletes an existing event handling configuration

Parameters:
  • eid – The id of the event handling configuration

Return:

json with success or fail