CloudMigration: Remove details from the migration run list (#87104)

Remove details from the migration run list
This commit is contained in:
bornohin6 2024-04-30 11:44:35 -07:00 committed by GitHub
parent 4312f2accd
commit 7ce1254913
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 29 additions and 13 deletions

View File

@ -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

View File

@ -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"`

View File

@ -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",

View File

@ -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": {