Module Contents

class airflow.contrib.hooks.opsgenie_alert_hook.OpsgenieAlertHook(opsgenie_conn_id='opsgenie_default', *args, **kwargs)[source]

Bases: airflow.hooks.http_hook.HttpHook

This hook allows you to post alerts to Opsgenie. Accepts a connection that has an Opsgenie API key as the connection’s password. This hook sets the domain to, and if not set will default to

Each Opsgenie API key can be pre-configured to a team integration. You can override these defaults in this hook.


opsgenie_conn_id (str) – The name of the Opsgenie connection to use


Get Opsgenie api_key for creating alert

get_conn(self, headers=None)[source]

Overwrite HttpHook get_conn because this hook just needs base_url and headers, and does not need generic params


headers (dict) – additional headers to be passed through as a dictionary

execute(self, payload={})[source]

Execute the Opsgenie Alert call


payload (dict) – Opsgenie API Create Alert payload values See

Was this entry helpful?