CloudMigration: Interpret error code from migration resource item (#94407)
* start on loading the error code * error code to message mapping * use resource code type * use defined error code * partial updates from comments * i18nKey gen * fixed t * fixed translations * typing
This commit is contained in:
@@ -390,6 +390,7 @@ func (cma *CloudMigrationAPI) GetSnapshot(c *contextmodel.ReqContext) response.R
|
||||
RefID: results[i].RefID,
|
||||
Status: ItemStatus(results[i].Status),
|
||||
Message: results[i].Error,
|
||||
ErrorCode: ItemErrorCode(results[i].ErrorCode),
|
||||
ParentName: results[i].ParentName,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,8 +113,9 @@ type MigrateDataResponseItemDTO struct {
|
||||
// required:true
|
||||
RefID string `json:"refId"`
|
||||
// required:true
|
||||
Status ItemStatus `json:"status"`
|
||||
Message string `json:"message,omitempty"`
|
||||
Status ItemStatus `json:"status"`
|
||||
Message string `json:"message,omitempty"`
|
||||
ErrorCode ItemErrorCode `json:"errorCode,omitempty"`
|
||||
}
|
||||
|
||||
// swagger:enum MigrateDataType
|
||||
@@ -143,6 +144,21 @@ const (
|
||||
ItemStatusUnknown ItemStatus = "UNKNOWN"
|
||||
)
|
||||
|
||||
// swagger:enum ItemErrorCode
|
||||
type ItemErrorCode string
|
||||
|
||||
const (
|
||||
ErrDatasourceNameConflict ItemErrorCode = "DATASOURCE_NAME_CONFLICT"
|
||||
ErrDashboardAlreadyManaged ItemErrorCode = "DASHBOARD_ALREADY_MANAGED"
|
||||
ErrLibraryElementNameConflict ItemErrorCode = "LIBRARY_ELEMENT_NAME_CONFLICT"
|
||||
ErrUnsupportedDataType ItemErrorCode = "UNSUPPORTED_DATA_TYPE"
|
||||
ErrResourceConflict ItemErrorCode = "RESOURCE_CONFLICT"
|
||||
ErrUnexpectedStatus ItemErrorCode = "UNEXPECTED_STATUS_CODE"
|
||||
ErrInternalServiceError ItemErrorCode = "INTERNAL_SERVICE_ERROR"
|
||||
ErrOnlyCoreDataSources ItemErrorCode = "ONLY_CORE_DATA_SOURCES"
|
||||
ErrGeneric ItemErrorCode = "GENERIC_ERROR"
|
||||
)
|
||||
|
||||
// swagger:parameters getCloudMigrationRun
|
||||
type GetMigrationRunParams struct {
|
||||
// RunUID of a migration run
|
||||
|
||||
Reference in New Issue
Block a user