-
-
branches/amp_3_7/src/webui/webui/htdocs/new/src/hive/controller/backup_controller.py (Diff revision 1) why 400? if there is a exception server side 500+ should be used.
-
AA-2491: Restore Backups
Review Request #730 — Created March 19, 2025 and submitted
| Information | |
|---|---|
| apoorva.sn | |
| AMP | |
| amp_3_7 | |
| AA-2491 | |
| Reviewers | |
| pmurugaiyan, prajesh, shuinvy | |
Problem
Restore backup given the backup file
Solution
Have introduced new endpoint /restore/start to restore the backup from file to the system
Since this is happening as part of same process returning the response as part of same API once restore is completedIntroduced new API /restore/status to get the status of the restore in case when user 1st logs into the system and also might move away from the page
https://192.168.162.141:8888/restore/start
backup_file = backup_20250312_195045.tar.gz
Rsponse:
{
"message": "Restore completed."
}https://192.168.162.162:8888/restore/start
backup_file=AMP_Bug_Scrubbing_May_2024.xlsxResponse:
{
"message": "Invalid file type. please upload file with extention tar.gz",
"error": 405
}https://192.168.162.162:8888/restore/status
Response:
when there are no logs from previous restore
{
"status": "N/A",
"message": "No logs found"
}when currently restore is in progresss
{
"status": "In-Progress",
"message": "Restore in Progress!"
}when restore is completed successfully
{
"status": "Completed",
"message": "Restore Completed Successfully at 2025-03-25 14:51:20 - Restore completed"
}
| Description | From | Last Updated |
|---|---|---|
|
why 400? if there is a exception server side 500+ should be used. |
|
|
|
Should we take up a back up before restoring? |
|
|
|
400, Bad Request. |
|
|
|
Is this a success scenario? |
|
-
-
branches/amp_3_7/src/webui/webui/htdocs/new/src/hive/controller/restore_controller.py (Diff revision 2) Is it possible to perform some security checks on uploaded files, too? For example, verifying the file type (content_type) to prevent users from uploading incorrect formats or file types. I know you have check r:gz files in the restore_backup_config function, I think if the file is incorrect, we may just return error message. It is just for suggestion~
Testing Done: |
|
|||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+234 -32)
|
Diff: |
Revision 4 (+277 -38)
|
|---|
-
-
branches/amp_3_7/src/webui/webui/htdocs/new/src/hive/controller/restore_controller.py (Diff revision 4) 400, Bad Request.
-
branches/amp_3_7/src/webui/webui/htdocs/new/src/hive/controller/restore_controller.py (Diff revision 4) Is this a success scenario?
Diff: |
Revision 5 (+277 -38)
|
|---|
Description: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Testing Done: |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Diff: |
Revision 6 (+287 -38)
|
