WatcherCsc#
- class lsst.ts.watcher.WatcherCsc(config_dir=None, initial_state=State.STANDBY, override='')#
Bases:
ConfigurableCscThe Watcher CSC.
- Parameters:
config_dir (
str, optional) – Directory of configuration files, or None for the standard configuration directory (obtained fromget_default_config_dir). This is provided for unit testing.initial_state (
salobj.Stateorint, optional) – The initial state of the CSC. This is provided for unit testing, as real CSCs should start up inlsst.ts.salobj.StateSTANDBY, the default.override (
str, optional) – Configuration override file to apply ifinitial_stateisState.DISABLEDorState.ENABLED.
- Raises:
salobj.ExpectedError – If initial_state is invalid.
Attributes Summary
Methods Summary
begin_start(data)Begin do_start; configure the CSC before changing state.
Shut down pending tasks.
configure(config)Configure the CSC.
deescalate_alarm(alarm)De-escalate an alarm by resolving the associated SquadCast incident.
do_acknowledge(data)do_makeLogEntry(data)Make log entry for alarms.
do_mute(data)Mute one or more alarms.
do_showAlarms(data)Show all alarms.
do_unacknowledge(data)Unacknowledge one or more alarms.
do_unmute(data)Unmute one or more alarms.
escalate_alarm(alarm)Escalate an alarm by creating a SquadCast incident.
Get the name of the configuration package, e.g. "ts_config_ocs".
Called when the summary state has changed.
output_alarm(alarm)Output the alarm event for one alarm.
Attributes Documentation
- enable_cmdline_state = True#
- require_settings = True#
- valid_simulation_modes: Sequence[int] = [0]#
- version = '1.23.6'#
Methods Documentation
- async begin_start(data)#
Begin do_start; configure the CSC before changing state.
- Parameters:
data (
cmd_start.DataType) – Command data
Notes
The
overridefield must be one of:The name of a config label or config file
The name and version of a config file, formatted as
<file_name>:<version>, where the version is a git reference, such as a git tag or commit hash. This form does not support labels.
- async close_tasks()#
Shut down pending tasks. Called by
close.
- async configure(config)#
Configure the CSC.
- Parameters:
config (
object) – The configuration, as described by the config schema, as a struct-like object.
Notes
Called when running the
startcommand, just before changing summary state fromState.STANDBYtoState.DISABLED.
- async deescalate_alarm(alarm)#
De-escalate an alarm by resolving the associated SquadCast incident.
Clear alarm.escalated_id and, if alarm.escalated_id is valid (does not start with “Failed”), tell SquadCast to close the alert.
- async do_acknowledge(data)#
- async do_makeLogEntry(data)#
Make log entry for alarms.
- async do_mute(data)#
Mute one or more alarms.
- async do_showAlarms(data)#
Show all alarms.
- async do_unacknowledge(data)#
Unacknowledge one or more alarms.
- async do_unmute(data)#
Unmute one or more alarms.
- async escalate_alarm(alarm)#
Escalate an alarm by creating a SquadCast incident.
Store the ID of the alert in alarm.escalation_id. If the attempt fails, store an error message that begins with “Failed: “ in alarm.escalation_id.
If self.model.config.escalation_url is blank then check the conditions in the Raises section, but do nothing else.
- Raises:
RuntimeError – If pre-conditions are not met (escalation is not attempted): * alarm.escalated_id is not blank: the alarm was already escalated (or at least an attempt was made). * alarm.do_escalate false: alarm should not be escalated. * alarm.escalation_responder empty: there is nobody to escalate the alarm to (so do_escalate should never have been set).
- static get_config_pkg()#
Get the name of the configuration package, e.g. “ts_config_ocs”.
- async handle_summary_state()#
Called when the summary state has changed.
Override to perform tasks such as starting and stopping telemetry (example).
Notes
The versions in
BaseCscandConfigurableCscdo nothing, so if you subclass one of those you do not need to callawait super().handle_summary_state().
- async output_alarm(alarm)#
Output the alarm event for one alarm.