:py:mod:`GeoHealthCheck.notifications` ====================================== .. py:module:: GeoHealthCheck.notifications Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: GeoHealthCheck.notifications.do_email GeoHealthCheck.notifications._parse_line GeoHealthCheck.notifications._parse_webhook_location GeoHealthCheck.notifications.do_webhook GeoHealthCheck.notifications.notify Attributes ~~~~~~~~~~ .. autoapisummary:: GeoHealthCheck.notifications.LOGGER .. py:data:: LOGGER .. py:function:: do_email(config, resource, run, status_changed, result) .. py:function:: _parse_line(_line) .. py:function:: _parse_webhook_location(value) Parse Recipient.location and returns tuple of url and params location should be in form URL PAYLOAD where PAYLOAD is a list of fields and values in form FIELD_NAME=FIELD_VALUE alternatively, it can be dictionary serialized as json .. py:function:: do_webhook(config, resource, run, status_changed, result) Process webhook recipients for resource location should be in format: URL [PAYLOAD] There's blank line between URL and PAYLOAD. PAYLOAD should be either json or list of field=value items in each line. Webhook's request is POST send to url with payload containing PAYLOAD and fields: ghc.result=(result of test) ghc.resource.url=(url of resource) ghc.resource.title=(title of resource) .. py:function:: notify(config, resource, run, last_run_success) execute a notification