Blog Post

Tech Talk
1 MIN READ

Device DataSource Instance datapoint historical data using RestAPI v3

Cole_McDonald's avatar
Cole_McDonald
Icon for Professor rankProfessor
2 years ago

I am having problems getting the RestAPI to return any data regardless the combination of paths, query params, time filters I try using.  What am I doing wrong?  Here’s my ultimate URL I’ve built for this effort:

$ddsi is a successfully retrieved object (DeviceDataSourceInstance)

Start and End are from these:

    [int]$start = get-date (get-date).addMonths(-3) -uformat %s
    [int]$end   = get-date (get-date).addMonths(-3).AddMinutes(5) -uformat %s

/device/devices/$($ddsi.deviceid)/devicedatasources/$($ddsi.devicedatasourceid)/data?size=500&offset=0&start=$start&end=$end&datapoints=Capacity,PercentUsed

All of the pieces and parts seem to line up with examples I’ve found here and in the LM Docs… it doesn’t error out, but returns nothing.

Goal is to get volume capacity metrics from 3 months ago.

Where am I going awry here?  Everything works up until I add the /data at the end.

Published 2 years ago
Version 1.0