From b5fc98c52b9a3153101df3bbdc9e7e9c046b6110 Mon Sep 17 00:00:00 2001 From: Victoria McDonald <49625194+torimcd@users.noreply.github.com> Date: Mon, 4 Dec 2023 10:27:58 -0800 Subject: [PATCH] feature/issue-41 add example query response to docs (#43) * add example query response * update changelog --------- Co-authored-by: Frank Greguska <89428916+frankinspace@users.noreply.github.com> --- CHANGELOG.md | 3 +- docs/examples.md | 105 +++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 99 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86d6a971..3f2bdb42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added + - Issue 41 - Update API documentation with query response examples - Issue 27 - Create lambda function to execute database loading - Issue 9 - Create API Usage Documentation - Issue 4 - User guide for how to run database load script manually @@ -16,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Issue 23 - Added github actions with Snyk, pylint, flake8 - Issue 7 - Added actions to build.yml to upload docker container to registry - Issue 7 - Fixed poetry.lock to account for new vulnerability detected in Synk, given that we are going to remove flask -### Changed +### Changed - Issue 8 - Hydrocron API implementation with dynamodb local database - Issue 8 - Rearrange database code - Issue 8 - Rearrange tests diff --git a/docs/examples.md b/docs/examples.md index 986523f9..b14b1ec0 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -4,14 +4,103 @@ Search for a single river reach by reach ID. - /timeseries?feature=reach&feature_id=71224300643&output=csv&start_time=2023-08-01T00:00:00&end_time=2023-10-31T00:00:00 + /timeseries?feature=Reach&reach_id=73111000545&output=geojson&start_time=2023-06-04T00:00:00&end_time=2023-06-10T00:00:00&fields=feature_id,time_str,wse,geometry -Will return a CSV file, eg: - -## Get time series GEOJSON for river node - -Search for a single river node by node ID. +Will return geojson, eg: - /timeseries?feature=node&feature_id=45243800160101&output=geojson&start_time=2023-08-01T00:00:00&end_time=2023-10-31T00:00:00 + { + "status": "200 OK", + "time": "65.691 ms.", + "type": "FeatureCollection", + "features": [ + { + "properties": { + "time": "2023-06-05 06:58:52", + "reach_id": 73111000545, + "wse": -23.9435, + "slope": 0.000005225450000000001 + }, + "geometry": { + "coordinates": [ + [ + -67.138008, + 45.134336 + ], + [ + -67.140648, + 45.137619 + ], + [ + -67.142347, + 45.141698 + ], + [ + -67.144123, + 45.145777 + ], + [ + -67.144469, + 45.146863 + ], + [ + -67.146042, + 45.150129 + ], + [ + -67.148479, + 45.15503 + ], + [ + -67.149418, + 45.156665 + ], + [ + -67.151297, + 45.159936 + ], + [ + -67.153499, + 45.162672 + ], + [ + -67.158077, + 45.162746 + ], + [ + -67.16379, + 45.163162 + ], + [ + -67.17678, + 45.162777 + ], + [ + -67.18513, + 45.164314 + ], + [ + -67.188161, + 45.16501 + ], + [ + -67.191202, + 45.165436 + ], + [ + -67.194232, + 45.166186 + ], + [ + -67.197255, + 45.167152 + ] + ], + "type": "LineString" + }, + "type": "Feature" + } + ], + "hits": 1 + } -Will return geojson, eg: +** geometry simplified for example