hydroserver2 / hydroserver

Documentation and issue tracker for HydroServer and related applications
BSD 3-Clause "New" or "Revised" License
5 stars 0 forks source link

SensorThings API batch delete observations #212

Open kjlippold opened 2 weeks ago

kjlippold commented 2 weeks ago

Describe the feature you'd like and what it will do

Add an endpoint called 'DeleteObservations' to SensorThings API. This is not part of the official specification and should be implemented as an unofficial extension. It should be implemented similar to the data array extension.

Users will be able to send a POST request to 'DeleteObservations' with the following body:

[
  {
    "Datastream": {
      "@iot.id": "2932b73e-f9d3-49e7-9644-5060b3b92dbf"
    },
    "phenomenonTime": "2024-01-01T00:00:00.00+00:00/2024-02-01T00:00:00.00+00:00",
  }
]

This allows users to delete observations from multiple datastreams at once, but requires the user to explicitly specify the datastream IDs to help avoid accidental deletion of observations outside the intended datastreams. phenomenonTime should be an optional TM_Period element that allows users to only delete observations within the given interval.

Why is this feature important?

There is currently no way to delete large numbers of observations efficiently in SensorThings without deleting the parent datastream. This functionality is important for performing quality control and helps with general data management.

Is your feature request related to a problem? Please describe.

No response

Any additional comments?

This functionality should also be implemented as a method of the hydroserverpy package.