mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Alerting: modify prometheus endpoints for proxying using the datasource UID (#48052)
* Modify prometheus endpoints to expect the data source UID * Update frontend
This commit is contained in:
committed by
GitHub
parent
30d9cc81ec
commit
bb66c03f9a
@@ -88,8 +88,8 @@ func (api *API) authorize(method, path string) web.Handler {
|
||||
eval = ac.EvalPermission(ac.ActionAlertingInstancesExternalWrite, datasources.ScopeProvider.GetResourceScopeUID(ac.Parameter(":DatasourceUID")))
|
||||
|
||||
// Lotex Prometheus-compatible Paths
|
||||
case http.MethodGet + "/api/prometheus/{DatasourceID}/api/v1/rules":
|
||||
eval = ac.EvalPermission(ac.ActionAlertingRuleExternalRead, datasources.ScopeProvider.GetResourceScope(ac.Parameter(":DatasourceID")))
|
||||
case http.MethodGet + "/api/prometheus/{DatasourceUID}/api/v1/rules":
|
||||
eval = ac.EvalPermission(ac.ActionAlertingRuleExternalRead, datasources.ScopeProvider.GetResourceScopeUID(ac.Parameter(":DatasourceUID")))
|
||||
|
||||
// Lotex Rules testing
|
||||
case http.MethodPost + "/api/v1/rule/test/{DatasourceID}":
|
||||
@@ -140,8 +140,8 @@ func (api *API) authorize(method, path string) web.Handler {
|
||||
eval = ac.EvalPermission(ac.ActionAlertingInstancesExternalWrite, datasources.ScopeProvider.GetResourceScopeUID(ac.Parameter(":DatasourceUID")))
|
||||
|
||||
// Prometheus-compatible Paths
|
||||
case http.MethodGet + "/api/prometheus/{DatasourceID}/api/v1/alerts":
|
||||
eval = ac.EvalPermission(ac.ActionAlertingInstancesExternalRead, datasources.ScopeProvider.GetResourceScope(ac.Parameter(":DatasourceID")))
|
||||
case http.MethodGet + "/api/prometheus/{DatasourceUID}/api/v1/alerts":
|
||||
eval = ac.EvalPermission(ac.ActionAlertingInstancesExternalRead, datasources.ScopeProvider.GetResourceScopeUID(ac.Parameter(":DatasourceUID")))
|
||||
|
||||
// Notification Policies, Contact Points and Templates
|
||||
|
||||
|
||||
Reference in New Issue
Block a user