Alerting: Fix "Not Implemented" responses (#57710)

* fix swagger spec, return 404 instead of 501 when an endpoint does not exist

* update number of paths in authorization_test.go
This commit is contained in:
Santiago
2022-10-26 23:35:52 -03:00
committed by GitHub
parent 0a4121cef8
commit cdb5d4230a
11 changed files with 10 additions and 302 deletions
+1 -104
View File
@@ -3302,7 +3302,6 @@
"type": "object"
},
"alertGroups": {
"description": "AlertGroups alert groups",
"items": {
"$ref": "#/definitions/alertGroup"
},
@@ -3463,6 +3462,7 @@
"type": "object"
},
"gettableAlerts": {
"description": "GettableAlerts gettable alerts",
"items": {
"$ref": "#/definitions/gettableAlert"
},
@@ -3668,7 +3668,6 @@
"type": "array"
},
"postableSilence": {
"description": "PostableSilence postable silence",
"properties": {
"comment": {
"description": "comment",
@@ -3884,39 +3883,6 @@
"tags": [
"alertmanager"
]
},
"post": {
"description": "create alertmanager alerts",
"operationId": "RoutePostGrafanaAMAlerts",
"parameters": [
{
"in": "body",
"name": "PostableAlerts",
"schema": {
"items": {
"$ref": "#/definitions/postableAlert"
},
"type": "array"
}
}
],
"responses": {
"200": {
"description": "Ack",
"schema": {
"$ref": "#/definitions/Ack"
}
},
"400": {
"description": "ValidationError",
"schema": {
"$ref": "#/definitions/ValidationError"
}
}
},
"tags": [
"alertmanager"
]
}
},
"/api/alertmanager/grafana/api/v2/alerts/groups": {
@@ -4800,75 +4766,6 @@
]
}
},
"/api/alertmanager/{DatasourceUID}/config/api/v1/receivers/test": {
"post": {
"operationId": "RoutePostTestReceivers",
"parameters": [
{
"in": "body",
"name": "Body",
"schema": {
"$ref": "#/definitions/TestReceiversConfigBodyParams"
}
},
{
"description": "DatasoureUID should be the datasource UID identifier",
"in": "path",
"name": "DatasourceUID",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Ack",
"schema": {
"$ref": "#/definitions/Ack"
}
},
"207": {
"description": "MultiStatus",
"schema": {
"$ref": "#/definitions/MultiStatus"
}
},
"400": {
"description": "ValidationError",
"schema": {
"$ref": "#/definitions/ValidationError"
}
},
"403": {
"description": "PermissionDenied",
"schema": {
"$ref": "#/definitions/PermissionDenied"
}
},
"404": {
"description": "NotFound",
"schema": {
"$ref": "#/definitions/NotFound"
}
},
"408": {
"description": "Failure",
"schema": {
"$ref": "#/definitions/Failure"
}
},
"409": {
"description": "AlertManagerNotReady",
"schema": {
"$ref": "#/definitions/AlertManagerNotReady"
}
}
},
"summary": "Test Grafana managed receivers without saving them.",
"tags": [
"alertmanager"
]
}
},
"/api/prometheus/grafana/api/v1/alerts": {
"get": {
"description": "gets the current alerts",