eclipse-agail / agile-core

Source code repository for agile core components
Eclipse Public License 2.0
7 stars 16 forks source link

similar end points? #41

Closed craigmulligan closed 7 years ago

craigmulligan commented 7 years ago

What is the difference between: GET /device/{deviceId}/{componentId} GET /device/{deviceId}/{componentId}/lastUpdate

and also between: GET /device/{deviceId} GET /device/{deviceId}/lastUpdate

Each pair returns the same thing? Retire last update?

cskiraly commented 7 years ago

First is a query that goes down till the device. It is blocking, and it could be slow. Second is just cached value, if it exists.

craigmulligan commented 7 years ago

Ah I see, so it will force a read if it doesn't exist?

cskiraly commented 7 years ago

Yes, first is forcing a read if there is no value recent enough. Here the definition of "recent enough" is a bit vague, as it depends on the underlying protocol, sensor, etc. Second (lastUpdate), will never go down to the protocol, it only returns the last read value.