Alarms
Alarm Functions
The N2 Logic Node allows you to raise alarms of the appropriate as required at runtime. To fit in with the NCC alarm severity schema, the SDK supports only the following severities:
- critical
 - error
 - warning
 - notice
 
In most cases, the ‘notice’ severity is ignored by operations staff and the ‘critical’ severity will cause phone calls to be made to Important People, often at inopportune times. Bear this in mind.
Alarm Function Parameters
All alarm methods take identical parameters:
- message - a string containing the alarm text (mandatory)
 - code - an integer to be used as an alarm code to be added to the base SDK alarm code (optional, defaults to 0)
 
Alarm Function Errors
If the provided message is unable to be turned into a string, the following error will be raised:
Alarm text must be of type string, not <target type>.
If code is provided, it must be able to be turned into a number, and must be in the range 0-9999. The following errors are possible:
Alarm code must be a number or not provided.
Alarm code must be between 0 and 9999.
Functions
| ▲ ncc.alarm.critical (message, code) | ||
|---|---|---|
| Parameters | As for Alarm Function Parameters. | |
| Returns | Nothing. | |
| Errors | As for Alarm Function Errors. | |
| Usage | 
Use this function to raise an alarm on the SLC with the severity of 'critical'. For example:
Values provided can be dynamic:  | 
    |
| ▲ ncc.alarm.error (message, code) | ||
|---|---|---|
| Parameters | As for Alarm Function Parameters. | |
| Returns | Nothing. | |
| Errors | As for Alarm Function Errors. | |
| Usage | 
Use this function to raise an alarm on the SLC with the severity of 'error'. For example:
 | 
    |
| ▲ ncc.alarm.warning (message, code) | ||
|---|---|---|
| Parameters | As for Alarm Function Parameters. | |
| Returns | Nothing. | |
| Errors | As for Alarm Function Errors. | |
| Usage | 
Use this function to raise an alarm on the SLC with the severity of 'warning'. For example:
 | 
    |
| ▲ ncc.alarm.notice (message, code) | ||
|---|---|---|
| Parameters | As for Alarm Function Parameters. | |
| Returns | Nothing. | |
| Errors | As for Alarm Function Errors. | |
| Usage | 
Use this function to raise an alarm on the SLC with the severity of 'notice'. For example:
 | 
    |