Conversation
Created Events class compatible with Events API v2 (not to be confused with REST API v2) New API comes with new documented required fields and new optional fields. Documentation links provided at top of code for reference to the PD-CEF & Events API v2 Implemented enqueue() to allow for payload to be specified by caller. This allows direct use of the JSON produced for the request (better for unit-testing enqueue function) Note that summary/source/severity are still required, and throw a KeyError if not found in either kwargs or payload.
Similar to v1 test: directly tests the enqueue() function with a built-in event_action of "trigger"
https://v2.developer.pagerduty.com/docs/send-an-event-events-api-v2 Shows 'images' and 'links' outside of payload.
|
@cugini-dbx any thing blocking this PR from getting merged? |
cugini-dbx
left a comment
There was a problem hiding this comment.
Sorry for the delay in review. I just have one small comment around a some required field validation, otherwise it looks good to me!
pygerduty/events_v2.py
Outdated
| # Required (according to documentation) PD-CEF fields | ||
| data = {"event_action": kwargs['event_action']} | ||
| data['payload'] = kwargs.get('payload', {}) | ||
| for key in ['summary', 'source', 'severity']: |
There was a problem hiding this comment.
A teammate pointed out that payload is optional, but looks like this assumes payload is required (by checking for these three keys).
Even though payload is now optional, if it is specified, the fields within it are still checked as required
|
The rest of the Travis issues appear to be not associated with this PR... not sure how best to resolve them |
|
looks at watch |
|
|
|
Hello, I'm interested in this feature. Regards, |
No description provided.