Hi guys! I’m using Grafana Version 9.3.2 (commit: 21c1d14e91, branch: HEAD) on Debian 11 and I
have any questions.
I need to create an alert using api, but my attempts are unsuccessful.
I’m getting a message {"message":"Not found"}
, after sending a request to my domain https://test.net/api/v1/provisioning/alerts_rules
I’m using the next body for my POST requsets
{
"annotations": {
"summmary": "test text"
},
"condition": "B",
"data": [
{
"refId": "B",
"queryType": "",
"relativeTimeRange": {
"from": 0,
"to": 0
},
"datasourceUid": "IW8l57c7z",
"model": {
"conditions": [
{
"evaluator": {
"params": [
1000
],
"type": "gt"
},
"operator": {
"type": "and"
},
"query": {
"params": [
"A"
]
},
"reducer": {
"type": "sum"
}
}
],
"intervalMs": 1000,
"maxDataPoints": 43200,
"refId": "B",
"type": "classic_conditions"
}
}
],
"execErrState": "Error",
"folderUID": "OR2riNo4z",
"id": "",
"labels": {
"alertname": "alert-test-api"
},
"noDataState": "OK",
"orgID": 1,
"ruleGroup": "alert-test-api",
"title": "alert-test-api",
"uid": "0",
"for": "0"
}
The dashboard is present, but the api alert cannot be created. Am I doing something wrong or in the wrong order?
I would be grateful for a hint!
instructions taken from here