Alerting provisioning API
Consumes
- application/json
Produces
- application/json
Alert rules
Contact points
Method | URI | Name | Summary |
---|---|---|---|
GET | /api/v1/provisioning/contact-points | route get contactpoints | Get all the contact points. |
POST | /api/v1/provisioning/contact-points | Create a contact point. | |
PUT | /api/v1/provisioning/contact-points/{UID} | route put contactpoint | Update an existing contact point. |
DELETE | /api/v1/provisioning/contact-points/{UID} | Delete a contact point. |
Notification policies
Method | URI | Name | Summary |
---|---|---|---|
GET | /api/v1/provisioning/policies | Get the notification policy tree. | |
PUT | /api/v1/provisioning/policies | route put policy tree | Sets the notification policy tree. |
Mute timings
Method | URI | Name | Summary |
---|---|---|---|
GET | /api/v1/provisioning/mute-timings | route get mute timings | Get all the mute timings. |
GET | /api/v1/provisioning/mute-timings/{name} | Get a mute timing. | |
POST | /api/v1/provisioning/mute-timings | route post mute timing | Create a new mute timing. |
PUT | /api/v1/provisioning/mute-timings/{name} | Replace an existing mute timing. | |
DELETE | /api/v1/provisioning/mute-timings/{name} | route delete mute timing | Delete a mute timing. |
Templates
Method | URI | Name | Summary |
---|---|---|---|
GET | /api/v1/provisioning/templates | route get templates | Get all message templates. |
GET | /api/v1/provisioning/templates/{name} | Get a message template. | |
PUT | /api/v1/provisioning/templates/{name} | route put template | Creates or updates a template. |
DELETE | /api/v1/provisioning/templates/{name} | Delete a template. |
Delete a specific alert rule by UID. (RouteDeleteAlertRule)
Parameters
Name | Source | Type | Go type | Separator | Required | Default | Description |
---|---|---|---|---|---|---|---|
UID | string | string | ✓ |
All responses
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
204 | No Content | The alert rule was deleted successfully. | ||
400 | Bad Request | ValidationError |
Responses
204 - The alert rule was deleted successfully.
Status: No Content
Schema
400 - ValidationError
Status: Bad Request
Schema
Delete a contact point. (RouteDeleteContactpoints)
DELETE /api/v1/provisioning/contact-points/{UID}
Consumes
- application/json
Parameters
Name | Source | Type | Go type | Separator | Required | Default | Description |
---|---|---|---|---|---|---|---|
UID | path | string | string | ✓ | UID should be the contact point unique identifier |
All responses
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
202 | Accepted | Ack | ||
400 | Bad Request | ValidationError |
Responses
202 - Ack
Status: Accepted
Schema
400 - ValidationError
Status: Bad Request
Schema
Delete a mute timing. (RouteDeleteMuteTiming)
DELETE /api/v1/provisioning/mute-timings/{name}
Parameters
Name | Source | Type | Go type | Separator | Required | Default | Description |
---|---|---|---|---|---|---|---|
name | path | string | string | ✓ | Template Name |
All responses
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
204 | No Content | Ack |
Responses
204 - Ack
Status: No Content
Schema
Delete a template. (RouteDeleteTemplate)
DELETE /api/v1/provisioning/templates/{name}
Parameters
Name | Source | Type | Go type | Separator | Required | Default | Description |
---|---|---|---|---|---|---|---|
name | path | string | string | ✓ | Template Name |
All responses
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
No Content | Ack | schema |
Responses
204 - Ack
Status: No Content
Schema
Get a specific alert rule by UID. (RouteGetAlertRule)
GET /api/v1/provisioning/alert-rules/{UID}
Parameters
Name | Source | Type | Go type | Separator | Required | Default | Description |
---|---|---|---|---|---|---|---|
UID | path | string | string | ✓ |
All responses
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
200 | OK | AlertRule | ||
400 | Bad Request | ValidationError |
Responses
200 - AlertRule
Status: OK
Schema
400 - ValidationError
Status: Bad Request
Schema
Get all the contact points. (RouteGetContactpoints)
GET /api/v1/provisioning/contact-points
All responses
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
OK | Route | schema | ||
Bad Request | ValidationError | schema |
Responses
200 - Route
Status: OK
Schema
400 - ValidationError
Status: Bad Request
Schema
Get a mute timing. (RouteGetMuteTiming)
Parameters
Name | Source | Type | Go type | Separator | Required | Default | Description |
---|---|---|---|---|---|---|---|
name | path | string | string | ✓ | Template Name |
All responses
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
OK | MuteTimeInterval | schema | ||
Bad Request | ValidationError | schema |
Responses
200 - MuteTimeInterval
Status: OK
Schema
400 - ValidationError
Status: Bad Request
Schema
Get all the mute timings. (RouteGetMuteTimings)
GET /api/v1/provisioning/mute-timings
All responses
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
200 | OK | MuteTimings | ||
400 | Bad Request | ValidationError |
Responses
200 - MuteTimings
Status: OK
Schema
400 - ValidationError
Status: Bad Request
Schema
Get the notification policy tree. (RouteGetPolicyTree)
GET /api/v1/provisioning/policies
All responses
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
OK | Route | schema | ||
Bad Request | ValidationError | schema |
Responses
200 - Route
Status: OK
Schema
400 - ValidationError
Status: Bad Request
Schema
GET /api/v1/provisioning/templates/{name}
Parameters
All responses
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
OK | MessageTemplate | schema | ||
Not Found | NotFound | schema |
Responses
200 - MessageTemplate
Status: OK
Schema
404 - NotFound
Schema
Get all message templates. (RouteGetTemplates)
GET /api/v1/provisioning/templates
All responses
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
200 | OK | MessageTemplate | ||
400 | Bad Request | ValidationError |
Responses
200 - MessageTemplate
Status: OK
Schema
400 - ValidationError
Status: Bad Request
Schema
Create a new alert rule. (RoutePostAlertRule)
POST /api/v1/provisioning/alert-rules
Parameters
Name | Source | Type | Go type | Separator | Required | Default | Description |
---|---|---|---|---|---|---|---|
Body | body | models.AlertRule |
All responses
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
Created | AlertRule | schema | ||
Bad Request | ValidationError | schema |
Responses
201 - AlertRule
Status: Created
Schema
400 - ValidationError
Status: Bad Request
Schema
Create a contact point. (RoutePostContactpoints)
Consumes
- application/json
Parameters
Name | Source | Type | Go type | Separator | Required | Default | Description |
---|---|---|---|---|---|---|---|
Body | body | models.EmbeddedContactPoint |
All responses
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
Accepted | Ack | schema | ||
Bad Request | ValidationError | schema |
Responses
202 - Ack
Status: Accepted
Schema
400 - ValidationError
Status: Bad Request
Schema
Create a new mute timing. (RoutePostMuteTiming)
POST /api/v1/provisioning/mute-timings
Consumes
- application/json
Parameters
Name | Source | Type | Go type | Separator | Required | Default | Description |
---|---|---|---|---|---|---|---|
Body | body | models.MuteTimeInterval |
All responses
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
Created | MuteTimeInterval | schema | ||
Bad Request | ValidationError | schema |
Responses
201 - MuteTimeInterval
Status: Created
Schema
400 - ValidationError
Status: Bad Request
Schema
Update an existing alert rule. (RoutePutAlertRule)
PUT /api/v1/provisioning/alert-rules/{UID}
Consumes
- application/json
Parameters
Name | Source | Type | Go type | Separator | Required | Default | Description |
---|---|---|---|---|---|---|---|
UID | path | string | string | ✓ | |||
Body | body | models.AlertRule |
All responses
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
OK | AlertRule | schema | ||
Bad Request | ValidationError | schema |
Responses
200 - AlertRule
Status: OK
Schema
400 - ValidationError
Status: Bad Request
Schema
Update the interval of a rule group. (RoutePutAlertRuleGroup)
PUT /api/v1/provisioning/folder/{FolderUID}/rule-groups/{Group}
Consumes
- application/json
Parameters
Name | Source | Type | Go type | Separator | Required | Default | Description |
---|---|---|---|---|---|---|---|
FolderUID | path | string | string | ✓ | |||
Group | path | string | string | ✓ | |||
Body | body | models.AlertRuleGroup |
All responses
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
OK | AlertRuleGroup | schema | ||
Bad Request | ValidationError | schema |
Responses
200 - AlertRuleGroup
Status: OK
Schema
400 - ValidationError
Status: Bad Request
Schema
Update an existing contact point. (RoutePutContactpoint)
PUT /api/v1/provisioning/contact-points/{UID}
Consumes
- application/json
Parameters
Name | Source | Type | Go type | Separator | Required | Default | Description |
---|---|---|---|---|---|---|---|
UID | path | string | ✓ | UID should be the contact point unique identifier | |||
Body | body | models.EmbeddedContactPoint |
All responses
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
Accepted | Ack | schema | ||
Bad Request | ValidationError | schema |
Responses
202 - Ack
Status: Accepted
Schema
400 - ValidationError
Status: Bad Request
Schema
Replace an existing mute timing. (RoutePutMuteTiming)
PUT /api/v1/provisioning/mute-timings/{name}
Consumes
- application/json
Parameters
Name | Source | Type | Go type | Separator | Required | Default | Description |
---|---|---|---|---|---|---|---|
name | path | string | string | ✓ | Template Name | ||
Body | body | models.MuteTimeInterval |
All responses
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
OK | MuteTimeInterval | schema | ||
Bad Request | ValidationError | schema |
Responses
200 - MuteTimeInterval
Status: OK
Schema
400 - ValidationError
Status: Bad Request
Schema
Sets the notification policy tree. (RoutePutPolicyTree)
Consumes
- application/json
Parameters
Name | Source | Type | Go type | Separator | Required | Default | Description |
---|---|---|---|---|---|---|---|
Body | body | models.Route |
All responses
Code | Status | Description | Has headers | Schema |
---|---|---|---|---|
Accepted | Ack | schema | ||
Bad Request | ValidationError | schema |
Responses
202 - Ack
Schema
400 - ValidationError
Status: Bad Request
Schema
Updates an existing template. (RoutePutTemplate)
PUT /api/v1/provisioning/templates/{name}
Consumes
- application/json
Parameters
Name | Source | Type | Go type | Separator | Required | Default | Description |
---|---|---|---|---|---|---|---|
name | path | string | string | ✓ | Template Name | ||
Body | body | models.MessageTemplateContent |
All responses
Responses
202 - Ack
Status: Accepted
Schema
400 - ValidationError
Status: Bad Request
Schema
AlertQuery
Properties
Name | Type | Go type | Required | Default | Description | Example |
---|---|---|---|---|---|---|
DatasourceUID | string | string | Grafana data source unique identifier; it should be ‘-100’ for a Server Side Expression operation. | |||
Model | object | interface{} | JSON is the raw JSON query and includes the above properties as well as custom properties. | |||
QueryType | string | string | QueryType is an optional identifier for the type of query. | |||
It can be used to distinguish different types of queries. | ||||||
RefID | string | string | RefID is the unique identifier of the query, set by the frontend call. | |||
relativeTimeRange | RelativeTimeRange |
AlertRule
Properties
Name | Type | Go type | Required | Default | Description | Example |
---|---|---|---|---|---|---|
Annotations | map of string | map[string]string | {“runbookurl”:” | |||
Condition | string | string | ✓ | A | ||
Data | []alertquery | []*AlertQuery | ✓ | [{“datasourceUid”:”-100”,”model”:{“conditions”:[{“evaluator”:{“params”:[0,0],”type”:”gt”},”operator”:{“type”:”and”},”query”:{“params”:[]},”reducer”:{“params”:[],”type”:”avg”},”type”:”query”}],”datasource”:{“type”:”expr“,”uid”:”_expr“},”expression”:”1 == 1”,”hide”:false,”intervalMs”:1000,”maxDataPoints”:43200,”refId”:”A”,”type”:”math”},”queryType”:””,”refId”:”A”,”relativeTimeRange”:{“from”:0,”to”:0}}] | ||
ExecErrState | string | string | ✓ | Allowed values: “OK”, “Alerting”, “Error” | ||
FolderUID | string | string | ✓ | project_x | ||
ID | int64 (formatted integer) | int64 | ||||
Labels | map of string | map[string]string | {“team”:”sre-team-1”} | |||
NoDataState | string | string | ✓ | Allowed values: “OK”, “NoData”, “Error” | ||
OrgID | int64 (formatted integer) | int64 | ✓ | |||
RuleGroup | string | string | ✓ | eval_group_1 | ||
Title | string | string | ✓ | Always firing | ||
UID | string | string | ||||
Updated | date-time (formatted string) | strfmt.DateTime | ||||
for | Duration | ✓ | ||||
provenance | string | Provenance |
AlertRuleGroup
Properties
Name | Type | Go type | Required | Default | Description | Example |
---|---|---|---|---|---|---|
Interval | int64 (formatted integer) | int64 |
DayOfMonthRange
Properties
Name | Type | Go type | Required | Default | Description | Example |
---|---|---|---|---|---|---|
Begin | int64 (formatted integer) | int64 | ||||
End | int64 (formatted integer) | int64 |
Duration
Name | Type | Go type | Default | Description | Example |
---|---|---|---|---|---|
Duration | int64 (formatted integer) | int64 |
EmbeddedContactPoint
Properties
Name | Type | Go type | Required | Default | Description | Example |
---|---|---|---|---|---|---|
DisableResolveMessage | boolean | false | ||||
Name | string | string | ✓ | Name is used as grouping key in the UI. Contact points with the same name will be grouped in the UI. | webhook_1 | |
Provenance | string | string | ||||
Type | string | string | ✓ | webhook | ||
UID | string | string | UID is the unique identifier of the contact point. The UID can be set by the user. | my_external_reference | ||
settings | object | JSON | ✓ |
Name | Type | Go type | Default | Description | Example |
---|---|---|---|---|---|
MatchType | int64 (formatted integer) | int64 | 0 = MatchEqual, 1 = MatchNotEqual, 2 = MatchRegexp, 3 = MatchNotRegexp |
Matcher
Properties
Name | Type | Go type | Required | Default | Description | Example |
---|---|---|---|---|---|---|
Name | string | string | ||||
Type | MatchType | MatchType | ||||
Value | string | string |
Matchers
Matchers is a slice of Matchers that is sortable, implements Stringer, and provides a Matches method to match a LabelSet against all Matchers in the slice. Note that some users of Matchers might require it to be sorted.
[]matcher
MessageTemplate
Properties
Name | Type | Go type | Required | Default | Description | Example |
---|---|---|---|---|---|---|
Name | string | string | ||||
Template | string | string | ||||
provenance | string | Provenance |
MessageTemplateContent
Properties
Name | Type | Go type | Required | Default | Description | Example |
---|---|---|---|---|---|---|
Template | string | string |
MonthRange
Properties
Name | Type | Go type | Required | Default | Description | Example |
---|---|---|---|---|---|---|
Begin | int64 (formatted integer) | int64 | ||||
End | int64 (formatted integer) | int64 |
MuteTimeInterval
Properties
Name | Type | Go type | Required | Default | Description | Example |
---|---|---|---|---|---|---|
Name | string | string | ||||
TimeIntervals | [] | []*TimeInterval |
MuteTimings
[]
NotFound
ObjectMatchers
Inlined models
RelativeTimeRange
Properties
Name | Type | Go type | Required | Default | Description | Example |
---|---|---|---|---|---|---|
from | Duration | Duration | ||||
to | Duration |
Route
A Route is a node that contains definitions of how to handle alerts.
Properties
Name | Type | Go type | Required | Default | Description | Example |
---|---|---|---|---|---|---|
Continue | boolean | bool | ||||
GroupByStr | []string | []string | ||||
MuteTimeIntervals | []string | []string | ||||
Receiver | string | string | ||||
Routes | [] | []*Route | ||||
group_interval | Duration | Duration | ||||
group_wait | Duration | |||||
object_matchers | ObjectMatchers | ObjectMatchers | ||||
provenance | string | Provenance | ||||
repeat_interval | Duration |
TimeInterval
Properties
Name | Type | Go type | Required | Default | Description | Example |
---|---|---|---|---|---|---|
DaysOfMonth | [] | []DayOfMonthRange | ||||
Months | []monthrange | []MonthRange | ||||
Times | [] | []TimeRange | ||||
Weekdays | []weekdayrange | []WeekdayRange | ||||
Years | [] | []*YearRange |
TimeRange
For example, 4:00PM to End of the day would Begin at 1020 and End at 1440.
Properties
Name | Type | Go type | Required | Default | Description | Example |
---|---|---|---|---|---|---|
EndMinute | int64 (formatted integer) | int64 | ||||
StartMinute | int64 (formatted integer) | int64 |
ValidationError
Properties
Name | Type | Go type | Required | Default | Description | Example |
---|---|---|---|---|---|---|
Msg | string | string |
WeekdayRange
Properties
Name | Type | Go type | Required | Default | Description | Example |
---|---|---|---|---|---|---|
Begin | int64 (formatted integer) | int64 | ||||
End | int64 (formatted integer) | int64 |
YearRange
Name | Type | Go type | Required | Default | Description | Example |
---|---|---|---|---|---|---|
Begin | int64 (formatted integer) | int64 | ||||
End | int64 (formatted integer) | int64 |