Skip to content

Remove timeseries

Remove time series steps

Time series steps are removed using endpoint:

DELETE/api/ts/dataset/{id}/timeseries/{timeSeriesId}/values?from=<datetime>&to=<datetime>

This endpoint has optional filter parameters from and to that determine what time steps to remove. Expected time format is yyyy-MM-ddTHHmmss. If from is not specified, values from the first time step are removed. If to is not specified, values to the last time step are removed.

Click to show example shell script for removing time series values from existing time series

projectid="<replacewithprojectid>"
openapikey="<replacewithopenapikey>"
datasetid="<replacewithdatasetid>"
timeseriesid="<replacewithtimeseriesid>"

# remove time steps from January 1, 2010, 00:00:00 to February 1, 2010, 00:00:00
dtfrom="2010-01-01T000000"
dtto="2010-02-01T000000"

curl -k -X DELETE \
  "https://api.mike-cloud-test.com/api/ts/dataset/$datasetid/timeseries/$timeseriesid/values?from=$dtfrom&to=$dtto" \
  -H 'Content-Type: application/json' \
  -H "dhi-service-id: timeseries" \
  -H "dhi-project-id: $projectid" \
  -H "dhi-dataset-id: $datasetid" \
  -H "dhi-open-api-key: $openapikey"