Alerting: Update forking request handlers to use the same errors (#52965)

* generalize error handling in forking request handlers
* remove MatchesBackend and change test to test Can
* add 404 to route specs
* change backendTypeByUID to getDatasourceByUID of expected type
* use common errors in api testing
* handle 401 in errorToResponse
* replace backend type error with "unexpected datasource type"
* update swagger spec
This commit is contained in:
Yuriy Tseretyan
2022-08-02 09:33:59 -04:00
committed by GitHub
parent 28e27e1365
commit 718620c197
15 changed files with 3204 additions and 596 deletions
@@ -19,6 +19,7 @@ import (
//
// Responses:
// 200: RuleResponse
// 404: NotFound
// swagger:route GET /api/prometheus/grafana/api/v1/alerts prometheus RouteGetGrafanaAlertStatuses
//
@@ -33,6 +34,7 @@ import (
//
// Responses:
// 200: AlertResponse
// 404: NotFound
// swagger:model
type RuleResponse struct {