-
Notifications
You must be signed in to change notification settings - Fork 309
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
add POST /escalation
public API endpoint + add public API docs for teams/organization endpoints
#4815
add POST /escalation
public API endpoint + add public API docs for teams/organization endpoints
#4815
Conversation
|
||
if alert_group_id and (title or message or source_url or grafana_incident_id): | ||
raise serializers.ValidationError( | ||
"alert_group_id and (title, message, source_url, grafana_incident_id) are mutually exclusive" | ||
f"alert_group_id and (title, message, source_url{', grafana_incident_id' if self.ALLOWS_GRAFANA_INCIDENT_ID else ''}) " | ||
"are mutually exclusive" |
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.
this is here because the grafana_incident_id
is really only a concept that is relevant for the internal API (you cannot specify this attribute from the public API)
if attrs["users"] and attrs["team"]: | ||
raise serializers.ValidationError("users and team are mutually exclusive") |
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.
this is already the case if you perform this workflow from Slack or the web plugin UI, you cannot specify users and a team, we just weren't previously validating the payload for it. Added test cases for this:
POST /escalation
public API endpoint + add public API docs for teams/organization endpoints
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.
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.
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.
LGTM
What this PR does
POST /escalation
public endpoint (equivalent to the internal direct paging API endpoint)Which issue(s) this PR closes
Closes https://github.com/grafana/oncall-private/issues/2859
Closes #2448
Checklist
pr:no public docs
PR label added if not required)release:
). These labels dictate how your PR willshow up in the autogenerated release notes.