-
Sub-task
-
Resolution: Fixed
-
Normal
-
None
-
None
We discussed how we are considering implementing this over the phone today, here are the notes between Brock, Gene & Rob:
We are thinking that it would be nice to create the following endpoints:
/sensors/:id/average
/sensors/:id/min
/sensors/:id/max
With each "function" endpoint, we could optionally include any (or none) of the query parameters the same way that we do for the `/datapoints` endpoint:
/sensors/:id/average?attribute=Chlorophyll&season=spring
/sensors/:id/min?start=2014-08-12&end=2004-08-12
/sensors/:id/max
In the above example, `/sensors/:id/max` would return the max for all parameters over the life of the sensor's datapoints. And in the case of `/sensors/:id/min` we would only calculate the min for the date range specified, etc.
The nice part is that all conditions are optional, and it paves the way for many different functions that we could create for a sensor, with reuse possibilities for other medici projects.