AA-2485: Backend - Configure External Storage for Backups

Review Request #789 — Created April 11, 2025 and submitted — Latest diff uploaded

apoorva.sn
AMP
AA-2485
pmurugaiyan, prajesh, shuinvy

Problem:
Need to configure external storage details and take backup on backup storage and restore from external storage.
Also need to list the backups taken locally and remote storage. Allow the delete of locally stored backups

Solution
Made changes for
1. Saving backup info in DB and listing backups
2. Saving external storage
3. Getting details for external storage
4. Saving the backup to external storage
5. restoring backup from external storage.
6. Getting backup status
7. Deleting backup taken locally

POST https://192.168.162.162:8888/backup/start

{
"backup_target": "local/remote"
}

GET https://192.168.162.162:8888/backup/status

Response:
{
"status": "Completed",
"details": "No Backup in progress!"
}

{
"status": "In-progress",
"details": "Currently a Backup is in progress"
}

POST https://192.168.162.162:8888/backup/remote_storage

Request:
{
"ip_address": "192.168.162.141",
"username": "test",
"password": "4bqbd3r1uh",
"path": "/tmp"

}

Response:
{
"message": "Updated remote storage details successfully!"
}

GET https://192.168.162.162:8888/backup/remote_storage

{
"username": "192.168.162.141",
"ip": 1,
"password": "test",
"path": "4bqbd3r1uh"
}

GET https://192.168.162.162:8888/backup/files

[
{
"status": "Completed",
"time": "2025-04-09T18:30:39.894249",
"filename": "backup_20250409_183039.tar.gz"
},
{
"status": "Completed",
"time": "2025-04-09T19:28:38.119522",
"filename": "backup_20250409_192838.tar.gz"
},
{
"status": "In-progress",
"time": "2025-04-09T19:29:30.284167",
"filename": "backup_20250409_192930.tar.gz"
}
]

POST https://192.168.162.162:8888/restore/start

{
"filename": "backup_20250409_215943.tar.gz",
"backup_target": "local/remote"
}

Response:
{
"message": "Restore completed."
}

GET https://192.168.162.162:8888/restore/status

Response:
{
"status": "Completed",
"message": "Restore Completed Successfully at 2025-04-11 14:42:08 - Restore completed"
}

DELETE https://192.168.162.162:8888/backup/file?filename=backup_20250410_193024.tar.gz

{
"message": "Successfully deleted backup file: backup_20250410_193024.tar.gz"
}

    Loading...