system.alarm.cancel
This function is used in Python Scripting.
Description
Cancels any number of alarms, specified by their event ids. The event id is generated for an alarm when it becomes active, and is used to identify a particular event from other events for the same source. The alarm will still be active, but will drop out of alarm pipelines.
Client Permission Restrictions
Permission Type: Alarm Management
Client access to this scripting function is blocked to users that do not meet the role/zone requirements for the above permission type. This function is unaffected when run in the Gateway scope.
Syntax
system.alarm.cancel(alarmIds)
Parameters
Type | Parameter | Description |
---|---|---|
String[] | alarmIds | List of alarm event ids (uuids) to cancel. |
Returns
Nothing
Scope
All
Code Examples
Example #1
# This example shows the basic syntax for cancelling an alarm.
system.alarm.cancel(['c27c06d8-698f-4814-af89-3c22944f58c5'])
Example #2
# To cancel all currently active alarms:
ids = []
results = system.alarm.queryStatus(state=["ActiveUnacked", "ActiveAcked"])
for result in results:
id = result.getId()
ids.append(str(id))
system.alarm.cancel(ids)