oncall-engine/engine/apps/alerts/constants.py
Vadim Stepanov a727450d49
Public API: Acknowledge & Resolve actions (#3108)
# What this PR does

Makes it possible to acknowledge/unacknowledge and resolve/unresolve
alert groups via public API, and makes sure these actions are reflected
properly in the alert group timeline.

## Demo

```bash
curl --request POST \
     --header "Authorization: TOKEN" \
     http://localhost:8080/api/v1/alert_groups/IQMHLV8INB24N/resolve
```

<img width="651" alt="Screenshot 2023-10-04 at 16 05 27"
src="https://github.com/grafana/oncall/assets/20116910/d4e66868-0132-4b6b-95c7-8424fced7c0b">

## Which issue(s) this PR fixes

https://github.com/grafana/oncall/issues/3051

## 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-10-05 09:46:48 +01:00

24 lines
441 B
Python

from enum import Enum
from django.db.models import IntegerChoices
class ActionSource(IntegerChoices):
SLACK = 0, "Slack"
WEB = 1, "Web"
PHONE = 2, "Phone"
TELEGRAM = 3, "Telegram"
API = 4, "API"
TASK_DELAY_SECONDS = 1
NEXT_ESCALATION_DELAY = 5
# AlertGroup states verbal
class AlertGroupState(str, Enum):
FIRING = "firing"
ACKNOWLEDGED = "acknowledged"
RESOLVED = "resolved"
SILENCED = "silenced"