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

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

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"
}

Description From Last Updated

archivefiles => arhive ?

prajeshprajesh

can we have only one HTTP method to support a particular API. PUT is generally for update. We can POST …

prajeshprajesh
apoorva.sn
shuinvy
  1. Ship It!
  2. 
      
prajesh
  1. 
      
    1. Changed to 'archives'

  2. can we have only one HTTP method to support a particular API. PUT is generally for update. We can POST here.. same is the case with arhcive,

  3. 
      
apoorva.sn
pmurugaiyan
  1. Ship It!
  2. 
      
apoorva.sn
apoorva.sn
apoorva.sn
Review request changed

Status: Closed (submitted)

Loading...