mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Correlations: Add UpdateCorrelation HTTP API (#52444)
* Correlations: add UpdateCorrelation HTTP API * handle correlation not found * add tests * fix lint errors * add bad request to API spec * change casing * fix casing in docs * fix tests * update spec
This commit is contained in:
@@ -9,8 +9,8 @@ var (
|
||||
ErrSourceDataSourceDoesNotExists = errors.New("source data source does not exist")
|
||||
ErrTargetDataSourceDoesNotExists = errors.New("target data source does not exist")
|
||||
ErrCorrelationFailedGenerateUniqueUid = errors.New("failed to generate unique correlation UID")
|
||||
ErrCorrelationIdentifierNotSet = errors.New("source identifier and org id are needed to be able to edit correlations")
|
||||
ErrCorrelationNotFound = errors.New("correlation not found")
|
||||
ErrUpdateCorrelationEmptyParams = errors.New("not enough parameters to edit correlation")
|
||||
)
|
||||
|
||||
// Correlation is the model for correlations definitions
|
||||
@@ -72,6 +72,28 @@ type DeleteCorrelationCommand struct {
|
||||
OrgId int64
|
||||
}
|
||||
|
||||
// swagger:model
|
||||
type UpdateCorrelationResponseBody struct {
|
||||
Result Correlation `json:"result"`
|
||||
// example: Correlation updated
|
||||
Message string `json:"message"`
|
||||
}
|
||||
|
||||
// UpdateCorrelationCommand is the command for updating a correlation
|
||||
type UpdateCorrelationCommand struct {
|
||||
// UID of the correlation to be deleted.
|
||||
UID string `json:"-"`
|
||||
SourceUID string `json:"-"`
|
||||
OrgId int64 `json:"-"`
|
||||
|
||||
// Optional label identifying the correlation
|
||||
// example: My label
|
||||
Label *string `json:"label"`
|
||||
// Optional description of the correlation
|
||||
// example: Logs to Traces
|
||||
Description *string `json:"description"`
|
||||
}
|
||||
|
||||
type DeleteCorrelationsBySourceUIDCommand struct {
|
||||
SourceUID string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user