ska_tmc_centralnode.manager package

Subpackages

Submodules

ska_tmc_centralnode.manager.aggregators module

Aggregation method for telescope state Aggregating for Mid

class ska_tmc_centralnode.manager.aggregators.DishAttrValueAggregator(cm, logger)

Bases: object

This Class Aggregate k-value validation results received from Dish Leaf Nodes.

aggregate(dish_leaf_node_fqdn, kvalue_validation_result)

Aggregate the k-value validation result received from Dish leaf nodes and provide the aggregated k-value report result to Central Node.

Parameters:
  • dish_leaf_node_fqdn (str) – dish leaf node fqdn

  • kvalue_validation_result (str) – kvalue validation result code

Return type:

None

aggregate_gpm()

Aggregate the GPM version received from Dish leaf nodes and provide the list of DLN on which GPM is missing to Central Node.

Parameters:
  • dish_leaf_node_fqdn (str) – dish leaf node fqdn

  • gpm_version (dict) – GPM version on dish leaf node

Return type:

list

is_events_received_percentage_valid()

Verify the percent of kvalue validation result event received as specified by DishKvalueAggregationAllowedPercent property.

Returns:

True, if Events recieved percentage is valid. False, otherwise.

Return type:

bool

update_central_node_with_result()

This method updates the DishVccValidationStatus of Central Node.

Return type:

None

class ska_tmc_centralnode.manager.aggregators.TMCOpStateAggregator(cm, logger)

Bases: Aggregator

Class for TelescopeOpStateAggregation for low Telescope

aggregate()

Aggregate method for TMC Op State

Returns:

Aggregates TMC Op state

Return type:

DevState

class ska_tmc_centralnode.manager.aggregators.TelescopeAvailabilityAggregatorLow(cm, logger)

Bases: Aggregator

Class for TelescopeAvailablity for low Telescope

aggregate()

Aggregate method for Low Telescope Availability

Return type:

None

class ska_tmc_centralnode.manager.aggregators.TelescopeAvailabilityAggregatorMid(cm, logger)

Bases: Aggregator

Class for TelescopeAvailablity for Mid Telescope

aggregate()

Aggregate method for Mid Telescope Availability

Return type:

None

class ska_tmc_centralnode.manager.aggregators.TelescopeStateAggregatorLow(cm, logger)

Bases: Aggregator

Class for TelescopeStateAggregation for low Telescope

aggregate()

Aggregate method for TelescopeStateAggregatorLow

Returns:

Aggregates TeleScopeState for low

Return type:

DevState

class ska_tmc_centralnode.manager.aggregators.TelescopeStateAggregatorMid(cm, logger)

Bases: Aggregator

Class for TelescopeStateAggregation for Mid Telescope

aggregate()

Aggregate method for TelescopeStateAggregateMid

Returns:

Aggregates TelescopeState for mid

Return type:

DevState

ska_tmc_centralnode.manager.aggregate_process module

This module contain process for aggregation

class ska_tmc_centralnode.manager.aggregate_process.HealthAggregatorFactory

Bases: object

Factory class to return the appropriate HealthStateAggregator instance.

static get_aggregator(telescope)

Static method to return aggregator class instance

Returns:

StateAggregator instance

Return type:

StateAggregator

Raises:

ValueError – If Unknown telescope type is provided

class ska_tmc_centralnode.manager.aggregate_process.HealthStateAggregationProcessor(event_data_queue, aggregated_health_state, aggregate_update_event, telescope='mid', callback=None)

Bases: AggregationProcess

Health State Aggregation Processor

Inherits from AggregationProcess and implements health-specific state aggregation logic.

set_state_aggregator()

Return an instance of HealthStateAggregator for the given telescope.

Returns:

HealthAggregatorFactory Instance

Return type:

HealthAggregatorFactory

ska_tmc_centralnode.manager.component_manager module

This module provided an implementation of the Central Node ComponentManager.

class ska_tmc_centralnode.manager.component_manager.CNComponentManager(op_state_model, _input_parameter, logger, _update_device_callback, _update_telescope_state_callback, _update_telescope_health_state_callback, _update_tmc_op_state_callback, _update_imaging_callback, _telescope_availability_callback, array_layout_url_callback, default_array_layout_url_callback, _component=None, _liveliness_probe=ska_tmc_common.LivelinessProbeType.MULTI_DEVICE, _event_manager=True, proxy_timeout=500, event_subscription_check_period=1, liveliness_check_period=1, command_timeout=30, retry_attempts=5, retry_delay=3.0, subarray_trl_prefix='', default_array_layout_url=None, *args, **kwargs)

