OasisLMF / OasisPlatform

Loss modelling platform.
BSD 3-Clause "New" or "Revised" License
40 stars 17 forks source link

Add endpoint to return inuring priority from generated files #1032

Open sambles opened 5 months ago

sambles commented 5 months ago

Issue Description

The inuring_priority is stored in the ri_layers.json file within an input file tar.

{                                                                                                                                             
    "1": {
        "inuring_priority": 1,
        "risk_level": "LOC",
        "directory": "/home/sam/repos/models/piwind/runs/files-20240102095204/RI_1"
    }   
}

Add an endpoint to an analyses object to return this data

sambles commented 5 months ago

Might be a good time to add in this feature too https://github.com/OasisLMF/OasisPlatform/issues/689

https://stackoverflow.com/questions/4024271/rest-api-best-practices-where-to-put-parameters

http://localhost:8000/v2/analyses/1/input_file?select_file=ri_layers.json --> returns contents of ri_layers.json if file not found --> return Bad Request listing avalible files for section.

Add /analyses/{id}/output_file_list/ /analyses/{id}/input_file_list/ to list options

sambles commented 4 months ago

Screenshot from 2024-05-15 14-51-53

Screenshot from 2024-05-15 14-52-15

The Lot 3 PR seems to be extracting and storing each output file as a separate RelatedFile object, I'm not sure on this approach can might cause a lot of clutter.. could we just a similar mechanism to operate on files within an output tar? --> needs some thought