mirror of
https://github.com/grafana/grafana.git
synced 2025-02-10 07:35:45 -06:00
CloudMigration: Remove details from the migration run list (#87104)
Remove details from the migration run list
This commit is contained in:
parent
4312f2accd
commit
7ce1254913
@ -497,17 +497,11 @@ func (s *Service) GetMigrationRunList(ctx context.Context, migrationID string) (
|
||||
return nil, fmt.Errorf("retrieving migration statuses from db: %w", err)
|
||||
}
|
||||
|
||||
runList := &cloudmigration.CloudMigrationRunList{Runs: []cloudmigration.MigrateDataResponseDTO{}}
|
||||
runList := &cloudmigration.CloudMigrationRunList{Runs: []cloudmigration.MigrateDataResponseListDTO{}}
|
||||
for _, s := range runs {
|
||||
// attempt to bind the raw result to a list of response item DTOs
|
||||
r := cloudmigration.MigrateDataResponseDTO{
|
||||
Items: []cloudmigration.MigrateDataResponseItemDTO{},
|
||||
}
|
||||
if err := json.Unmarshal(s.Result, &r); err != nil {
|
||||
return nil, fmt.Errorf("error unmarshalling migration response items: %w", err)
|
||||
}
|
||||
r.RunID = s.ID
|
||||
runList.Runs = append(runList.Runs, r)
|
||||
runList.Runs = append(runList.Runs, cloudmigration.MigrateDataResponseListDTO{
|
||||
RunID: s.ID,
|
||||
})
|
||||
}
|
||||
|
||||
return runList, nil
|
||||
|
@ -66,7 +66,7 @@ func (r CloudMigrationRun) ToResponse() (*MigrateDataResponseDTO, error) {
|
||||
}
|
||||
|
||||
type CloudMigrationRunList struct {
|
||||
Runs []MigrateDataResponseDTO `json:"runs"`
|
||||
Runs []MigrateDataResponseListDTO `json:"runs"`
|
||||
}
|
||||
|
||||
// swagger:parameters createMigration
|
||||
@ -176,6 +176,10 @@ type MigrateDataResponseDTO struct {
|
||||
Items []MigrateDataResponseItemDTO `json:"items"`
|
||||
}
|
||||
|
||||
type MigrateDataResponseListDTO struct {
|
||||
RunID int64 `json:"id"`
|
||||
}
|
||||
|
||||
type MigrateDataResponseItemDTO struct {
|
||||
// required:true
|
||||
Type MigrateDataType `json:"type"`
|
||||
|
@ -13067,7 +13067,7 @@
|
||||
"runs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/MigrateDataResponseDTO"
|
||||
"$ref": "#/definitions/MigrateDataResponseListDTO"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -16259,6 +16259,15 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"MigrateDataResponseListDTO": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"MoveFolderCommand": {
|
||||
"description": "MoveFolderCommand captures the information required by the folder service\nto move a folder.",
|
||||
"type": "object",
|
||||
|
@ -3689,7 +3689,7 @@
|
||||
"properties": {
|
||||
"runs": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/MigrateDataResponseDTO"
|
||||
"$ref": "#/components/schemas/MigrateDataResponseListDTO"
|
||||
},
|
||||
"type": "array"
|
||||
}
|
||||
@ -6883,6 +6883,15 @@
|
||||
],
|
||||
"type": "object"
|
||||
},
|
||||
"MigrateDataResponseListDTO": {
|
||||
"properties": {
|
||||
"id": {
|
||||
"format": "int64",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"type": "object"
|
||||
},
|
||||
"MoveFolderCommand": {
|
||||
"description": "MoveFolderCommand captures the information required by the folder service\nto move a folder.",
|
||||
"properties": {
|
||||
|
Loading…
Reference in New Issue
Block a user