-
-
branches/amp_3_7/src/webui/webui/htdocs/new/src/hive/controller/backup_controller.py (Diff revision 1) Shoud this be a another script and just call the script here?
AA-2489: Support On-Demand Backups
Review Request #710 — Created March 13, 2025 and submitted
| Information | |
|---|---|
| apoorva.sn | |
| AMP | |
| AA-2489 | |
| Reviewers | |
| pmurugaiyan, prajesh, shuinvy | |
Problem
Support of Backup functionality on AMP
Solution
Have made changes to support backup of postgres DB, Influx DB and SQLite file and also the running configuration on AMP.
Creating a tar file with these and storing it under /var/backups so that users are able to download it locally for now.
Created API for starting backup job and also to get the status of the ongoing backup
API to start backup
- POST https://192.168.162.162:8888/backup/start
Response:
{
"message": "Backup started!"
}
- GET https://192.168.162.162:8888/backup/status
Response when backup is in progress{
"message": "Backup In-progress!"
}Response when completed
{
"message": "Backup Completed!",
"Download url": "https://192.168.162.162:8888/backup/download?filename=backup_20250313_150909.tar.gz"
}
- GET https://192.168.162.162:8888/backup/download?filename=backup_20250313_150909.tar.gz
to download the backup file
| Description | From | Last Updated |
|---|---|---|
|
Can we use API versioning for the newly added APIs, so that we can differentiate from the legacy API for … |
|
|
|
BACKUP_FILE_SCRIPT ? |
|
|
|
else return.method == 'GET': if path == 'status': return backup_status(request) elif path == 'download': return download_backup(request.GET.get('filename')) else: # Raise Bad … |
|
|
|
Shoud this be a another script and just call the script here? |
|
|
|
"downloadURL" or "download_url" |
|
|
|
Can we create a separate file for the variables? |
|
|
|
Can there be multiple backups running at the same time? Should we stop issuing backups when one is already in … |
|
-
-
branches/amp_3_7/src/webui/webui/htdocs/new/src/djproject/urls.py (Diff revision 1) Can we use API versioning for the newly added APIs, so that we can differentiate from the legacy API for the future improvements.
-
branches/amp_3_7/src/webui/webui/htdocs/new/src/hive/controller/backup_controller.py (Diff revision 1) BACKUP_FILE_SCRIPT ?
-
branches/amp_3_7/src/webui/webui/htdocs/new/src/hive/controller/backup_controller.py (Diff revision 1) else return.method == 'GET':
if path == 'status':
return backup_status(request)
elif path == 'download':
return download_backup(request.GET.get('filename'))
else:
# Raise Bad Request Http ExceptionCan we simplify this.
-
branches/amp_3_7/src/webui/webui/htdocs/new/src/hive/controller/backup_controller.py (Diff revision 1) "downloadURL" or "download_url"
-
Diff: |
Revision 3 (+243 -2)
|
|---|
-
-
branches/amp_3_7/src/webui/webui/htdocs/new/src/hive/controller/backup_controller.py (Diff revision 3) Can there be multiple backups running at the same time? Should we stop issuing backups when one is already in progress?
