Closed maxinelasp closed 1 month ago
Does this actually need to be updated on the API/backend side? I think we had discussed allowing /download/imap_mag_l1a_raw-norm_20240221_20240221_v01-00.cdf
in the past and not requiring the full path to the file? So it might need to be reworked in the APIs and not in this repository, depending on how we want to fix this.
Now I know why this ticket was created and what we need to fix.
Download API lambda handler expects this event input:
event = {
"resource": "/download/{proxy+}",
"path": "/download/file_path=imap/mag/l0/2023/12/imap_mag_l0_raw_20231212_v001.pkts",
"httpMethod": "GET",
.....
"pathParameters": {
"proxy": "imap/mag/l0/2023/12/imap_mag_l0_raw_20231212_v001.pkts"
},
....
}
But it get's this input from download call from this package.
event = {
"resource": "/download/{proxy+}",
"path": "/download/file_path=imap/mag/l0/2023/12/imap_mag_l0_raw_20231212_v001.pkts",
"httpMethod": "GET",
.....
"pathParameters": {
"proxy": "file_path=imap/mag/l0/2023/12/imap_mag_l0_raw_20231212_v001.pkts"
},
....
}
Based on how we want API to look, looks like we either need to update here to not send file_path=
in the API call or update lambda to remove this prefix.
Description of the issue
The download method in the CLI doesn't work properly if a file is requested via filename (as opposed to full file path.) The CLI attempts to add IMAP_DATA_DIR to the front of the filename.
Steps to reproduce the issue
Run
imap-data-access download imap_mag_l1a_raw-norm_20240221_20240221_v01-00.cdf
Code Snippet:
Expected behavior (What should happen)
File should be able to be downloaded from just the filename
Actual behavior (What does happen)
404 Error
Additional notes
No response
Affected areas (code, data, or process)
io.py
Suggested fix?
set
file_path = science_file_path.construct_filepath()