Pdu subpackage

This subpackage implements pdu functionality for MCCS.

class MccsPdu(*args, **kwargs)

An implementation of a PDU Tango device for MCCS.

__init__(*args, **kwargs)

Initialise a new instance.

Parameters:
  • args (Any) – positional arguments.

  • kwargs (Any) – keyword arguments.

create_component_manager()

Create and return a component manager.

Return type:

PduComponentManager

Returns:

SNMPComponent manager

delete_device()

Delete the device.

Return type:

None

healthReport()

Get the health report.

Return type:

str

Returns:

the health report.

init_device()

Initialise the device.

Return type:

None

pduPortOff(port)

Set pdu port OFF.

Parameters:

port (int) – The pdu port to turn off

Return type:

None

pduPortOn(port)

Set pdu port On.

Parameters:

port (int) – The pdu port to turn on

Return type:

None

class PduComponentManager(host, port, authority, max_objects_per_pdu, logger, communication_state_callback, component_state_callback, attributes, poll_rate, power_marshaller_trl)

A component manager for a PDU.

__init__(host, port, authority, max_objects_per_pdu, logger, communication_state_callback, component_state_callback, attributes, poll_rate, power_marshaller_trl)

Initialise a new instance.

Parameters:
  • host (str) – the hostname of the pdu

  • port (int) – port of the pdu

  • authority (str | dict[str, str]) – the snmp authority of the pdu

  • max_objects_per_pdu (int) – max objects per pdu

  • logger (Logger) – logger

  • communication_state_callback (CommunicationStatusCallbackType) – callback to be called when the status of the communications channel between the component manager and its component changes

  • component_state_callback (Callable[..., None]) – callback to be called when the component state changes

  • attributes (Sequence[SNMPAttrInfo]) – pdu attributes

  • poll_rate (float) – how often the pdu polls

  • power_marshaller_trl (Optional[str]) – trl of power marhsaller

schedule_power(attached_device_info, device_trl, command_str, on_off)

Request a power schedule from the marshaller.

Parameters:
  • attached_device_info (str) – details about the attached device.

  • device_trl (str) – trl of this device.

  • command_str (str) – name of the command being called.

  • on_off (str) – args to be called for the command.

Return type:

None

start_communicating()

Establish communication with the station components.

Return type:

None

stop_communicating()

Break off communication with the station components.

Return type:

None

class PduHealthModel(health_changed_callback, ignore_power_state)

A health model for a PDU.

At present this uses the base health model; this is a placeholder for a future, better implementation.

__init__(health_changed_callback, ignore_power_state)

Initialise a new instance.

Parameters:
  • health_changed_callback (Callable) – a callback to be called when the health of the PDU (as evaluated by this model) changes

  • ignore_power_state (bool) – whether the health model should ignore the power state when computing health.