make path singular

This commit is contained in:
Elfo404 2022-07-19 14:18:32 +02:00
parent 4585d81af1
commit 420c3d315e
No known key found for this signature in database
GPG Key ID: 586539D9491F0726
3 changed files with 4 additions and 4 deletions

View File

@ -19,14 +19,14 @@ This API can be used to define correlations between data sources.
## 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.
**Example request:**
```http
POST /api/datasources/uid/uyBf2637k/correlations HTTP/1.1
POST /api/datasources/uid/uyBf2637k/correlation HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJrIjoiT0tTcG1pUlY2RnVKZTFVaDFsNFZXdE9ZWmNrMkZYbk

View File

@ -4,7 +4,7 @@ import (
"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.
//

View File

@ -17,7 +17,7 @@ func (s *CorrelationsService) registerAPIEndpoints() {
uidScope := datasources.ScopeProvider.GetResourceScopeUID(ac.Parameter(":uid"))
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))
})
}