mgmt module
The mgmt module offers high-level functions for managing test chassis, modules, and ports.
|
Reserve a tester regardless whether it is owned by others or not. |
|
Free a tester. |
|
Get chassis system uptime in seconds |
|
Get the module objects of the tester specified by module index ids |
|
Reserve modules regardless whether they are owned by others or not. |
|
Free modules. |
|
Get the module's supported configurations in a list. |
|
Configure multiple modules with specified media, port count and port speed. |
|
Change the module configuration to the target media, port count and port speed. |
|
Get module's End-of-Life date |
|
Get days until module's End-of-Life date |
|
Get module cage insertion count of each cage |
|
Get module cage count |
|
Get ports of the tester specified by port ids |
|
Get a port of the module |
|
Reserve a port regardless whether it is owned by others or not. |
|
Free a port. |
|
Reset a list of ports. |
|
Remove all streams on a port witout resetting the port. |
Module Contents
The resource management high-level function module, including testers, modules, ports, and streams.
- async reserve_tester(tester, force=True)[source]
Reserve a tester regardless whether it is owned by others or not.
- Parameters:
tester (
L23Tester) – The tester to reserveforce (boolean) – Should force reserve the tester
- Returns:
- Return type:
None
- async release_tester(tester, should_release_modules_ports=False)[source]
Free a tester. If the tester is reserved by you, release the tester. If the tester is reserved by others, relinquish the tester. The tester should have no owner afterwards.
- Parameters:
tester (
L23Tester) – The tester to freeshould_release_modules_ports (bool, optional) – should modules and ports also be freed, defaults to False
- Returns:
- Return type:
None
- async get_chassis_sys_uptime(tester)[source]
Get chassis system uptime in seconds
- Parameters:
tester (
L23Tester) – The tester to free- Returns:
Chassis system uptime in seconds
- Return type:
- obtain_modules_by_ids(tester, module_ids)[source]
Get the module objects of the tester specified by module index ids
- Parameters:
tester (
L23Tester) – The tester objectmodule_ids – the index ids of the modules.
Use “*” to get all modules.
If the list is empty, return all modules of the tester
- Raises:
NoSuchModuleError – No such a module index on the tester
- Returns:
module objects
- Return type:
List[
GenericAnyModule]
- async reserve_modules(modules, force=True)[source]
Reserve modules regardless whether they are owned by others or not.
- Parameters:
modules (List[
GenericAnyModule]) – The modules to reserveforce (boolean) – Should force reserve the module, defaults to True
- Returns:
- Return type:
None
- async release_modules(modules, should_release_ports=False)[source]
Free modules. If a module is reserved by you, release the module. If a module is reserved by others, relinquish the module. The modules should have no owner afterwards. :param module: The module to free :type module:
GenericAnyModule:param should_release_ports: should ports also be freed, defaults to False :type should_release_ports: bool, optional :return: :rtype: None
- get_module_supported_configs(module)[source]
Get the module’s supported configurations in a list.
- Parameters:
module (Union[GenericL23Module, ModuleChimera]) – The module object
- Returns:
List of tuple(supported media, port count, port speed) (The port speed in Mbps, e.g. 40000 for 40G)
- Return type:
List[Tuple[MediaConfigurationType, int, int]]
- async set_module_configs(module_configs, force=True)[source]
Configure multiple modules with specified media, port count and port speed.
- Parameters:
module_configs – List of module configuration tuples.
Each tuple contains (module object, target media, target port count, target port speed in Mbps, should forcibly reserve the module)
- Parameters:
force (bool, optional) – should forcibly reserve the modules, defaults to True
- Raises:
NotSupportMediaPortSpeed – one of the provided media, port count and port speed configuration is not supported by the corresponding module.
- async set_module_config(module, media, port_count, port_speed, force=True)[source]
Change the module configuration to the target media, port count and port speed.
- Parameters:
module (Union[GenericL23Module, ModuleChimera]) – the module object
media (enums.MediaConfigurationType) – the target media for the module
port_count (int) – the target port count
port_speed (int) – the target port speed in Mbps, e.g. 40000 for 40G
force (bool, optional) – should forcibly reserve the module, defaults to True
- Raises:
NotSupportMediaPortSpeed – the provided media, port count and port speed configuration is not supported by the module
- async get_module_eol_date(module)[source]
Get module’s End-of-Life date
- Parameters:
module (GenericAnyModule) – The module object
- Returns:
Module’s EOL date
- Return type:
- async get_module_eol_days(module)[source]
Get days until module’s End-of-Life date
- Parameters:
module (GenericAnyModule) – The module object
- Returns:
days until module’s End-of-Life date
- Return type:
- async get_cage_insertions(module)[source]
Get module cage insertion count of each cage
- Parameters:
module (Union[Z800FreyaModule, Z1600EdunModule]) – The Z800 Freya/Z1600 Edun module object
- Returns:
Insertion count of each cage
- Return type:
Tuple[int, …]
- async get_cage_count(module)[source]
Get module cage count
- Parameters:
module (Union[Z800FreyaModule, Z1600EdunModule]) – The Z800 Freya/Z1600 Edun module object
- Returns:
The number of cages in the module
- Return type:
- obtain_ports_by_ids(tester, port_ids, separator='/')[source]
Get ports of the tester specified by port ids
- Parameters:
tester (
L23Tester) – The tester objectport_ids (List[str]) –
The port ids.
The port index with format
m/p, m is module index, p is port index, e.g. [“1/3”, “2/4”].Use
1/*to get all ports of module 1.Use
*/1to get port 1 of all modules.Use
*, or*/*to get all ports of all modules.Use an empty list to get all ports of all modules.
separator (str, optional) – The separator between module index and port index in port id, defaults to /
- Returns:
List of port objects
- Return type:
tuple[GenericAnyPort]
- obtain_port_by_id(tester, port_id, separator='/')[source]
Get a port of the module
- Parameters:
- Raises:
NoSuchPortError – No port found with the index
- Returns:
The port object
- Return type:
GenericAnyPort
- async reserve_ports(ports, force=True, reset=False)[source]
Reserve a port regardless whether it is owned by others or not.
- Parameters:
ports (list[GenericAnyPort]) – The ports to reserve
force (boolean, optional) – Should force reserve the ports, defaults to True
reset (boolean, optional) – Should reset the ports after reserving, defaults to False
- Returns:
- Return type:
None
- async release_ports(ports)[source]
Free a port. If the port is reserved by you, release the port. If the port is reserved by others, relinquish the port. The port should have no owner afterwards.
- Parameters:
port (GenericAnyPort) – The port to free
- Returns:
- Return type:
None