Mercurial > gemma
diff pkg/controllers/routes.go @ 2762:f95ec0bb565c
Added endpoint to deliver average waterlevels for a given gauge.
GET /api/data/average-waterlevels/{GAUGE}?from={FROM}&to={TO}
from and to are optional and defaults to end of today and going a year backwards.
Output is CSV in form of
#date,#min,#max,#mean,#median,#Q25,#Q75
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 21 Mar 2019 18:07:49 +0100 |
parents | 87aed4f9b1b8 |
children | db1052bc162a |
line wrap: on
line diff
--- a/pkg/controllers/routes.go Thu Mar 21 17:31:03 2019 +0100 +++ b/pkg/controllers/routes.go Thu Mar 21 18:07:49 2019 +0100 @@ -302,6 +302,9 @@ api.Handle("/data/waterlevels/{gauge}", any( middleware.DBConn(http.HandlerFunc(waterlevels)))).Methods(http.MethodGet) + api.Handle("/data/average-waterlevels/{gauge}", any( + middleware.DBConn(http.HandlerFunc(averageWaterlevels)))).Methods(http.MethodGet) + api.Handle("/data/nash-sutcliffe/{gauge}", any(&JSONHandler{ Handle: nashSutcliffe, })).Methods(http.MethodGet)