mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
make path singular
This commit is contained in:
parent
4585d81af1
commit
420c3d315e
@ -19,14 +19,14 @@ This API can be used to define correlations between data sources.
|
|||||||
|
|
||||||
## Create correlations
|
## Create correlations
|
||||||
|
|
||||||
`POST /api/datasources/uid/:sourceUid/correlations`
|
`POST /api/datasources/uid/:sourceUid/correlation`
|
||||||
|
|
||||||
Creates a correlation between two data sources - the source data source indicated by the path UID, and the target data source which is specified in the body.
|
Creates a correlation between two data sources - the source data source indicated by the path UID, and the target data source which is specified in the body.
|
||||||
|
|
||||||
**Example request:**
|
**Example request:**
|
||||||
|
|
||||||
```http
|
```http
|
||||||
POST /api/datasources/uid/uyBf2637k/correlations HTTP/1.1
|
POST /api/datasources/uid/uyBf2637k/correlation HTTP/1.1
|
||||||
Accept: application/json
|
Accept: application/json
|
||||||
Content-Type: application/json
|
Content-Type: application/json
|
||||||
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"github.com/grafana/grafana/pkg/services/correlations"
|
"github.com/grafana/grafana/pkg/services/correlations"
|
||||||
)
|
)
|
||||||
|
|
||||||
// swagger:route POST /datasources/uid/{uid}/correlations correlations createCorrelation
|
// swagger:route POST /datasources/uid/{uid}/correlation correlations createCorrelation
|
||||||
//
|
//
|
||||||
// Add correlation.
|
// Add correlation.
|
||||||
//
|
//
|
||||||
|
@ -17,7 +17,7 @@ func (s *CorrelationsService) registerAPIEndpoints() {
|
|||||||
uidScope := datasources.ScopeProvider.GetResourceScopeUID(ac.Parameter(":uid"))
|
uidScope := datasources.ScopeProvider.GetResourceScopeUID(ac.Parameter(":uid"))
|
||||||
authorize := ac.Middleware(s.AccessControl)
|
authorize := ac.Middleware(s.AccessControl)
|
||||||
|
|
||||||
s.RouteRegister.Group("/api/datasources/uid/:uid/correlations", func(entities routing.RouteRegister) {
|
s.RouteRegister.Group("/api/datasources/uid/:uid/correlation", func(entities routing.RouteRegister) {
|
||||||
entities.Post("/", authorize(ac.ReqOrgAdmin, ac.EvalPermission(datasources.ActionWrite, uidScope)), routing.Wrap(s.createHandler))
|
entities.Post("/", authorize(ac.ReqOrgAdmin, ac.EvalPermission(datasources.ActionWrite, uidScope)), routing.Wrap(s.createHandler))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user