Archiving2Yaml

Archiving2yaml

Simple helper script to generate a configuration file from an existing archive setup.

class tools.v1.archiving2yaml.Archiving2yaml[source]

Class provides functionality to fetch details from the archiver and format zthe data for yaml file generation.

add_archiver_trls(host: str, port: str, archiver_name: str)[source]

Adds the archiver full trls into a list.

Parameters:
  • host (str) – tango host of event subscriber

  • port (str) – port of event subscriber

  • archiver_name (str) – name of event subscriber

check_archivers_in_manager(configuration_manager: str) bool[source]

Method checks if manager contains any of the event subscriber present in the file.

Parameters:

configuration_manager (str) – configuration manager

Returns:

Returns True if any of the archiver is present manager.

Return type:

bool

get_full_trl(host: str, port: str, dev_name: str) str[source]

Method to provide the short trl from full trl.

Parameters:
  • dev_name (str) – device name

  • dev_name – tango host

  • dev_name – tango port

Returns:

Returns the short trl of device.

Return type:

str

get_host_id(host: str, port: str) str[source]

Provides the tango host id based on host and port details.

Parameters:
  • host (str) – Tango host name.

  • port (str) – Tango database port name.

get_host_port_from_id(host_id: str) tuple[str, str][source]

Provides host and port details from host_id

Parameters:

host_id (str) – host id

Returns:

Returns host and port details for the host id.

Return type:

tuple[str]

get_host_port_from_trl(device_name: str) tuple[str, str][source]

Provides tango host and port details from the trl

Parameters:

device_name (str) – device name.

Returns:

Returns tango host and port of the device.

Return type:

tuple[str,str]

get_manager_id(manager: str) str[source]

Method provides the configuration manager id based on the manager trl.

Parameters:

manager (str) – _description_

Returns:

Returns configuration manager id

Return type:

str

get_managerid_of_archiver(archiver: str) str[source]

Method provides the manager id based on event subsriber trl.

Parameters:

archiver (str) – event subscriber trl.

Returns:

Returns the event subscriber id

Return type:

str

get_short_trl(dev_name: str) str[source]

Method to provide the short trl from full trl.

Parameters:

dev_name (str) – device name

Returns:

Returns the short trl of device.

Return type:

str

is_full_trl(device_name: str) bool[source]

Method checks if the trl is full or short.

Parameters:

device_name (str) – Device name.

Returns:

Returns True if trl is in full format else False.

Return type:

bool

remove_unnecessary_values(configurations: dict)[source]

Method to remove unnecessary values from the configuraiton data.

Parameters:

configurations (dict) – Attribute configuration data.

set_all_archiver_attribute_configuration()[source]

Method sets the attribute configuration information for all the archiver.

set_archivers(archiver_names: list[str])[source]

Sets Event subscriber details based on list provided.

archiver_names (list): The name of archivers for which data needs

to be checked. For example: [“mid-eda/es/01”] or [“mid-eda/es/01”,”mid-eda/es/02”]. Also accepts [“mid-eda/es/*”], this would get all the instance present in current host.

set_attribute_configuration(archiver: str, es_id: str)[source]

Method sets attribute configuration

Parameters:

archiver (str) – event subscriber name.

set_configuration_managers(configuration_managers: list[str])[source]

Method sets the configuration manager details.

Parameters:

configuration_managers (list) – List of configuration manager trl

set_tango_hosts(archiver_names: list[str])[source]

Sets tango host into required format from archiver trl.

Parameters:

archiver_names (list[str]) – list of tango hosts. For example: [“mid-eda/es/01”], here it uses current tango host. [“tango://tango-databaseds:10000/mid-eda/es/01”, “tango://tango-databaseds2:10000/mid-eda/es/*”] Here,incase of “tango-databaseds2” the port will be set to default that is 10000. Please use KUBE DNS <host>.<namespace>.svc.<cluster-domain> for hosts outside the current namespace of deployment.