AA-2491: Restore Backups

Review Request #730 — Created March 19, 2025 and submitted

apoorva.sn
AMP
amp_3_7
AA-2491
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 completed

Introduced 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.xlsx

Response:
{
"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.

prajeshprajesh

Should we take up a back up before restoring?

prajeshprajesh

400, Bad Request.

pmurugaiyanpmurugaiyan

Is this a success scenario?

pmurugaiyanpmurugaiyan
prajesh
  1. 
      
  2. why 400? if there is a exception server side 500+ should be used.

    1. changed it .. copied from another place by mistake

  3. Should we take up a back up before restoring?

    1. we can do the backup task in this system before restore ? that will take care of this ?

    2. Yes.

  4. 
      
apoorva.sn
shuinvy
  1. 
      
  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~

  3. 
      
apoorva.sn
shuinvy
  1. Ship It!
  2. 
      
apoorva.sn
pmurugaiyan
apoorva.sn
apoorva.sn
prajesh
  1. Ship It!
  2. 
      
apoorva.sn
Review request changed

Status: Closed (submitted)

Loading...