airflow.providers.opsgenie.hooks.opsgenie_alert

Module Contents

class airflow.providers.opsgenie.hooks.opsgenie_alert.OpsgenieAlertHook(opsgenie_conn_id: str = 'opsgenie_default', *args, **kwargs)[source]

Bases: airflow.providers.http.hooks.http.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 conn_id.host, and if not set will default to https://api.opsgenie.com.

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

Parameters

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

conn_name_attr = opsgenie_conn_id[source]
default_conn_name = opsgenie_default[source]
conn_type = opsgenie[source]
hook_name = Opsgenie[source]
get_conn(self, headers: Optional[dict] = None)[source]

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

Parameters

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

execute(self, payload: Optional[dict] = None)[source]

Execute the Opsgenie Alert call

Parameters

payload (dict) -- Opsgenie API Create Alert payload values See https://docs.opsgenie.com/docs/alert-api#section-create-alert

Was this entry helpful?