Bases: TmcComponentManager

A component manager for The Central Node component.

It supports:

1. Monitoring its component, e.g. detect that it has been turned off or on

2. Receiving the change events from lower level devices and trigger the TMC and telescope state aggregation

add_device(device_name)

Add device to the liveliness probe function

Parameters:

dev_name (str) – device name

Return type:

None

add_multiple_devices(device_list)

Add multiple devices to the liveliness probe function

Parameters:

device_list (list[str]) – list of device names

aggregate_process_monitor()

This method keep tracking aggregate health state changed from aggregation process

property array_layout_url: dict

Get the current array layout URL (as a dict).

build_device_attribute_map()

Builds a dictionary mapping device names to lists of attributes to be subscribed.

Returns:

A mapping from device names to list of attributes.

Return type:

Dict[str, List[str]]

check_availability_for_release(argin)

Checks the subarray availability before release based on id present in the json.

Parameters:

argin (str) – release resource input json.

Raises:

Exception – Raises Exception if subarray is not available.

check_device_responsiveness_command(command_name, subarray_id)

Override this method to add responsive checks for the devices

Parameters:
  • command_name (str) – Command name for the check

  • subarray_id (int) – Subarray id

Return type:

None

check_event_error(event, callback)

Method for checking event error.

check_if_csp_mln_is_available()

Returns boolean value based on availability of CspMasterLeafNode, which ultimately indicated availability of CspMasterNode

Return type:

bool

check_if_sdp_mln_is_available()

Returns boolean value based on availability of SdpMasterLeafNode, which ultimately indicated availability of SdpMasterNode

Return type:

bool

check_if_subarray_is_responsive(subarray_id)

Checks if subarray is responsive

Parameters:

subarray_id (int) – Subarray id

Returns:

True if the subarray device is responsive, False otherwise.

Return type:

bool

check_if_subarrays_are_responsive()

Checks if subarray are responsive

Returns:

True if at least one subarray device is responsive, False otherwise.

Return type:

bool

check_subarray_id_in_json(json_argument)

Checks subarray id is present in json or not.

Parameters:

json_argument (str) – input json string

Return type:

Tuple(bool, str)

property checked_devices

Return the list of the checked monitored devices

Returns:

list of the checked monitored devices

cleanup()
command_not_allowed_callable(subarray_id=0, desired_obsstate=None, command_name='')

This method provides callable for command not allowed

Parameters:
  • subarray_id (int) – subarray_id

  • desired_obsstate (List) – desired observation state

  • command_name (str) – command name

property component

Return the managed component

Returns:

the managed component

Return type:

Component

property default_array_layout_url: dict

Get the default array layout URL.

property devices

Return the list of the monitored devices

Returns:

list of the monitored devices

property event_queue

event queue property

get_adapter_by_device_name(device_name)

The get_adapter_by_device_name method takes a device_name as input and searches for an adapter object in the adapter_factory object’s adapters attribute that matches the input device_name. If a matching adapter object is found, it is returned. If no matching adapter object is found, first adapter is returned.

Parameters:

device_name (str) – The name of the device to search for.

Returns:

An adapter object if a matching device is found, otherwise first adapter object is returned.

get_command_id(unique_id)

Returns the command id mapped to the given unique_id.

Parameters:

unique_id – unique id of the command

Returns:

command id corresponding to unique_id

Return type:

str

get_csp_controller_admin_mode()

Retrieve the adminMode of CSP controller.

Returns:

The adminMode of the TMC CSP controller Leaf Node.

Return type:

str

get_csp_master_dev_name()

Return Csp Master device name

Return type:

str

get_csp_master_leaf_node_dev_name()

Return Csp master leaf node device name

Return type:

str

get_csp_subarray_dev_names()

Return Csp Subarray device names

Return type:

list

get_device(device_name)

Return the device info with device name dev_name

Parameters:

dev_name (str) – name of the device

Returns:

a device info

Return type:

DeviceInfo

get_dish_device_names()

Return Dish Master device names

Return type:

tuple

get_dish_leaf_node_device_names()

Return Dish leaf node device names

Return type:

tuple

