Model¶
- class lsst.ts.watcher.Model(domain, config, alarm_callback=None)¶
Bases:
object
Watcher model: constructs and manages rules and alarms.
- Parameters
- domain
lsst.ts.salobj.Domain
DDS Domain.
- config
types.SimpleNamespace
Watcher configuration validated against the Watcher schema.
- alarm_callbackcallable, optional
Function to call when an alarm changes state. It receives one argument: the alarm. If None then no callback occurs.
- domain
Attributes Summary
Get or set the enabled state of the Watcher model.
Methods Summary
acknowledge_alarm
(name, severity, user)Acknowledge one or more alarms.
add_rule
(rule)Add a rule.
close
()Stop rules and close remotes.
disable
()Disable the model.
enable
()Enable the model.
get_rules
(name_regex)Get all rules whose name matches the specified regular expression.
mute_alarm
(name, duration, severity, user)Mute one or more alarms for a specified duration.
start
()Start all remotes.
unacknowledge_alarm
(name)Unacknowledge one or more alarms.
unmute_alarm
(name)Unmute one or more alarms.
Attributes Documentation
- enabled¶
Get or set the enabled state of the Watcher model.
Methods Documentation
- acknowledge_alarm(name, severity, user)¶
Acknowledge one or more alarms.
- add_rule(rule)¶
Add a rule.
- Parameters
- rule
BaseRule
Rule to add.
- rule
- Raises
- ValueError
If a rule by this name already exists
- RuntimeError
If the rule uses a remote for which no IDL file is available in the ts_idl package.
- RuntimeEror:
If the rule references a topic that does not exist.
- async close()¶
Stop rules and close remotes.
- disable()¶
Disable the model. A no-op if already disabled.
- enable()¶
Enable the model. A no-op if already enabled.
- get_rules(name_regex)¶
Get all rules whose name matches the specified regular expression.
- Parameters
- name_regex
str
Regular expression for alarm name(s) to return.
- name_regex
- Returns
- rules
generator
An iterator over rules.
- rules
- mute_alarm(name, duration, severity, user)¶
Mute one or more alarms for a specified duration.
- async start()¶
Start all remotes.