When querying on an interface for device data, sinceto and sinceAfter params can be specified to filter data.
When such params are specified and no data is matched:
For a query on a specific interface path, AppEngine will return a 404 error. See issue #151
For a query on the interface root path, AppEngine will return a 500 error. See below.
Below is a log of an example query with since param on a datastream individual interface and no matching data:
Mar 16 10:41:13 |ERRO| #PID<0.27372.113> running Astarte.AppEngine.APIWeb.Endpoint (connection #PID<0.26978.113>, stream id 5) terminated
Server: api.eu1.astarte.cloud:80 (http)
Request: GET /v1/davidebriani/devices/CUPVU9qTQOeRPjfkHMvPYA/interfaces/datastream.individual?keep_milliseconds=true&since=2020-10-14T12:27:13.200Z&since_after=&to=&limit=
** (exit) an exception was raised:
** (MatchError) no match of right hand side value: :empty_dataset
(astarte_appengine_api 1.0.0-beta.2) lib/astarte_appengine_api/device/device.ex:1078: anonymous fn/8 in Astarte.AppEngine.API.Device.retrieve_endpoint_values/9
(elixir 1.11.3) lib/enum.ex:3473: anonymous fn/3 in Enum.reduce/3
(cqex 1.0.1) lib/cqex/result.ex:242: Enumerable.CQEx.Result.reduce/3
(elixir 1.11.3) lib/enum.ex:3473: Enum.reduce/3
(astarte_appengine_api 1.0.0-beta.2) lib/astarte_appengine_api/device/device.ex:844: anonymous fn/6 in Astarte.AppEngine.API.Device.do_get_interface_values!/5
(elixir 1.11.3) lib/enum.ex:3473: anonymous fn/3 in Enum.reduce/3
(cqex 1.0.1) lib/cqex/result.ex:242: Enumerable.CQEx.Result.reduce/3
(elixir 1.11.3) lib/enum.ex:3473: Enum.reduce/3
Below is a log of an example query with since param on a datastream object interface and no matching data:
When querying on an interface for device data,
since
to
andsinceAfter
params can be specified to filter data. When such params are specified and no data is matched:Below is a log of an example query with
since
param on adatastream individual
interface and no matching data:Below is a log of an example query with
since
param on adatastream object
interface and no matching data: