Service bookkeeper

bookkeeper.py

The bookkeeper service of mercure, which receives notifications from all mercure services and stores the information in a Postgres database.

class bookkeeper.TokenAuth[source]

Bases: BaseTokenAuth

async verify(token: str)[source]
bookkeeper.create_database() None[source]

Creates all tables in the database if they do not exist.

bookkeeper.main(args=['-b', 'html', '-d', '_build/doctrees', '.', '_build/html']) None[source]
async bookkeeper.parse_and_submit_tags(payload) None[source]

Helper function that reads series information from the request body.

async bookkeeper.post_mercure_event(request) JSONResponse[source]

Endpoint for receiving mercure system events.

async bookkeeper.post_task_event(request) JSONResponse[source]

Endpoint for logging all events related to one series.

async bookkeeper.post_webgui_event(request) JSONResponse[source]

Endpoint for logging relevant events of the webgui.

async bookkeeper.register_dicom(request) JSONResponse[source]

Endpoint for registering newly received DICOM files. Called by the getdcmtags module.

async bookkeeper.register_series(request) JSONResponse[source]

Endpoint that is called by the router whenever a new series arrives.

async bookkeeper.register_task(request) JSONResponse[source]
async bookkeeper.server_error(request, exc) Response[source]

Return an HTTP 500 page.

async bookkeeper.shutdown() None[source]

Disconnect from database on shutdown.

async bookkeeper.startup() None[source]

Connects to database on startup. If the database does not exist, it will be created.

async bookkeeper.test_begin(request) JSONResponse[source]
async bookkeeper.test_end(request) JSONResponse[source]
async bookkeeper.test_endpoint(request) JSONResponse[source]

Endpoint for testing that the bookkeeper is active.

async bookkeeper.update_task(request) JSONResponse[source]

Endpoint that is called by the router whenever a new series arrives.