get_mccs_controller_admin_mode()

Retrieve the adminMode of mccs controller.

Return type:

AdminMode

Returns:

This method returns the adminMode of the TMC mccs controller leaf Node.

get_mccs_master_dev_name()

Return Sdp Master device name

Return type:

str

get_mccs_master_leaf_node_dev_name()

Return MCCS master leaf node device name

Return type:

str

get_sdp_controller_admin_mode()

Retrieve the adminMode of sdp controller.

Return type:

AdminMode

Returns:

This method returns the adminMode of the TMC sdp controller leaf Node.

get_sdp_master_dev_name()

Return Sdp Master device name

Return type:

str

get_sdp_master_leaf_node_dev_name()

Return Sdp master leaf node device name

Return type:

str

get_sdp_subarray_dev_names()

Return Sdp Subarray device names

Return type:

list

get_subarray_id(argin)

Provides subarray id from assign json.

Parameters:

argin (str) – Assign json string

Returns:

returns subarray id

Return type:

_type_

get_subarray_obsstate(subarray_devname)

Get Current device obsState

Parameters:

subarray_devname (str) – subarray device name

Returns:

current obsstate

Return type:

ObsState

get_telescope_availability()

Getter method for Telescope Availability

Return type:

dict

get_telescope_health_state()

Getter method for telescope health state

Return type:

HealthState

get_telescope_state()

Getter method for telescope state

get_tmc_op_state()

Getter method for TMC Op State Model

property input_parameter

Return the input parameter

Returns:

input parameter

Return type:

InputParameter

is_already_assigned(dish_id)

Check if a Dish is already assigned to a subarray

Parameters:

dish_id (str) – id of the dish

Return type:

bool

:return True is already assigned, False otherwise

is_command_allowed()

This method needs to be overridden by the child classes in order to check whether command is allowed or not

is_command_allowed_before_lrc_start(subarray_id=0, command_name='')

This method checks if command is allowed before LRC start

Parameters:
  • subarray_id (int) – subarray_id

  • command_name (str) – command name

Returns:

boolean value if command in valid obstate else return exception.

Raises:
  • StateModelError – If command not permitted in observation state

  • SubarrayNotPresentError – If subarray not available

  • CommandNotAllowed – If command not allowed due to other unavailable devices

is_input_json_valid(argin)

Checks inputs json.

param argin: input json string :type argin: str

Return type:

Tuple[bool, str]

log_state(msg='Device States')

Log state method for

Return type:

None

off(task_callback=None)

This method needs to be overridden by the child classes in order to check have functionality under off command

Return type:

tuple[TaskStatus, str]

on(task_callback=None)

This method needs to be overridden by the child classes in order to check have functionality under off command

Return type:

tuple[TaskStatus, str]

process_event(attribute_name)
Process the given attribute’s event using the data from the

event_queue and invoke corresponding process method.

Parameters:

attribute_name (str) – Name of the attribute for which event is to be processed

Return type:

None

Returns:

None

reset(task_callback=None)

Placeholder method for reset command.

Parameters:

task_callback (Optional[Callable]) – Update task status, defaults to None

Returns:

task_status, message

Return type:

tuple(TaskStatus, str)

set_aggregators(_telescope_state_aggregator, _health_state_aggregator, _op_state_aggregator)

Sets Aggregators callback

Return type:

None

set_telescope_availability(telescope_availability)

Setter method for telescope availability

Return type:

None

setup_event_subscription()

Sets up the event subscription after input parameters are updated.

Return type:

None

standby(task_callback=None)

This method needs to be overridden by the child classes in order to check have functionality under off command

Return type:

tuple[TaskStatus, str]

start_communicating()

This method needs to be overridden by the child classes to have this functionality

stop()

stops liveliness probe

Return type:

None

stop_aggregation_process()

Override this method in mid and low

stop_all_process()

This stop aggregation process

stop_communicating()

This method needs to be overridden by the child classes to have this functionality

stop_event_manager()

Stops the Event Receiver

Return type:

None

telescope_off(task_callback=None, task_abort_event=None)

Turn the Telescope Off.

Returns:

a result code and message

telescope_on(task_callback=None, task_abort_event=None)

Turn the Telescope On.

Returns:

a result code and message

telescope_standby(task_callback=None, task_abort_event=None)

Standby the Telescope.

Returns:

a result code and message

