Web Service
Overarching issues for adding a web service:
-
Swagger landing page (See !15 (merged)) -
Usage JSON response when given no input parameters (see !17 (merged)) -
Add HTTP GET method to return calculator response -
Add HTTP POST method to take in CSV and return calculator response -
Add Dockerfile (See !16 (merged))
Questions:
- What inputs parameters are there?
- What HTTP methods should there be? GET, POST?
- What should the response JSON structure be? In NSHMP there is a standard response JSON that is used, example: https://earthquake.usgs.gov/ws/nshmp/conus-2018/static/hazard/-119/34/BC
Technologies used:
https://flask.palletsprojects.com/en/2.0.x/https://flask-restx.readthedocs.io/en/latest/- https://fastapi.tiangolo.com/
- https://swagger.io/tools/swagger-ui/
Example Python web service https://code.usgs.gov/ghsc/nshmp/ncm/NCMws
Edited by Clayton, Brandon Scott