mlos_bench.services.remote.ssh.ssh_fileshare module

A collection functions for interacting with SSH servers as file shares.

class mlos_bench.services.remote.ssh.ssh_fileshare.CopyMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

Copy mode enum.

DOWNLOAD = 1
UPLOAD = 2
class mlos_bench.services.remote.ssh.ssh_fileshare.SshFileShareService(config: Dict[str, Any] | None = None, global_config: Dict[str, Any] | None = None, parent: Service | None = None, methods: Dict[str, Callable] | List[Callable] | None = None)

Bases: FileShareService, SshService

A collection of functions for interacting with SSH servers as file shares.

Attributes:
config_loader_service

Return a config loader service.

Methods

clear_client_cache()

Clears the cache of client connections.

download(params, remote_path, local_path[, ...])

Downloads contents from a remote share path to a local path.

export()

Return a dictionary of functions available in this service.

merge_methods(ext_methods, local_methods)

Merge methods from the external caller with the local ones.

new(class_name[, config, global_config, parent])

Factory method for a new service with a given config.

pprint()

Produce a human-readable string listing all public methods of the service.

register(services)

Register new mix-in services.

upload(params, local_path, remote_path[, ...])

Uploads contents from a local path to remote share path.

download(params: dict, remote_path: str, local_path: str, recursive: bool = True) None

Downloads contents from a remote share path to a local path.

Parameters:
paramsdict

Flat dictionary of (key, value) pairs of (optional) connection details.

remote_pathstr

Path to download from the remote file share, a file if recursive=False or a directory if recursive=True.

local_pathstr

Path to store the downloaded content to.

recursivebool

If False, ignore the subdirectories; if True (the default), download the entire directory tree.

upload(params: dict, local_path: str, remote_path: str, recursive: bool = True) None

Uploads contents from a local path to remote share path.

Parameters:
paramsdict

Flat dictionary of (key, value) pairs of (optional) connection details.

local_pathstr

Path to the local directory to upload contents from.

remote_pathstr

Path in the remote file share to store the uploaded content to.

recursivebool

If False, ignore the subdirectories; if True (the default), upload the entire directory tree.