system.alarm.shelve
This function is used in Python Scripting.
Description
This function shelves the specified alarms for the specified amount of time. The paths may be either source paths, or display paths. The time can be specified in minutes (timeoutMinutes) or seconds (timeoutSeconds). If an alarm is already shelved, this will overwrite the remaining time. To unshelve alarms, this function may be used with a time of "0".
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.shelve(path, timeoutSeconds, timeoutMinutes)
Parameters
- String[]
path
- A list of possible source paths to search at. If a path ends in "/*", the results will include anything below that path. - Integer
timeoutSeconds
- The amount of time to shelve the matching alarms for, specified in seconds. 0 indicates that matching alarm events should now be allowed to pass. - Integer
timeoutMinutes
- The amount of time to shelve the matching alarms for, specified in minutes. 0 indicates that matching alarm events should now be allowed to pass.
- String[]
Returns
- Nothing
Scope
- All
Code Examples
Example #1
# This example assumes that data has been loaded into a table ("Table") from system.alarm.queryStatus, and it shelves the selected alarms for 5 minutes.
# It also assumes that it is being executed from a button's actionPerformed event.
table = event.source.parent.getComponent('Table')
rows = table.selectedRows
data = table.data
if len(rows)>0:
sourcePaths = [str(data.getValueAt(r,'Source')) for r in rows]
system.alarm.shelve(path=sourcePaths,timeoutMinutes=5)