FRAMES NO FRAMES | |||||||
| |||||||
SUMMARY: IMPORT | CONSTANT | MEMBER | ACTION | DETAIL: IMPORT | CONSTANT | MEMBER | ACTION |
Alarm("22","c8y_UnavailabilityAlarm","12669915",1464365565.661,"No communication with device since 2016-05-27T18:11:23.886+02:00","ACKNOWLEDGED","MAJOR",1,{})
Alarm("11","com_cumulocity_events_BatteryWarning","1122",1464365565.661,"Low battery level","ACTIVE","MINOR",1,{"history":{}})
// Create an Alarm:
send Alarm("","c8y_UnavailabilityAlarm","12669915",1464365565.661,"No communication with device since 2016-05-27T18:11:23.886+02:00","ACKNOWLEDGED","MAJOR",1,new dictionary<string,any>) to Alarm.SEND_CHANNEL;
// Update the text, status and severity fields:
send Alarm("11","c8y_UnavailabilityAlarm","12669915",1464365565.661,"Low battery level","ACTIVE","MINOR",1,new dictionary<string,any>) to Alarm.SEND_CHANNEL;
Constant summary | |
---|---|
string | CHANNEL := "CumulocityIoTGenericChain" The channel for sending updates/ new Alarms to.
|
string | NOTIFICATION_CREATED := "CREATED" Value of PARAM_NOTIFICATION that indicates this is a new object. |
string | NOTIFICATION_UPDATED := "UPDATED" Value of PARAM_NOTIFICATION that indicates this is an update to an existing object. |
string | PARAM_NOTIFICATION := ".apama_notificationType" Entry in params that identifies if this is a new object or an update to an existing object. Entry will have a value matching either NOTIFICATION_CREATED or NOTIFICATION_UPDATED. |
string | SEND_CHANNEL := "CumulocityIoTGenericChain" The channel for sending Alarms. |
string | SUBSCRIBE_CHANNEL := "cumulocity.measurements" The channel for receiving Alarm notifications. |
Member summary | |
---|---|
string | id Unique identifier for this Alarm. |
string | type The type of the Cumulocity event. |
string | source Identifier of the managed object associated with the event. |
float | time Timestamp of the event. |
string | text Text or message of the Alarm. |
string | status The status of the alarm: ACTIVE, ACKNOWLEDGED or CLEARED. |
string | severity The severity of the alarm: CRITICAL, MAJOR, MINOR or WARNING. Must be upper-case. |
integer | count The number of times this alarm has been sent. |
dictionary<string, any> | params Any other properties available on the Alarm. |
Action summary | |
---|---|
boolean |
isCreate() Check if this Alarm instance was as a result of an alarm being created in Cumulocity. |
boolean |
isUpdate() Check if this Alarm instance was as a result of an alarm being updated in Cumulocity. |
com.apama.cumulocity.ResponseWrapper |
withChannelResponse(integer reqId, dictionary<string, string> headers) Create or update an Alarm in Cumulocity and receive a response event confirming the change on Alarm.SUBSCRIBE_CHANNEL channel. |
com.apama.cumulocity.ResponseWrapper |
withResponse(integer reqId, dictionary<string, string> headers) Create or update an Alarm in Cumulocity and receive a response event on default channel, confirming the change.
|
Constant detail |
---|
string CHANNEL := "CumulocityIoTGenericChain"
string NOTIFICATION_CREATED := "CREATED"Value of PARAM_NOTIFICATION that indicates this is a new object.
string NOTIFICATION_UPDATED := "UPDATED"Value of PARAM_NOTIFICATION that indicates this is an update to an existing object.
string PARAM_NOTIFICATION := ".apama_notificationType"Entry in params that identifies if this is a new object or an update to an existing object. Entry will have a value matching either NOTIFICATION_CREATED or NOTIFICATION_UPDATED.
string SEND_CHANNEL := "CumulocityIoTGenericChain"The channel for sending Alarms.
string SUBSCRIBE_CHANNEL := "cumulocity.measurements"The channel for receiving Alarm notifications.
Member detail |
---|
integer countThe number of times this alarm has been sent.
string idUnique identifier for this Alarm.
dictionary<string, any> paramsAny other properties available on the Alarm.
string severityThe severity of the alarm: CRITICAL, MAJOR, MINOR or WARNING. Must be upper-case.
string sourceIdentifier of the managed object associated with the event.
string statusThe status of the alarm: ACTIVE, ACKNOWLEDGED or CLEARED.
string textText or message of the Alarm.
float timeTimestamp of the event.
string typeThe type of the Cumulocity event.
Action detail |
---|
boolean isCreate()Check if this Alarm instance was as a result of an alarm being created in Cumulocity.
boolean isUpdate()Check if this Alarm instance was as a result of an alarm being updated in Cumulocity.
com.apama.cumulocity.ResponseWrapper withChannelResponse(integer reqId, dictionary<string, string> headers)Create or update an Alarm in Cumulocity and receive a response event confirming the change on Alarm.SUBSCRIBE_CHANNEL channel.
monitor.subscribe(Alarm.SUBSCRIBE_CHANNEL);
Alarm a := new Alarm;
// set fields in a
integer reqId := com.apama.cumulocity.Util.generateReqId();
on ObjectCommitted(reqId=reqId) as commit and not ObjectCommitFailed(reqId=reqId) {
// do something
}
on ObjectCommitFailed(reqId=reqId) as failure and not ObjectCommitted(reqId=reqId) {
// do something
}
send a.withChannelResponse(reqId, { "X-Cumulocity-Processing-Mode": "TRANSIENT" }) to Alarm.SEND_CHANNEL;
com.apama.cumulocity.ResponseWrapper withResponse(integer reqId, dictionary<string, string> headers)
Alarm a := new Alarm;
// set fields in a
integer reqId := com.apama.cumulocity.Util.generateReqId();
on ObjectCommitted(reqId=reqId) as commit and not ObjectCommitFailed(reqId=reqId) {
// do something
}
on ObjectCommitFailed(reqId=reqId) as failure and not ObjectCommitted(reqId=reqId) {
// do something
}
send a.withResponse(reqId, { "X-Cumulocity-Processing-Mode": "TRANSIENT" }) to Alarm.SEND_CHANNEL;
FRAMES NO FRAMES | |||||||
| |||||||
SUMMARY: IMPORT | CONSTANT | MEMBER | ACTION | DETAIL: IMPORT | CONSTANT | MEMBER | ACTION |