system.alarm.getRosters
This function is used in Python Scripting.
Descriptionβ
This function returns a mapping of roster names to a list of usernames contained in the roster.
Client Permission Restrictionsβ
This scripting function has no Client Permission restrictions.
Syntaxβ
system.alarm.getRosters()
Parametersβ
None
Returnsβ
Dictionary[String, List[String]] - A dictionary that maps roster names to a list of usernames in the roster. The list of usernames will be empty if no users have been added to the roster.
Scopeβ
Gateway, Vision Client, Perspective Session
Code Examplesβ
Example #1 Vision
# This script will get all the rosters and list the users in them.
rosters = system.alarm.getRosters()
for key, values in rosters.iteritems():
# key is the roster name, values is a dict of usernames
print 'Roster', key, 'contains these users:'
for value in values:
print ' ', value
Example #2 Perspective
# This script will get all the rosters and list the users in them.
rosters = system.alarm.getRosters()
for key, values in rosters.iteritems():
# key is the roster name, values is a dict of usernames
system.perspective.print('Roster ' + key + ' contains these users:')
for value in values:
system.perspective.print(' ' + value)
Output
Roster Admins contains these users:
admin
Roster Supervisors contains these users:
asmith
jdoe