Bug 757 - Option to archive old logs on external disk. and de-archive when require

Review Request #317 — Created July 8, 2024 and submitted — Latest diff uploaded

apoorva.sn
AMP
amp_bug_fixes_base_3_6_0
757
pmurugaiyan, prajesh, shuinvy

Problem

Need option to archive or unarchive logs to external(secondary) disk. Extending this functionality to archive or unarchive to Primary storage as well

Solution

Introduced new URL's from REST API to archive and unarhive and list the archived files
POST /log/archive To archive the log files in Primary or Secondary location
POST log/unarchive To UnArchive the log files in Primary or Secondary location
GET archives?location=(primary or secondary) To list the archive files in primary or secondary location

Tested the URL's from REST API

GET https://192.168.162.141:8888/log/archives?location=primary

{
"status": "success",
"file_list": [
"logs_20240705_112441.zip",
"logs_20240705_102133.zip",
"logs_20240705_102715.zip",
"logs_20240705_103751.zip",
"logs_20240705_100501.zip"
]
}

POST https://192.168.162.141:8888/log/archive
Request:

{
"location": "secondary"
}

Response:

{
"status": "Archive logs_20240708_084453.zip was successfully created in secondary storage"
}

POST https://192.168.162.141:8888/log/unarchive

Request:
{
"filename": "logs_20240705_112548.zip",
"location": "secondary"
}

Response:
{
"status": "logs_20240705_112548.zip is extracted successfully in secondary storage"
}

    Loading...