biothings.web.analytics
biothings.web.analytics.channels
biothings.web.analytics.events
- class biothings.web.analytics.events.Message(dict=None, /, **kwargs)[source]
Bases:
EventLogical document that can be sent through services. Processable fields: title, body, url, url_text, image, image_altext Optionally define default field values below.
- DEFAULTS = {'image_altext': '<IMAGE>', 'title': 'Notification Message', 'url_text': 'View Details'}
- to_ADF()[source]
Generate ADF for Atlassian Jira payload. Overwrite this to build differently. https://developer.atlassian.com/cloud/jira/platform/apis/document/playground/
- to_email_payload(sendfrom, sendto)[source]
Build a MIMEMultipart message that can be sent as an email. https://docs.aws.amazon.com/ses/latest/DeveloperGuide/examples-send-using-smtp.html
- to_jira_payload(profile)[source]
Combine notification message with project profile to genereate jira issue tracking ticket request payload.
- to_slack_payload()[source]
Generate slack webhook notification payload. https://api.slack.com/messaging/composing/layouts
biothings.web.analytics.notifiers
- class biothings.web.analytics.notifiers.AnalyticsMixin(application: Application, request: HTTPServerRequest, **kwargs: Any)[source]
Bases:
RequestHandler- on_finish()[source]
Called after the end of a request.
Override this method to perform cleanup, logging, etc. This method is primarily intended as a counterpart to prepare. However, there are a few error cases where
on_finishmay be called whenpreparehas not. (These are considered bugs and may be fixed in the future, but for now you may need to check to see if the initialization work done inpreparehas occurred)on_finishmay not produce any output, as it is called after the response has been sent to the client.