oncall-engine/engine/apps/api/views
Joey Orlando eb0f465970
add get_cached_oncall_users_for_multiple_schedules method + add DELETE /alertgroups/<id> internal API endpoint (#3280)
# What this PR does

This PR:
- adds a new method
`apps.schedules.ical_utils.get_cached_oncall_users_for_multiple_schedules`.
In short this method basically adds a layer of caching on top of
`apps.schedules.ical_utils.get_oncall_users_for_multiple_schedules`. We
store one cache value for each schedule. Cache results are stored for 15
minutes. To me this feels like a good balance between improving
performance + returning stale results. Cache values are stored as:
  - key = `f"schedule_{schedule.public_primary_key}_oncall_users"`
- value = `[user.public_primary_key for user in
schedule.currently_oncall_users]`
- adds a `DELETE /alertgroups/<id>` internal API endpoint (needed by
Grafana Incident for the Add Responders integration)
- updates the `is_currently_oncall` query parameter for the `GET /users`
internal API endpoint to return ALL users when the query param value `==
"all"`

## Which issue(s) this PR fixes

https://github.com/grafana/oncall-private/issues/2264

## Checklist

- [x] Unit, integration, and e2e (if applicable) tests updated
- [x] Documentation added (or `pr:no public docs` PR label added if not
required)
- [x] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
2023-11-06 15:30:32 -05:00
..
__init__.py World, meet OnCall! 2022-06-03 08:09:47 -06:00
alert_group.py add get_cached_oncall_users_for_multiple_schedules method + add DELETE /alertgroups/<id> internal API endpoint (#3280) 2023-11-06 15:30:32 -05:00
alert_receive_channel.py Add labels implementation for integration (#3014) 2023-10-20 07:30:11 +00:00
alert_receive_channel_template.py Fix resource duplication caused by available_teams_lookup_args (#1593) 2023-03-22 15:43:32 +08:00
alerts.py Add alert detail view (#385) 2022-08-19 14:03:07 +05:00
auth.py Reworked slack login pipeline errors (#2526) 2023-07-18 13:31:11 +00:00
channel_filter.py Fix duplicate orders on routes and escalation policies (#2568) 2023-07-18 17:17:53 +00:00
custom_button.py Fix MultipleObjectsReturned error on webhook endpoints (#1996) 2023-05-23 16:23:06 +00:00
escalation_chain.py Add mobile app auth on integration & escalation chain endpoints (#3056) 2023-09-26 16:31:26 +01:00
escalation_policy.py remove two unused feature flags (#2734) 2023-08-02 14:07:47 -04:00
features.py Add labels implementation for integration (#3014) 2023-10-20 07:30:11 +00:00
integration_heartbeat.py Fix resource duplication caused by available_teams_lookup_args (#1593) 2023-03-22 15:43:32 +08:00
labels.py Alert group labels filter (#3238) 2023-11-06 10:31:12 +00:00
live_setting.py Fix Telegram ratelimit on live setting change (#2100) 2023-06-06 15:18:12 +00:00
on_call_shifts.py Update insight logs for shift swaps requests (#2987) 2023-09-07 11:49:33 +00:00
organization.py Handle None role when syncing users from Grafana (#3147) 2023-10-19 17:39:08 +00:00
paging.py Updates to POST /direct_paging internal API endpoint to support Grafana Incident use-cases (#3232) 2023-11-01 17:19:44 -04:00
preview_template_options.py Fix of templates api behaviour for public and private api (#1408) 2023-03-01 16:32:15 +08:00
public_api_tokens.py Add RBAC Support (#777) 2022-11-29 09:41:56 +01:00
resolution_note.py Add mobile app auth on integration & escalation chain endpoints (#3056) 2023-09-26 16:31:26 +01:00
route_regex_debugger.py remove references to AlertGroup.is_archived and AlertGroup.unarchived_objects (#2524) 2023-07-18 11:48:34 +00:00
schedule.py Fix iCal imported schedules related users and next shifts per user (#3178) 2023-10-23 22:15:02 +00:00
shift_swap.py Notify user when their shift swap request is taken (#2992) 2023-09-07 14:59:54 +00:00
slack_channel.py Handle None role when syncing users from Grafana (#3147) 2023-10-19 17:39:08 +00:00
slack_team_settings.py Handle None role when syncing users from Grafana (#3147) 2023-10-19 17:39:08 +00:00
team.py add get_cached_oncall_users_for_multiple_schedules method + add DELETE /alertgroups/<id> internal API endpoint (#3280) 2023-11-06 15:30:32 -05:00
telegram_channels.py apps.get_model -> import (#2619) 2023-07-25 09:43:23 +00:00
user.py add get_cached_oncall_users_for_multiple_schedules method + add DELETE /alertgroups/<id> internal API endpoint (#3280) 2023-11-06 15:30:32 -05:00
user_group.py Handle None role when syncing users from Grafana (#3147) 2023-10-19 17:39:08 +00:00
user_notification_policy.py WIP: Direct paging improvements (#3064) 2023-09-28 03:57:49 +00:00
webhooks.py Add webhook presets (#2996) 2023-09-27 07:22:52 -06:00