-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make a separate hook for interacting with the Pagerduty Events API #18784
Conversation
51536e1
to
8138eee
Compare
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
580550c
to
4190333
Compare
:param integration_key: PagerDuty Events API token | ||
:param pagerduty_conn_id: connection that has PagerDuty integration key in the Pagerduty API token field | ||
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we create a separate "pagerduty_events" type of connection ? Seems that those two different connection types have two different keys ? This is perfectly fine to define second type of connection for the the new hook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback! Yes indeed, the two different hook required different types of api keys.
I think we have a few options:
- keep it as is (probably causes some confusion to airflow users).
- a single connection type with two separate fields for the two tokens. The password field can be renamed as one token, and we can either rename an existing field or use an extra field for the other token. However, in that case only one of the tokens would behave as a password (as is automatically hidden from logs). Thinking about it, that is the current situation as well with the routing_key in the extra field.
- two separate connection types as you mentioned.
I think I would agree with you. Better to be explicit and have both token be hidden from logs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have pushed the changes to make it into two separate connection types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one!
In order to make use of the PagerDuty Events API, you need to provide two API keys in the PagerdutyHook connection, even though one of them is not required for the Events API.
The proposed setup is two have two separate hooks, one for accessing the general Pagerduty API, the other hook for interacting with the EventsAPI.
So I made the new PagerdutyEventsHook, which sole purpose is to interact with the Pagerduty Events API. However, in order to be back compatible the original PagerdutyHook still contains a method to interact with the EventsAPI, which under the hood makes use of the other hook.
closes: #18771