From 08cc70e5dfdecd321d6a38726d33968266132bcc Mon Sep 17 00:00:00 2001 From: Tor-Einar Skog <tor-einar.skog@nibio.no> Date: Fri, 17 Feb 2023 10:47:26 +0100 Subject: [PATCH] Add sampleconfig endpoint --- app/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/main.py b/app/main.py index 90e5279..b745c61 100644 --- a/app/main.py +++ b/app/main.py @@ -73,6 +73,11 @@ async def get_model_copyright(model_id: str, response:Response): requested_model = get_model_instance(model_id) return requested_model.copyright if requested_model is not None else _result_or_404(None, model_id, response) +@app.get("/models/{model_id}/sampleconfig/", response_class=PlainTextResponse, name="Get a sample configuration") +async def get_model_sampleconfig(model_id: str, response:Response): + requested_model = get_model_instance(model_id) + return requested_model.sample_config if requested_model is not None else _result_or_404(None, model_id, response) + @app.get("/models/{model_id}/warningstatusinterpretation/{language}/", response_class=PlainTextResponse, name="How to interpret the warning status (red-yellow-green, what does it mean?) in the specified language (<a href='http://www.loc.gov/standards/iso639-2/php/English_list.php'>ISO-639-2</a>)") async def get_model_warning_status_interpretation(model_id: str, language: str, response:Response): return _result_or_404(_get_model_warning_status_interpretation(model_id, language), model_id, response) -- GitLab