Skip to main content
Version: 2.8

Alarm and Events

The alarming API of HumanOS® allows to get pending alarms but also to post and remove alarms manually.

An alarm item contains of following fields:

Field NameDescriptionType
ActiveTrue = Alarm is activeSystem.Boolean
AlarmTypeType of alarm (Information, Warning, Alarm, Emergency)EAlarmType
ConditionNameName of the alarmSystem.String
DisappearanceTimestamp of the disappearanceSystem.DateTime
EventIdIdentifier of the alarmSystem.Int32
MessageMessage textSystem.String
OccurrenceTimestamp of the occurrenceSystem.DateTime
SeveritySeverity of the alarmSystem.Int32
SourceNameName of the alarm sourceSystem.String
SourceNodeIdGuid of the source nodeSystem.Guid
TimeCurrent timestamp (Occurrence or Disappearance)System.DateTime

Getting all Pending Alarms

Gets all pending alarms of a alarm-event pool.

HTTP Method:GET
HTTP Url:alarms/pool
HTTP Query-Parameter:id: Id of the alarm pool as System.Guid
Request Content-Typetext/xml
Request Body-
Response Content-Typetext/xml
Response ContentList of pending alarms

Example:

GET http://localhost:8081/alarms/pool?id=56b4925b-e671-482b-8dc3-debba395e7a1

Response Body:

<HumanOS.Stream>
<Alarms>
<AlarmItem>
<Active>true</Active>
<AlarmType>Alarm</AlarmType>
<ConditionName>Alarm PS3</ConditionName>
<Disappearance>0001-01-01T00:00:00</Disappearance>
<EventId>1631396097</EventId>
<Message>TOO MANY DIGIT</Message>
<Occurrence>2019-10-22T20:44:28.974112Z</Occurrence>
<Severity>500</Severity>
<SourceName>CNC</SourceName>
<SourceNodeId>0dd3fac7-ed5a-4193-af6a-f63439e7b0ff</SourceNodeId>
<Time>2019-10-22T20:44:28.974112Z</Time>
</AlarmItem>
</Alarms>
</HumanOS.Stream>

Post an Alarm

Posts an alarm over the REST API.

HTTP Method:POST
HTTP Url:alarms/pool
HTTP Query-Parameter:id: Id of the alarm pool as System.Guid
Request Content-Typetext/xml
Request BodyAlarm Item data
Response Content-Typetext/xml
Response ContentAlarm Item

Note that the response body returns the EventId of the posted alarm. This id must be used to remove the alarm.

Following fields are given in the request body:

  • ConditionName: Name of the alarm
  • Message: message text
  • SourceNodeId: ID of the source node
  • Time: timestamp of the occurrence
  • AlarmType: alarm type. [Optional, Default=Alarm]
  • SourceName : name of the source [Optional, Default=<empty>]

Example:

POST http://localhost:8081/alarms/pool?id=56b4925b-e671-482b-8dc3-debba395e7a1

Request Body:

<HumanOS.Stream>
<Alarms>
<AlarmItem>
<ConditionName>Alarm 100</ConditionName>
<Message>Some alarm 100</Message>
<SourceNodeId>{0A52B7E8-5841-4E40-97E2-B6BD2CE5E081}</SourceNodeId>
<Time>2019-10-19 0:0:0</Time>
</AlarmItem>
</Alarms>
</HumanOS.Stream>

Response Body:

<HumanOS.Stream>
<Alarms>
<AlarmItem>
<EventId>-1179259960</EventId>
...
</AlarmItem>
</Alarms>
</HumanOS.Stream>

Remove an Alarm

Removes an alarm from the pool.

HTTP Method:DELETE
HTTP Url:alarms/pool
HTTP Query-Parameter:id: Id of the alarm pool as System.Guid
Request Content-Typetext/xml
Request BodyAlarm Item
Response Content-Typetext/xml
Response Content"OK" if item is deleted

The request body contains following fields:

  • EventId: Id of the alarm to be removed
  • Time: Timestamp of the disappearance

Example:

DELETE http://localhost:8081/alarms/pool?id=56b4925b-e671-482b-8dc3-debba395e7a1

Request Body:

<HumanOS.Stream>
<Alarms>
<AlarmItem>
<EventId>-1179259960</EventId>
<Time>2019-10-19 0:1</Time>
</AlarmItem>
</Alarms>
</HumanOS.Stream>

Response:

OK