Call the Police
Local alarms. Aligned with the SDK Alarms / AlarmHistory. One question, one answer.
GET /api/alarms
Event alerts,JSON array. Response fields are read-only.
GET /api/alarms HTTP/1.1
Host: 127.0.0.1:18840
[
{
"id": "PnS.Io.ModuleTimeout",
"severity": "Error",
"message": "模块超时",
"occurredAt": "2026-09-16T10:20:00.0000000+08:00",
"count": 1,
"source": "Io"
}
]
| Field | Reading and Writing | Note |
|---|---|---|
| id | Read-only | Unique incident ID; used when confirming a single incident |
| severity | Read-only | Enumeration: Info / Warning / Error / Critical |
| message | Read-only | Alert Message |
| occurredAt | Read-only | Time of the most recent occurrence |
| count | Read-only | Number of occurrences (≥1) within the deduplication window |
| source | Read-only | Source (Module / Layer) |
GET /api/alarms/history
The most recent 500 records, with the same fields.
POST /api/alarms/ack
The request body id is a writable field, taken from GET /api/alarms's id.
POST /api/alarms/ack HTTP/1.1
Host: 127.0.0.1:18840
Content-Type: application/json
{"id": "PnS.Io.ModuleTimeout"}
Response ok / message / acknowledgedCount (always 1) / timestamp. An ID with no active alarms = HTTP 404.
POST /api/alarms/ack-all
No request body. Acknowledges all active alarms; the response is as above, with acknowledgedCount being the number of acknowledgements.