analytics.controllers package

Submodules

analytics.controllers.configcontroller module

Controller for configuration requests

class analytics.controllers.configcontroller.ConfigurationController(queue, configuration=None)

Bases: Controller

Controller for configuration requests

add_rules(app)

Add configuration rule at /configuration uri

configuration()

Callback for configuration request

get_configuration()

Get the current analytics configuration

Returns:

json string with the current configuration

Return type:

str

put_configuration()

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

Returns:

json string with the command status

Return type:

str

analytics.controllers.controller module

Base controller

class analytics.controllers.controller.Controller

Bases: ABC

Flask server method controller

abstract 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