data class Alarm : JsonSerializable
Represents an alarm associated with a device.
Formal definition is given in Cumulocity REST API Guide
enum class Severity
Allowed values for Alarm Severity |
|
data class Source : JsonSerializable
Wraps id to identify associated device |
|
enum class Status
Allowed values for Alarm Status |
Alarm(o: JSONObject)
Alternative constructor used to parse Alarm fetched from Cumulocity. NOTE: You do not need to use this method. It is called implicitly when using the AlarmsService get method Alarm(source: Alarm.Source, type: String, status: Alarm.Status, severity: Alarm.Severity, text: String)
Create a new alarm to be posted to Cumulocity |
val severity: Alarm.Severity
One of Critical, Major, Minor or Warning |
|
val source: Alarm.Source
Identifies the device to which the alarm is associated |
|
val status: Alarm.Status
Identifies if the alarm is active, acknowledged or has been resolved (cleared) |
|
val text: String
arbitrary label describing reason for alarm |
|
val time: Date
Date time when alarm was raised |
|
val type: String
label identifying the type of alarm |
fun toJSONString(): String
Ensures alarm can be transformed into a JSON String so that it can be sent to Cumulocity NOTE: You do not need to use this method. It is called implicitly when using the AlarmsService post or AlarmsService put method |