airflow.providers.pagerduty.hooks.pagerduty¶
Hook for sending or receiving data from PagerDuty as well as creating PagerDuty incidents.
Classes¶
The PagerdutyHook can be used to interact with both the PagerDuty API and the PagerDuty Events API. |
Module Contents¶
- class airflow.providers.pagerduty.hooks.pagerduty.PagerdutyHook(token=None, pagerduty_conn_id=None)[source]¶
Bases:
airflow.hooks.base.BaseHook
The PagerdutyHook can be used to interact with both the PagerDuty API and the PagerDuty Events API.
Takes both PagerDuty API token directly and connection that has PagerDuty API token. If both supplied, PagerDuty API token will be used. In these cases, the PagerDuty API token refers to an account token: https://support.pagerduty.com/docs/generating-api-keys#generating-a-general-access-rest-api-key https://support.pagerduty.com/docs/generating-api-keys#generating-a-personal-rest-api-key
In order to send events (with the Pagerduty Events API), you will also need to specify the routing_key (or Integration key) in the
extra
field- Parameters:
- classmethod get_connection_form_widgets()[source]¶
Return connection widgets to add to connection form.
- get_session()[source]¶
Return pdpyras.APISession for use with sending or receiving data through the PagerDuty REST API.
The pdpyras library supplies a class pdpyras.APISession extending requests.Session from the Requests HTTP library.
Documentation on how to use the APISession class can be found at: https://pagerduty.github.io/pdpyras/#data-access-abstraction