Alarm Handler Device

This module implements SKAAlarmHandler, a generic base device for Alarms for SKA.

It exposes SKA alarms and SKA alerts as Tango attributes. SKA Alarms and SKA/Element Alerts are rules-based configurable conditions that can be defined over multiple attribute values and quality factors, and are separate from the “built-in” Tango attribute alarms.

class AlarmHandlerComponentManager(logger: Logger, communication_state_callback: Optional[Callable[[CommunicationStatus], None]] = None, component_state_callback: Optional[Callable[[...], None]] = None, **state: Any)[source]

A stub for an alarm handler component manager.

class SKAAlarmHandler(*args: Any, **kwargs: Any)[source]

A generic base device for Alarms for SKA.

init_command_objects() None[source]

Set up the command objects.

create_component_manager() ComponentManagerT[source]

Create and return a component manager for this device.

Raises:

NotImplementedError – because it is not implemented.

statsNrAlerts() int

Read number of active alerts.

Returns:

Number of active alerts

statsNrAlarms() int

Read number of active alarms.

Returns:

Number of active alarms

statsNrNewAlarms() int

Read number of new active alarms.

Returns:

Number of new active alarms

statsNrUnackAlarms() float

Read number of unacknowledged alarms.

Returns:

Number of unacknowledged alarms.

statsNrRtnAlarms() float

Read number of returned alarms.

Returns:

Number of returned alarms

activeAlerts() list[str]

Read list of active alerts.

Returns:

List of active alerts

activeAlarms() list[str]

Read list of active alarms.

Returns:

List of active alarms

class GetAlarmRuleCommand(logger: Optional[Logger] = None, validator: Optional[ArgumentValidator] = None)[source]

A class for the SKAAlarmHandler’s GetAlarmRule() command.

do(*args: Any, **kwargs: Any) str[source]

Stateless hook for SKAAlarmHandler GetAlarmRule() command.

Parameters:
  • args – positional arguments to the command. This command takes a single positional argument, which is the name of the alarm.

  • kwargs – keyword arguments to the command. This command does not take any, so this should be empty.

Returns:

JSON string containing alarm configuration info: rule, actions, etc.

class GetAlarmDataCommand(logger: Optional[Logger] = None, validator: Optional[ArgumentValidator] = None)[source]

A class for the SKAAlarmHandler’s GetAlarmData() command.

do(*args: Any, **kwargs: Any) str[source]

Stateless hook for SKAAlarmHandler GetAlarmData() command.

Parameters:
  • args – positional arguments to the command. This command takes a single positional argument, which is the name of the alarm.

  • kwargs – keyword arguments to the command. This command does not take any, so this should be empty.

Returns:

JSON string specifying alarm data

class GetAlarmAdditionalInfoCommand(logger: Optional[Logger] = None, validator: Optional[ArgumentValidator] = None)[source]

A class for the SKAAlarmHandler’s GetAlarmAdditionalInfo() command.

do(*args: Any, **kwargs: Any) str[source]

Stateless hook for SKAAlarmHandler GetAlarmAdditionalInfo() command.

Parameters:
  • args – positional arguments to the command. This command takes a single positional argument, which is the name of the alarm.

  • kwargs – keyword arguments to the command. This command does not take any, so this should be empty.

Returns:

JSON string specifying alarm additional info

class GetAlarmStatsCommand(logger: Optional[Logger] = None, validator: Optional[ArgumentValidator] = None)[source]

A class for the SKAAlarmHandler’s GetAlarmStats() command.

do(*args: Any, **kwargs: Any) str[source]

Stateless hook for SKAAlarmHandler GetAlarmStats() command.

Parameters:
  • args – positional arguments to the command. This command does not take any, so this should be empty.

  • kwargs – keyword arguments to the command. This command does not take any, so this should be empty.

Returns:

JSON string specifying alarm stats

class GetAlertStatsCommand(logger: Optional[Logger] = None, validator: Optional[ArgumentValidator] = None)[source]

A class for the SKAAlarmHandler’s GetAlertStats() command.

do(*args: Any, **kwargs: Any) str[source]

Stateless hook for SKAAlarmHandler GetAlertStats() command.

Parameters:
  • args – positional arguments to the command. This command does not take any, so this should be empty.

  • kwargs – keyword arguments to the command. This command does not take any, so this should be empty.

Returns:

JSON string specifying alert stats

main(*args: str, **kwargs: str) int[source]

Entry point for module.

Parameters:
  • args – positional arguments

  • kwargs – named arguments

Returns:

exit code