update_device_admin_mode(device_name, admin_mode, timestamp)

Update a monitored device admin mode

Parameters:
  • device_name (str) – name of the device

  • admin_mode (AdminMode) – admin mode of the device

update_device_assigned_resource(dev_name, assign_resources)

Update assign_resources for a monitored device

Parameters:
  • dev_name (str) – name of the device

  • assign_resources (str) – assigned resources in JSON format

Return type:

None

update_device_health_state(device_name, health_state, timestamp)

Update a monitored device health state aggregate the health states available

Parameters:
  • dev_name (str) – name of the device

  • health_state (HealthState) – health state of the device

  • timstamp – timestamp

Return type:

None

update_device_obs_state(dev_name, obs_state)

Update a monitored device obs state, and call the relative callbacks if available

Parameters:
  • dev_name (str) – name of the device

  • obs_state (ObsState) – obs state of the device

Return type:

None

update_event_failure(device_name)

updates event failures in Dev info

Parameters:

device_name (str) – Device name

Return type:

None

update_exception_for_unresponsiveness(device_info, exception)

Set a device to failed and call the relative callback if available.

Parameters:
  • device_info (DeviceInfo) – Information about the device

  • exception (Exception) – Exception raised during the ping failure

Return type:

None

update_input_parameter()

updates the input parameter for component manager instance

Return type:

None

update_responsiveness_info(device_name)

Update a device with correct responsiveness information.

Parameters:

dev_name (str) – name of the device

Return type:

None

validate_subarray_id(json_argument)

Validates the subarray id in the assign resources json.

Parameters:

json_argument (dict) – Assign Resources json.

Raises:

InvalidJSONError – Raises error if subarray_id is not present.

ska_tmc_centralnode.manager.component_manager_mid module

This module is inherited from CNComponentManager.

It is component Manager for Mid Telecope.

It is provided for explanatory purposes, and to support testing of this package.

class ska_tmc_centralnode.manager.component_manager_mid.CNComponentManagerMid(op_state_model, _input_parameter, logger, _dish_vcc_command_status_callback, _update_device_callback, _update_telescope_state_callback, _update_telescope_health_state_callback, _update_tmc_op_state_callback, _update_imaging_callback, _telescope_availability_callback, array_layout_url_callback, default_array_layout_url_callback, _update_dishvccconfig_callback, _dishvccvalidation_callback, _component=None, _liveliness_probe=ska_tmc_common.enum.LivelinessProbeType.MULTI_DEVICE, _event_manager=True, proxy_timeout=500, event_subscription_check_period=1, liveliness_check_period=1, command_timeout=30, dish_vcc_uri=None, dish_vcc_file_path=None, dish_vcc_init_timeout=120, dishKvalueAggregationAllowedPercent=100.0, invoke_load_dish_cfg_command_callback=None, invoke_set_gpm_command_callback=None, enable_dish_vcc_init=True, k_value_valid_range_upper_limit=1177, k_value_valid_range_lower_limit=1, subarray_trl_prefix='mid-tmc/subarray/', gpm_version=None, gpm_interface=None, gpm_data_sources_prefix=None, gpm_file_path_prefix=None, default_array_layout_url=None, mkt_extension_id='MKE', *args, **kwargs)

Bases: CNComponentManager

Component manager class for central node mid

add_dishes(dln_prefix, num_dishes)

Add dishes to the liveliness probe function

Parameters:
  • dln_prefix (str) – prefix of the dish

  • num_dishes (int) – number of dishes

Return type:

list

Returns:

List of dishes

assign_resources(argin, task_callback, task_abort_event)

Submits the AssignResources command in queue.

Parameters:
  • argin (str) – input json string for assign resource command

  • task_callback (TaskCallbackType) – Update task state, defaults to None

  • task_abort_event (Event) – Event to abort the task

Returns:

task_status

Return type:

tuple

check_device_responsiveness_command(command_name, subarray_id)

This method overrides the method from super class to add responsive checks for the devices

Parameters:
  • command_name (str) – Command name for the check

  • subarray_id (int) – Subarray id

Return type:

None

check_if_csp_all_dish_ready()

Check and validate all dish and csp master is ready

Return type:

bool

Returns:

True, if all dish and csp master is ready, False, otherwise.

check_if_dishes_are_responsive()

Checks whether dishes are responsive

Return type:

bool

Returns:

True, if dishes are responsive, False otherwise

