engagementanalytics.controllers package

Submodules

engagementanalytics.controllers.configurationcontroller module

Controller for Engagement Analytics configuration requests

class engagementanalytics.controllers.configurationcontroller.ConfigurationController(configuration: rrmsutils.models.engagementanalytics.configuration.Configuration, handler: EventHandler)

Bases: Controller

Controller for configuration requests

add_rules(app)

Add configuration rule at /configuration uri

Parameters:

app (Flask) – The Flask application instance to add the URL rule to.

configuration()

Callback for configuration request

Returns:

The Flask response object.

Return type:

Response

get_configuration()

Get the current service configuration

Returns:

The Flask response object with the current configuration.

Return type:

Response

put_configuration()

Set the current configuration according to the json included in request content

Returns:

The Flask response object with the command status.

Return type:

Response

engagementanalytics.controllers.controller module

Base controller

class engagementanalytics.controllers.controller.Controller

Bases: ABC

Flask server method controller

abstractmethod add_rules(app)

Add rules to flask server

response(data, code: int = 200, mimetype: str = 'application/json')

Builds and returns Response for a request

Parameters:
  • data – the data to be sent

  • code (int, optional) – HTTPStatus code. Defaults to 200.

  • mimetype (str, optional) – Response mimetype. Defaults to “application/json”.

Returns:

A Flask Response object with the given data.

Return type:

Flask.Response

Module contents