Open nhoening opened 2 years ago
Maybe better to start with POST /assets/<id>/annotations
, because asset annotations you can see straightaway in the UI (on the sensor page).
Reason for that is that so far, all of our clients' annotations have been on the asset level rather than on the sensor level.
Two ideas:
annotator
?) If you send data about a sensor, you should also be able to send annotations, right?
Annotations are simple notes with metadata about our time series data, and they can be attached to sensors, assets and accounts. Their value lies in enriching the IoT data ― they store what users might say about data (also useful for machine learning potential) and show contextual information, e.g. about national holidays and such, for better understanding of plots.
They are already shown on sensor charts, which uses the
/api/dev/sensor/<id>/chart
endpoint to read them.Here, we'd like to support adding them via the API. We'd like to have these three endpoints, placed in
/api/dev/annotations.py
:Obviously, the user needs the update permission on the entity (using
@permission_required_for_context
) to use the endpoint. We also need some tests. Other API endpoints (see /api/v3_0) can serve as inspiration.Let's start with
POST /sensors/<id>/annotations
.