check_timeout_for_stow_mode_lrcr_events()

Check timeout error in dishln_stow_mode_cmd_exe_data dictionary

Return type:

bool

property dish_vcc_command_status

Return dish vcc command status

property dish_vcc_validation_status: dict

Getter method for dish vcc validation status

Returns:

dish vcc validation status

Return type:

dish

get_current_dish_mode_of_dln(dish_id)

Get the current dish mode of the specified dish leaf node.

Parameters:

dish_id (str) – Dish identifier to retrieve mode for

Returns:

Current mode of the specified dish

Return type:

DishMode

get_default_dish_vcc_config_params()

Return default dish vcc config json

Return type:

dict

Returns:

Default dish vcc config json

get_default_gpm_version_params()

Return default GPM version parameters

Return type:

dict

Returns:

Default GPM version parameters

get_dish_leaf_node_device_names()

Return Dish leaf node device names

Return type:

tuple

Returns:

A tuple of dish leaf node devices names

get_load_disg_cfg_resultcode()

Return Aggregated command result for Load Dish Cfg command

Return type:

ResultCode

Returns:

Aggregated command result for Load Dish Cfg command

get_set_gpm_version_resultcode()

Return Aggregated command result for Set GPM Version command

Return type:

ResultCode

Returns:

Aggregated command result for Set GPM Version command

get_set_stow_mode_resultcode()

Return Aggregated command result for Set Stow Mode command

Return type:

ResultCode

Returns:

Aggregated command result(ResultCode) for Set Stow Mode command

property global_pointing_model_status: dict

Getter method for dish GPM version status

Returns:

dish GPM version status

Return type:

dish

handle_dish_vcc_validation_result(dev_name, result)

Handle Dish Vcc Validation Result Based on following table Result codes handled and attributes updated

Result Code | Meaning

UNKNOWN | Dish Vcc Config not set on CSP

OK | Dish Vcc Config on CSP LN and CSP match

FAILED | Mismatch in dish vcc version on CSP LN and CSP Master

NOT_ALLOWED | CSP master is not available

Result Code | Action

UNKNOWN | Load Dish Config using LoadDishCfg command

OK | Dish Vcc already set so set is_dish_vcc_config_set to True

FAILED | Dish Vcc is mismatch so set set is_dish_vcc_config_set to False

NOT_ALLOWED | Set is_dish_vcc_config_set to False

Parameters:
  • dev_name (str) – Device name

  • result (ResultCode) – ResultCode

Return type:

None

handle_gpm_version_event(dev_name, gpmVersion)

Handle the GPM version Based on following table Result codes handled and attributes updated

String | Meaning

UNKNOWN | GPM version not set on Dish

Version | GPM is already invoked

String | Action

UNKNOWN | Apply GPM using SetGlobalPointingModel command

Version | Version is set, no need to invoke SetGlobalPointingModel

command

Parameters:
  • dev_name (str) – Device name

  • result (ResultCode) – ResultCode

Return type:

None

is_command_allowed(command_name=None)

Checks whether this command is allowed It checks that the device is in a state to perform this command and that all the component needed for the operation are not unresponsive

Parameters:

command_name (str) – name of the command

Return type:

bool

Returns:

True if this command is allowed

is_csp_dish_ready()

his method wait for csp master leaf node and dish leaf nodes to become ready to accept request

Return type:

bool

Returns:

True, if csp master leaf node and dish leaf nodes are ready, False otherwise

property is_dish_vcc_config_set

Getter method for is_dish_vcc_config_set

is_valid_admin_mode()

Validates that all relevant subarray devices are in a valid admin mode.

Returns:

True if all subarrays are in a valid mode, False otherwise.

Return type:

bool

load_dish_cfg(argin, task_callback, task_abort_event)

Load Dish Cfg command for Dish-VCC map.

Parameters:

argin (str) – Dish Id Vcc map initial params

Return type:

Tuple[ResultCode, str]

Returns:

a result code and message

release_resources(argin, task_callback, task_abort_event)

Submit the ReleaseResource command in queue.

Parameters:
  • argin (str) – input json string for release resource command

  • task_callback (TaskCallbackType) – Updates task status

  • task_abort_event (Event) – Event to abort the task

Returns:

task_status

Return type:

tuple

reset_gpm_data()

Reset GPM data

Return type:

None

reset_load_dish_cfg_data()

