Module sysbot.utils.engine

MIT License

Copyright (c) 2024 Thibault SCIRE

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Classes

class Cache (no_current_error: str = 'No current connection.')

Methods

def empty_cache(self) ‑> None
def get_cache_stats(self) ‑> Dict[str, Any]
class ComponentBase

Subclasses

Methods

def execute_command(self, alias, command, **kwargs)
def set_sysbot_instance(self, sysbot_instance)
class ComponentGroup (name)
class ComponentLoader

Static methods

def create_hierarchy(sysbot_instance, component_full_path, component_instance)
def discover_all_components(sysbot_file_path, component_type)
def load_components(sysbot_instance, component_list)
class ComponentMeta (*args, **kwargs)

type(object) -> the object's type type(name, bases, dict, **kwds) -> a new type

Ancestors

  • builtins.type
class ConnectionsManager (no_current_error: str = 'No current connection.')

Methods

def clear(self, index_or_alias: int | str) ‑> None
def clear_all(self) ‑> None
def get(self, index_or_alias: int | str | None = None) ‑> Any
def get_all(self) ‑> Dict[int, Any]
def register(self, connection: Any, alias: str | None = None) ‑> int
def switch(self, index_or_alias: int | str) ‑> Any
class ConnectorInterface

Helper class that provides a standard way to create an ABC using inheritance.

Ancestors

  • abc.ABC

Subclasses

Methods

def close_session(self, session)
def execute_command(self, session, command, **kwargs)
def open_session(self, host, port, login, password)
def set_cache(self, cache)
class SSHTunnel (ssh_address_or_host, remote_bind_address, ssh_username=None, ssh_password=None)

A lightweight SSH tunnel implementation using paramiko, replacing the unmaintained sshtunnel library which is incompatible with paramiko >= 3.x (paramiko removed DSSKey in version 3.0).

Instance variables

prop local_bind_port

Methods

def start(self)
def stop(self)
class SecretsManager

Methods

def clear(self, secret_name: str) ‑> None
def clear_all(self) ‑> None
def get(self, secret_reference: str) ‑> str | Dict[str, Any] | List[Any]
def get_all(self) ‑> Dict[str, str | Dict[str, Any] | List[Any]]
def get_stats(self) ‑> Dict[str, int]
def register(self, secret_name: str, secret_value: str | Dict[str, Any] | List[Any]) ‑> None
def switch(self, secret_name: str) ‑> str | Dict[str, Any] | List[Any]
class TunnelingManager

Static methods

def get_protocol(protocol_name, product_name, cache=None)
def nested_tunnel(protocol, tunnel_config, target_config, index=0, previous_tunnels=None)