Executing Actions
Executing actions
openAlarm(subEntityIdentifier, alarmName, ruleName, severity, priority, alarmDescription, extraInfo)
Deprecated: Use
alarmobject functions instead.
Opens an alarm for the selected entity.
Kind: global function
Returns: void
| Param | Type | Description |
|---|---|---|
| subEntityIdentifier | String | You can open an alarm on device, subscription or subscriber identifier. With subEntityIdentifier you define selected identifier. If is undefined it will open on provision.administration.identifier identifier. |
| alarmName | String | Name that you want to see in opened alarm |
| ruleName | String | Name of rule that produce opening of alarm. |
| severity | String | Alarm severity. Values can be INFORMATIVE, URGENT or CRITICAL. |
| priority | String | Alarm priority. Values can be LOW, MEDIUM or HIGH. |
| alarmDescription | String | Alarm description. |
| extraInfo | String | Extra information. |
Examples of use This example open alarm apnMismatch to subscription.
And this example open alarm highTemperature to device.
closeAlarmByRuleName(entityIdDatastream, ruleName)
Deprecated: Use
alarmobject functions instead.
Closes an alarm for the selected entity using rule name.
Kind: global function
Returns: void
| Param | Type | Description |
|---|---|---|
| entityIdDatastream | String | You can close an alarm on device, subscription or subscriber identifier. With entityIdDatastream you define selected identifier. If is undefined it will close on provision.administration.identifier identifier. |
| ruleName | String | Name of rule that open alarm. |
Example of use:
closeAlarmByAlarmName(entityIdDatastream, alarmName)
Deprecated: Use
alarmobject functions instead.
Closes an alarm for the selected entity using alarm name.
Kind: global function
Returns: void
| Param | Type | Description |
|---|---|---|
| entityIdDatastream | String | You can close an alarm on device, subscription or subscriber identifier. With entityIdDatastream you define selected identifier. If is undefined it will close on provision.administration.identifier identifier. |
| alarmName | String | Name of alarm to close. |
Example of use:
addEmailNotification(recipients, notificationName, notificationBody, ruleName, mailParameters)
Deprecated: Use
notificationobject functions instead.
Sends email notification to defined recipients.
Kind: global function
Returns: void
| Param | Type | Description |
|---|---|---|
| recipients | Array | Array of recipients to send email. This param has same format as defined in easy mode. |
| notificationName | String | Name of notification that will be received in subject field. |
| notificationBody | String | Mustache template with email’s body |
| ruleName | String | Name of rule that launch email request. |
| mailParameters | Object | Json object with key-value pairs that will be replaces in mustache evaluation. |
Example of use:
The example send email to example@recipient.es with highTemperature notification.
addTrapNotification(recipients, variables, notificationName, trapOID, enterpriseOID, ruleName)
Deprecated: Use
notificationobject functions instead.
Sends trap notification to defined recipients.
Kind: global function
Returns: void
| Param | Type | Description |
|---|---|---|
| recipients | Array | Array of recipients (<ip>:<port>) to send trap. This param has same format as defined in easy mode. |
| variables | Object | Map of variables. Each pair defines OID variable and sent value for this OID. |
| notificationName | String | Name of notification |
| trapOID | String | OID of trap |
| enterpriseOID | String | OID of enterprise |
| ruleName | String | Name of rule |
Example of use:
The example send trap to 25.35.98.5:8585 with highTemperature notification.
sendHttp(httpJson)
Deprecated: Use
notificationobject functions instead.
Sends http notification to defined recipients.
Kind: global function
Returns: void
| Param | Type | Description |
|---|---|---|
| httpJson | Object | Same json that easy mode. |
Example of use:
The example send http request to http://myService/request with highTemperature notification.
executeOperation(subEntityIdentifier, operationType, operationTimeout, jobUser, retries, ackTimeout, retriesDelay, stopValue, stopMode, parameters, callback)
Deprecated: Use
operationobject functions instead.
Executes selected operation to received identifier.
Kind: global function
Returns: void
| Param | Type | Description |
|---|---|---|
| subEntityIdentifier | String | You can execute operation on device, subscription or subscriber identifier. With subEntityIdentifier you define selected identifier. If is undefined it will open on provision.administration.identifier identifier. |
| operationType | String | Operation Identifier. You can get this values getting operation catalog. Mandatory field. The rule will be created, but the operation will not. |
| operationTimeout | Number | Operation timeout in milliseconds. Default: 60000 milliseconds |
| jobUser | String | User apiKey that launch this operation. Mandatory field. The rule will be created, but the operation will not. |
| retries | Number | Operation retries number. Default: 0. |
| ackTimeout | Number | ACK timeout in milliseconds. Default: null. |
| retriesDelay | Number | Delay in seconds between retries. Default: null. |
| stopValue | Number | Stop value, this value depends of stop mode selected. Default: Operation timeout + 5000. |
| stopMode | String | Stop mode. Default: delayed. Possible values: date (stop value is a date in YYYY-MM-DDThh:mm:ssTZD format) and delayed (stop value is a time defined in milliseconds). |
| parameters | Object | This value is a json with accepted value in selected operation. You can see parameters getting operation catalog. |
| callback | String | URI where the result of the operation execution is received. |
NOTE: The Job of the operation will be created with an active status by default.
Example of use:
The example execute REFRESH_PRESENCE operation to received device.
cancelDelay(ruleName)
Deprecated: Use
utilsobject functions instead.
Cancels active delayed action produced by another rule activation.
Kind: global function
Returns: void
| Param | Type | Description |
|---|---|---|
| ruleName | String | Name of rule that produce delayed actions. |
Example of use:
The example cancel delay of ‘highTemperatureRule’ rule.