Reset all data which is set for aggregating LoadDisgCfg command

Return type:

None

reset_stow_mode_data()

Reset StowMode data

Return type:

None

set_dish_mode_in_stow_mode_cmd_exe_data()

“Set dish mode in stow mode command execution data dictionary.

Return type:

None

set_gpm_version(argin, task_callback, task_abort_event)

Set GPM version for Dish.

Parameters:

argin (str) – Dish Id’s with the specified bands and version.

Return type:

Tuple[ResultCode, str]

Returns:

a result code and message

set_stow_mode(argin, task_callback, task_abort_event)

Set stow mode for given dishes.

Parameters:

argin (str) – Dish Id’s.

Return type:

Tuple[ResultCode, str]

Returns:

a result code and message

stop_aggregation_process()

Stop aggregation process

Return type:

None

update_device_dish_mode(dev_name, dish_mode)

Update the dish mode of the given dish leaf node and call the relative callbacks if available.

Parameters:
  • dev_name (str) – Device name

  • dishMode – Dish mode of the device

Return type:

None

update_device_state(device_name, state)

Update a monitored device state, aggregate the states available and call the relative callbacks if available

Parameters:
  • dev_name (str) – name of the device

  • state (DevState) – state of the device

Return type:

None

update_dish_vcc_flag(value)

Update dish vcc flag and call telescope state aggregator

Parameters:

value (bool) – Value of the dish vcc config flag

Return type:

None

update_k_value_validation(dev_name, kvalue)

Updates the k value validation value and starts the aggregation.

Parameters:
  • dev_name (str) – device name

  • kvalue (ResultCode) – k value validation result

Return type:

None

update_telescope_availability(device_name, event_value)

Updates telescope availablity status

Parameters:
  • device_name (str) – Device name

  • event_value – Event value

Return type:

None

validate_assign_json(argin)

Validates assign resources json

Parameters:

argin (str) – json input

Returns:

Returns the original argument and exception message.

Return type:

tuple[str, str]

validate_release_json(argin)

Validates the release resource json.

Parameters:

argin (str) – release resource json string.

Returns:

Returns the original argument and exception message.

Return type:

tuple[str, str]

ska_tmc_centralnode.manager.component_manager_low module

This module is inherited from CNComponentManager.

It is component Manager for Low Telecope.

It is provided for explanatory purposes, and to support testing of this package.

class ska_tmc_centralnode.manager.component_manager_low.CNComponentManagerLow(op_state_model, _input_parameter, logger, _update_device_callback, _update_telescope_state_callback, _update_telescope_health_state_callback, _update_tmc_op_state_callback, _update_imaging_callback, _telescope_availability_callback, array_layout_url_callback, default_array_layout_url_callback, _component=None, _liveliness_probe=ska_tmc_common.enum.LivelinessProbeType.MULTI_DEVICE, _event_manager=True, proxy_timeout=500, event_subscription_check_period=1, liveliness_check_period=1, command_timeout=30, subarray_trl_prefix='low-tmc/subarray/', is_auto_recovery_enabled=True, default_array_layout_url=None, *args, **kwargs)

Bases: CNComponentManager

Component Manager class for low central node

assign_resources(argin, task_callback, task_abort_event)

Submits the AssignResources command in queue.

Parameters:
  • argin (str) – input json string for assign resource command

  • task_callback (TaskCallbackType) – Updates task status

  • task_abort_event (Event) – Event to abort the task

Returns:

task_status

Return type:

tuple

property assign_resources_schema_version: str

Gets the schema version assigned to resources.

Returns:

The current value of the assign_resources_schema_version.

Return type:

str

check_device_responsiveness_command(command_name, subarray_id)

This method overrides the method from super class to add responsive checks for the devices

Parameters:
  • command_name (str) – Command name for the check

  • subarray_id (int) – Subarray id

Return type:

None

check_if_mccs_mln_is_available()

Returns boolean value based on availability of MccsMasterLeafNode, which indicated availability of Mccs Master.

Returns:

boolean value based on availability of MccsMasterLeafNode

Return type:

bool

check_if_mccs_mln_is_responsive()

Checks whether mccs mln is responsive

get_unique_ids()

Provides unique id for processing long running command result events.

Returns:

Provides list of unique ids under progress

Return type:

list

is_command_allowed(command_name=None)

Checks whether this command is allowed It checks that the device is in a state to perform this command and that all the component needed for the operation are not unresponsive

