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

View File

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

View File

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

View File

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