9a06b00e92
* Correlations: add DeleteCorrelation HTTP API * fix error message copy * add readonly check * add source_uid in delete condition * make path singular * Revert "make path singular" This reverts commit d15be89578e202e5cb64a3e964ee09521b72d87c. * add tests * fix lint errors * fix lint errors * change casing * update spec * Remove transaction * change casing in param name in docs
61 lines
1.4 KiB
Go
61 lines
1.4 KiB
Go
package definitions
|
|
|
|
import (
|
|
"github.com/grafana/grafana/pkg/services/correlations"
|
|
)
|
|
|
|
// swagger:route POST /datasources/uid/{sourceUID}/correlations correlations createCorrelation
|
|
//
|
|
// Add correlation.
|
|
//
|
|
// Responses:
|
|
// 200: createCorrelationResponse
|
|
// 400: badRequestError
|
|
// 401: unauthorisedError
|
|
// 403: forbiddenError
|
|
// 404: notFoundError
|
|
// 500: internalServerError
|
|
|
|
// swagger:parameters createCorrelation
|
|
type CreateCorrelationParams struct {
|
|
// in:body
|
|
// required:true
|
|
Body correlations.CreateCorrelationCommand `json:"body"`
|
|
// in:path
|
|
// required:true
|
|
SourceUID string `json:"sourceUID"`
|
|
}
|
|
|
|
//swagger:response createCorrelationResponse
|
|
type CreateCorrelationResponse struct {
|
|
// in: body
|
|
Body correlations.CreateCorrelationResponse `json:"body"`
|
|
}
|
|
|
|
// swagger:route DELETE /datasources/uid/{uid}/correlations/{correlationUID} correlations deleteCorrelation
|
|
//
|
|
// Delete a correlation.
|
|
//
|
|
// Responses:
|
|
// 200: deleteCorrelationResponse
|
|
// 401: unauthorisedError
|
|
// 403: forbiddenError
|
|
// 404: notFoundError
|
|
// 500: internalServerError
|
|
|
|
// swagger:parameters deleteCorrelation
|
|
type DeleteCorrelationParams struct {
|
|
// in:path
|
|
// required:true
|
|
DatasourceUID string `json:"uid"`
|
|
// in:path
|
|
// required:true
|
|
CorrelationUID string `json:"correlationUID"`
|
|
}
|
|
|
|
//swagger:response deleteCorrelationResponse
|
|
type DeleteCorrelationResponse struct {
|
|
// in: body
|
|
Body correlations.DeleteCorrelationResponse `json:"body"`
|
|
}
|