Bug 156: Option to create partition and mount from REST API
Review Request #296 — Created June 21, 2024 and submitted
| Information | |
|---|---|
| apoorva.sn | |
| AMP | |
| amp_3_6_0 | |
| 156 | |
| Reviewers | |
| pmurugaiyan, prajesh, shuinvy | |
Problem
Need option to find the free space available and provide the secondary storage information to the users. This is one time option provided to users.
The user can choose ‘primary’ or ‘secondary’ storage locations for storing logs
Solution
Implemented 3 API's
GET /log/location: which will provide details of the current log location
Response:
{
"location": "primary"
}POST/PUT /log/location: which will set the log location to 'primary' or 'secondary'
Request:
{
"location": "secondary"
}
Response:
{
"status": "success"
}- GET /log/storage?type=secondary
Response:
{
"used": 38797312,
"free": 9878424780,
"is_mounted": true,
"is_disk_available": true,
"total": 10522669875,
"disk_name": "/dev/sdb"
}
Tested the above API's through postman and verified the reponse. Also peri also tested from the UI side and it is working fine
| Description | From | Last Updated |
|---|---|---|
|
Can it be /storage?type=secondary? |
|
|
|
Can we remove the _view suffix from function names (maybe create a folder at the parent level called 'view' similar … |
|
|
|
Global variable |
|
|
|
This also can be a global variable as its a constant. |
|
|
|
these is exposing internal details of service layer.. can be wrapped in a service level exception.. Any thoughts? |
|
|
|
memory => additional disk space. Memory implies RAM. |
|
-
-
-
Can we remove the _view suffix from function names (maybe create a folder at the parent level called 'view' similar to services, and we can simply call the function with actual names, and so does the file names.
-
branches/amp_3_6_0/src/webui/webui/htdocs/new/src/hive/services/log_location_service.py (Diff revision 1) Global variable
-
branches/amp_3_6_0/src/webui/webui/htdocs/new/src/hive/services/log_location_service.py (Diff revision 1) This also can be a global variable as its a constant.
Change Summary:
Addressed review comments
Description: |
|
||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+372) |
-
-
branches/amp_3_6_0/src/webui/webui/htdocs/new/src/hive/log_location.py (Diff revision 2) these is exposing internal details of service layer.. can be wrapped in a service level exception.. Any thoughts?
-
-
branches/amp_3_6_0/src/webui/webui/htdocs/new/src/hive/services/log_location_service.py (Diff revision 2) memory => additional disk space. Memory implies RAM.
Change Summary:
Few minor changes w.r.t error messages
Diff: |
Revision 4 (+372)
|
|---|
