mirror of
https://github.com/grafana/grafana.git
synced 2025-02-10 15:45:43 -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)
|
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 {
|
for _, s := range runs {
|
||||||
// attempt to bind the raw result to a list of response item DTOs
|
runList.Runs = append(runList.Runs, cloudmigration.MigrateDataResponseListDTO{
|
||||||
r := cloudmigration.MigrateDataResponseDTO{
|
RunID: s.ID,
|
||||||
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)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return runList, nil
|
return runList, nil
|
||||||
|
@ -66,7 +66,7 @@ func (r CloudMigrationRun) ToResponse() (*MigrateDataResponseDTO, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type CloudMigrationRunList struct {
|
type CloudMigrationRunList struct {
|
||||||
Runs []MigrateDataResponseDTO `json:"runs"`
|
Runs []MigrateDataResponseListDTO `json:"runs"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// swagger:parameters createMigration
|
// swagger:parameters createMigration
|
||||||
@ -176,6 +176,10 @@ type MigrateDataResponseDTO struct {
|
|||||||
Items []MigrateDataResponseItemDTO `json:"items"`
|
Items []MigrateDataResponseItemDTO `json:"items"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type MigrateDataResponseListDTO struct {
|
||||||
|
RunID int64 `json:"id"`
|
||||||
|
}
|
||||||
|
|
||||||
type MigrateDataResponseItemDTO struct {
|
type MigrateDataResponseItemDTO struct {
|
||||||
// required:true
|
// required:true
|
||||||
Type MigrateDataType `json:"type"`
|
Type MigrateDataType `json:"type"`
|
||||||
|
@ -13067,7 +13067,7 @@
|
|||||||
"runs": {
|
"runs": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"$ref": "#/definitions/MigrateDataResponseDTO"
|
"$ref": "#/definitions/MigrateDataResponseListDTO"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -16259,6 +16259,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"MigrateDataResponseListDTO": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "integer",
|
||||||
|
"format": "int64"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"MoveFolderCommand": {
|
"MoveFolderCommand": {
|
||||||
"description": "MoveFolderCommand captures the information required by the folder service\nto move a folder.",
|
"description": "MoveFolderCommand captures the information required by the folder service\nto move a folder.",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
@ -3689,7 +3689,7 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"runs": {
|
"runs": {
|
||||||
"items": {
|
"items": {
|
||||||
"$ref": "#/components/schemas/MigrateDataResponseDTO"
|
"$ref": "#/components/schemas/MigrateDataResponseListDTO"
|
||||||
},
|
},
|
||||||
"type": "array"
|
"type": "array"
|
||||||
}
|
}
|
||||||
@ -6883,6 +6883,15 @@
|
|||||||
],
|
],
|
||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
|
"MigrateDataResponseListDTO": {
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"format": "int64",
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
"MoveFolderCommand": {
|
"MoveFolderCommand": {
|
||||||
"description": "MoveFolderCommand captures the information required by the folder service\nto move a folder.",
|
"description": "MoveFolderCommand captures the information required by the folder service\nto move a folder.",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
Loading…
Reference in New Issue
Block a user