This repository has been archived by the owner on Oct 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Showing a table with the list of alerts
Hector Garcia Tellado edited this page Oct 31, 2017
·
1 revision
How to get all the alerts for the past 24 hours, for a given group of devices.
It's also possible to get all the alerts, skipping step one below, and removing the devices
filter in step two.
The user selects a device group, which implicitly define the query to use to fetch the list of devices. See the Config UI API for more information.
GET {IoT Hub manager endpoint}/devices?query={query}
Content-Type: application/json; charset=utf-8
{
Count: ...
Items: [
{ device }
{ device }
{ device }
...
]
"$metadata": {
$type: DevicesList;1
$uri: {IoT Hub manager endpoint}/devices?query={query}
}
}
Note that the content of the response might change over time, for instance when devices are added or removed, and when device properties change. For instance a query like "all devices with firmware 1.2" would return a different list over time. The UI decides whether to cache and reuse the query result, or whether to repeat the query to refresh the response.
Request with GET:
GET {Device Telemetry endpoint}/alerts?from=NOW-PT24H&to=NOW&order=desc&devices=id1,id2,id3,...
Request with POST:
POST {Device Telemetry endpoint}/alerts-query
Content-Type: application/json; charset=utf-8
{
From: {NOW-PT24H}
To: {NOW}
Order: desc
Devices: [ "id1", "id2", "id3", ..., "id 1000" ]
}
Content-Type: application/json; charset=utf-8
{
Count: ...
Items: [
{
deviceid, time, description, status, etc.
$metadata
},
{
deviceid, time, description, status, etc.
$metadata
},
{
deviceid, time, description, status, etc.
$metadata
},
...
]
"$metadata": {
$type: AlertsList;1
$uri: ...
}
}