Parameters:

command_name (str) – name of the command

Returns:

True if this command is allowed

Return type:

boolean

is_valid_admin_mode()

Extends the base admin mode validation with MCCS check for LOW telescope.

Returns:

True if all controllers including MCCS are in valid admin mode.

Return type:

bool

release_resources(argin, task_callback, task_abort_event)

Submit the ReleaseResource command in queue.

Parameters:
  • argin (str) – input json string for release resource command

  • task_callback (TaskCallbackType) – Updates task status

  • task_abort_event (Event) – Event to abort the task

Returns:

task_status

Return type:

tuple

property release_resources_schema_version: str

Gets the schema version release the assigned resources.

Returns:

The current value of the release_resources_schema_version.

Return type:

str

reset_event_count(command_id)

Reset count function to reset sdp and csp events count and error dictionary

stop_aggregation_process()

Stop aggregation process

update_device_state(device_name, state)

Update a monitored device state, aggregate the states available and call the relative callbacks if available

Parameters:
  • device_name (str) – name of the device

  • state (DevState) – state of the device

update_subarray_pss_beams_mapping(json_argument)

Method to update the mapping of subarray_id to the assigned pss beams

Parameters:

json_argument (dict) – The string in JSON format.

Returns:

The string in JSON format.

Return type:

dict

update_telescope_availability(device_name, event_value)

Updates telescope availability

validate_assign_json(argin)

Validates the assign resources json.

Parameters:

argin (str) – Assign resources json string.

Returns:

Returns the original argument and exception message.

Return type:

tuple[str, str]

validate_release_json(argin)

Validates the release resource json.

Parameters:

argin (str) – release resource json string.

Returns:

Returns the original argument and exception message.

Return type:

tuple[str, str]

ska_tmc_centralnode.manager.event_data_manager module

Use event manager to manage all event related data

class ska_tmc_centralnode.manager.event_data_manager.AdminModeData(admin_mode, event_timestamp)

Bases: object

DataClass for AdminMode and its Timestamp

admin_mode: AdminMode
event_timestamp: datetime
class ska_tmc_centralnode.manager.event_data_manager.EventDataManager(component_manager)

Bases: object

A class to update the values of events received for different

attributes in EventDataStorage class

compare_timevals(current_timestamp, received_timestamp)
A method to compare the timestamps of events received with the

existing timestamp.

get_enum_name_from_value(enum_class, value)

Get the name from value of enum

update_aggragation_queue()
A method to put a copy of the EventDataStorage object whenever

it receives an event.

update_event_data(device, data, data_type, received_timestamp=None)

A method to receive and update device name, data, and timestamp in the EventDataStorage Class

class ska_tmc_centralnode.manager.event_data_manager.EventDataStorage(health_state_data=<factory>, admin_mode_data=<factory>)

Bases: object

A class to store the Events received for different attributes.

admin_mode_data: dict
health_state_data: dict
class ska_tmc_centralnode.manager.event_data_manager.HealthStateData(health_state, event_timestamp, is_dish_leaf_node=False)

Bases: object

DataClass for HealthState and its Timestamp.

event_timestamp: datetime
health_state: HealthState
is_dish_leaf_node: bool = False
ska_tmc_centralnode.manager.event_data_manager.pre_process(func)

Decorator for preprocessing event data

Return type:

Callable

ska_tmc_centralnode.manager.event_manager module

Event manager class for CentralNode

class ska_tmc_centralnode.manager.event_manager.CentralNodeEventManager(component_manager, subscription_configuration=None, logger=<Logger ska_tmc_centralnode.manager.event_manager (WARNING)>, stateless=True, event_subscription_check_period=1, event_error_max_count=10, status_update_callback=None, maximum_status_queue_size=50)

Bases: EventManager

CentralNodeEventManager class inherits from EventManager and adds event callbacks.

adminmode_event_callback(event)

It handles the admin mode events of subsystem’s controller and subaray devices.

Parameters:

event_data (tango.EventType.CHANGE_EVENT) – to flag the change in event.

Return type:

None

assignedresources_event_callback(event)

Handles assigned Resources event.

Parameters:

event_data (tango.EventType.CHANGE_EVENT) – to flag the change in event.

Return type:

None

cspcontrolleradminmode_event_callback(event)

It handles the adminMode events of csp controller device.

