使用参数获取警报列表
This API allows retrieving a list of alarms using parameters.
Request
GET /api/v2/alarms?clientID={clientID}&facilityID={facilityID}&deviceID={deviceID}&endpointID={deviceID}&maxCount={maxCount} HTTP/1.1
Host: gear.cloud.studio
Authorization: Bearer {accessToken}参数
| 名称 | 说明 |
|---|---|
| accessToken | Access token with permissions to read alarm information. See this page for more information. The 访问令牌 can also be sent as part of the query string, 使用 "accessToken" parameter. |
| clientID | Optional identifier indicating that only alarms for the given client should be retrieved. |
| facilityID | Optional identifier indicating that only alarms for the given facility should be retrieved. |
| deviceID | Optional identifier indicating that only alarms for the given device should be retrieved. |
| dateFrom | Date from which alarms for the given device should be retrieved. |
| dateTo | Date until which alarms for the given device should be retrieved. |
| endpointID | Optional identifier indicating that only alerts for the given endpoint should be retrieved. |
| state | 警报 state identifier. Possible values are "open", "closed", and "all". |
| maxCount | Optional parameter indicating the maximum number of records to include in the result. Values greater than 500 are limited to 500 regardless of the value sent in the request. |
| It is mandatory to include one (and only one) of the parameters "clientID", "facilityID", "deviceID", or "endpointID". |
|---|
Response
The response contains the list of matching alarms, as shown in this example:
[
{
"AlarmID":1266896,
"DeviceID":7370,
"DeviceDescription":"Controlador RUPANCO",
"EndpointID":0,
"AlarmTypeID":1,
"AlarmTypeDescription":"Dispositivo fuera de línea",
"AlarmSeverityID":3,
"AlarmSeverityDescription":"Alta",
"Details":"",
"DateTimeCreated_UTC":"2021-10-15T17:34:35",
"DateTimeClosed_UTC":"2021-10-15T18:21:39",
"SequenceNumber":28885207,
"MTTRMinutes":47.0
},
{
"AlarmID":1266922,
"DeviceID":7370,
"DeviceDescription":"Controlador RUPANCO",
"EndpointID":0,
"AlarmTypeID":1,
"AlarmTypeDescription":"Dispositivo fuera de línea",
"AlarmSeverityID":3,
"AlarmSeverityDescription":"Alta",
"Details":"",
"DateTimeCreated_UTC":"2021-10-15T19:36:41",
"DateTimeClosed_UTC":"2021-10-15T19:37:23",
"SequenceNumber":28885384,
"MTTRMinutes":47.0
}
]获取一个 alarm by its ID
This API allows retrieving an alarm by its ID. Request GET /api/v2/alarms/{alarmID} HTTP/1.1 Host: gear.cloud.studio Authorization: Bearer {accessToken}...
增量获取警报列表
This API allows retrieving a list of alarms incrementally. This enables fast updates of alarms as they are opened or closed without needing to retrieve the full list.