1

Is there an API to get data based on timestamp? This would help to retrieve only the delta since the last API call from the Cumulocity.

Or, as alternative: Is there an API that can push data to an HTTP port or a messaging queue?

4

1 回答 1

0

Both is possible. Time-series data such as events, alarms and measurements have "dateFrom" and "dateTo". For example, try

/measurement/measurements?source=101000&dateFrom=2015-07-19&dateTo=2015-07-20&pageSize=2000

(Replace "source" with your device ID and change dateFrom/dateTo accordingly.)

For operations, you get the delta automatically due to their state model. All new operations are in state "PENDING", and when you execute them on a device, you set them to "EXECUTING". This is described in the reference guide sections, e.g., https://cumulocity.com/guides/reference/measurements.

But if you really want to continuously get data out, I recommend using the pub/sub APIs. I.e. get all new events for a device by subscribing to the channel /events/[deviceId] on the URL /cep/realtime. The general protocol (cometd) is described here: https://cumulocity.com/guides/reference/real-time-notifications. The different channels and endpoints are described at the bottom of each API page. You can also create custom pub/sub channels through event processing rules if you want to do something entirely different.

于 2015-07-20T09:24:36.717 回答