Parameters:

event_data (tango.EventType.CHANGE_EVENT) – to flag the change in event.

Return type:

None

dishmode_event_callback(event)

Method to handle and update the latest value of dishMode attribute.

Parameters:

event_data (tango.EventType.CHANGE_EVENT) – to flag the change in event.

Return type:

None

dishvccmapvalidationresult_event_callback(event)

Handle DishVccMapValidationResult change event.

Parameters:

event_data (tango.EventType.CHANGE_EVENT) – to flag the change in event.

Return type:

None

gpmversion_event_callback(event)

Handle GPM version change event.

Parameters:

event_data (tango.EventType.CHANGE_EVENT) – to flag the change in event.

Return type:

None

healthstate_event_callback(event)

It handles the health state events of subsystem’s controller and subarray devices.

Parameters:

event_data (tango.EventType.CHANGE_EVENT) – to flag the change in event.

Return type:

None

issubarrayavailable_event_callback(event)

Method to handle and update the latest value of isSubarrayAvailable attribute.

Parameters:

event_data (tango.EventType.CHANGE_EVENT) – to flag the change in event.

Return type:

None

issubsystemavailable_event_callback(event)

Method to handle and update the latest value of isSubsystemAvailable attribute.

Parameters:

event_data (tango.EventType.CHANGE_EVENT) – to flag the change in event.

Return type:

None

kvaluevalidationresult_event_callback(event)

Method to handle kValueValidationResult from dish leaf node.

Parameters:

event_data (tango.EventType.CHANGE_EVENT) – to flag the change in event.

Return type:

None

mccscontrolleradminmode_event_callback(event)

It handles the adminMode events of mccs controller device.

Parameters:

event_data (tango.EventType.CHANGE_EVENT) – to flag the change in event.

Return type:

None

obsstate_event_callback(event)

Handles observation state event.

Parameters:

event_data (tango.EventType.CHANGE_EVENT) – to flag the change in event.

Return type:

None

sdpcontrolleradminmode_event_callback(event)

It handles the adminMode events of sdp controller device.

Parameters:

event_data (tango.EventType.CHANGE_EVENT) – to flag the change in event.

Return type:

None

state_event_callback(event)

It handles the state events of subsystem’s controller and subaray devices.

Parameters:

event_data (tango.EventType.CHANGE_EVENT) – to flag the change in event.

Return type:

None

Module contents

Command Timeout

The CommandTimeout attribute is introduced to allow updating the timeout value for commands without requiring a redeployment. This provides flexibility in tuning the timeout dynamically at runtime based on operational needs.

The CommandTimeOutDefault property is also introduced, which can be used to set a default timeout value during the deployment phase. This ensures that an initial timeout value is preconfigured when the component starts for the first time.

Usage

  • CommandTimeout attribute - Can be updated at runtime without redeployment. - Helps in adapting to varying command execution times.

  • CommandTimeOutDefault property - Configurable in the deployment configuration (e.g., values.yaml). - Sets the initial timeout value at startup.

Array Layout URL Attributes

The DefaultArrayLayoutURL attribute is introduced to define the default array layout configuration used by the Central Node. This attribute specifies the default array layout source and path that the system will use at startup or when no specific layout is provided.

The arrayLayoutFileProvided attribute is introduced to indicating whether the default array layout URL is provided.

The ArrayLayoutURL attribute is introduced to indicate the current array layout configuration actively in use by the Central Node. This allows dynamic updates to the array layout at runtime without requiring a redeployment, providing flexibility for testing or operational adjustments.

# Array Layout URL Properties

## DefaultArrayLayoutSourceURIs

The DefaultArrayLayoutSourceURIs device property defines the default source URIs for the Array Layout. It specifies the TelModel repository source(s). The default value of the property is set to empty string.

Example:

["gitlab://gitlab.com/ska-telescope/ska-telmodel-data?main#tmdata"]

ka-telescope/ska-telmodel-data?main#tmdata

## DefaultArrayLayoutPath

The DefaultArrayLayoutPath device property defines the default array layout path within the TelModel data. The default value of the property is set to empty string.

Example:

instrument/ska1_mid/layout/mid-layout.json

Default value:

instrument/ska1_mid/layout/mid-layout.json

Note

The properties DefaultArrayLayoutSourceURIs and DefaultArrayLayoutPath are set to empty strings as per SKB-1282 resolution.