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,{}) to Alarm.SEND_CHANNEL;
You can update the text, status and severity fields. send Alarm("11","c8y_UnavailabilityAlarm","12669915",1464365565.661,"Low battery level","ACTIVE","MINOR",1,{}) 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 a new object. |
string | NOTIFICATION_UPDATED := "UPDATED"
Value of PARAM_NOTIFICATION that indicates this 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 Alarms. |
Member summary | |
---|---|
string | id
Unique identifier for this Alarm. |
string | type
The type of the Cumulocity event. |
string | source
Identifier of the source of 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 propertiess available on the Alarm . |
Action summary | |
---|---|
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 a new object.
string NOTIFICATION_UPDATED := "UPDATED"Value of PARAM_NOTIFICATION that indicates this 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 Alarms.
Member detail |
---|
integer countThe number of times this alarm has been sent.
string idUnique identifier for this Alarm.
dictionary<string, any> paramsAny other propertiess available on the Alarm .
string severityThe severity of the alarm: CRITICAL, MAJOR, MINOR or WARNING. Must be upper-case.
string sourceIdentifier of the source of 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 |
---|
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.
Alarm a := new Alarm;
monitor.subscribe(Alarm.SUBSCRIBE_CHANNEL);
// set fields in a
integer reqId := com.apama.cumulocity.Util.generateReqId();
send a.withChannelResponse(reqId, { "X-Cumulocity-Processing-Mode": "TRANSIENT" }) to Alarm.SEND_CHANNEL;
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
}
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();
send a.withResponse(reqId, { "X-Cumulocity-Processing-Mode": "TRANSIENT" }) to Alarm.SEND_CHANNEL;
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
}
FRAMES NO FRAMES | |||||||
| |||||||
SUMMARY: IMPORT | CONSTANT | MEMBER | ACTION | DETAIL: IMPORT | CONSTANT | MEMBER | ACTION |