Option to clean up the 'primary' and 'secondary' storage

Review Request #302 — Created June 27, 2024 and submitted — Latest diff uploaded

apoorva.sn
AMP
amp_3_6_0
156
pmurugaiyan, prajesh, shuinvy

Problem

  1. 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
  2. The Error messages in AMP was not showing correct error code

Solution

  1. 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
}

  1. Have reformatted code for Exception to handle it in a single method to send HTTP Response back
  1. Tested the above API's in AMP
  2. 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
}

    Loading...