Option to clean up the 'primary' and 'secondary' storage
Review Request #302 — Created June 27, 2024 and submitted
| Information | |
|---|---|
| apoorva.sn | |
| AMP | |
| amp_3_6_0 | |
| 156 | |
| Reviewers | |
| pmurugaiyan, prajesh, shuinvy | |
Problem
- Need option from REST API to clean up both 'Primary' and 'Secondary' storage.
As of now we have only option to clean up Primary Storage- The Error messages in AMP was not showing correct error code
Solution
- Introduced new API 'storage/crontab?storage=secondary'
to get the details regarding the "Scheduled cleaning","Retention duration of Data" and "Maximum disk usage"{
"duration": "40",
"storage": "secondary",
"percent": "80",
"schedule": true
}'storage/crontab?storage=primary' provides details of primary storage
{
"duration": "40",
"storage": "primary",
"percent": "95",
"schedule": true
}POST storage/crontab
Request:
{
"duration": "42",
"storage": "primary",
"percent": "97",
"schedule": true
}Response:
{
"duration": "42",
"storage": "primary",
"percent": "97",
"schedule": true
}
- Have reformatted code for Exception to handle it in a single method to send HTTP Response back
- Tested the above API's in AMP
- Tested the error messages are shown correctly
POST /log/location
Request:
{
"message": "Error while creating partition",
"details": "Invalid location specified: . Valid values are primary and secondary",
"error": 400
}Response:
{
"message": "Error while creating partition",
"details": "Invalid location specified: . Valid values are primary and secondary",
"error": 400
}
