mlos_bench.services.remote.ssh.ssh_fileshare
============================================

.. py:module:: mlos_bench.services.remote.ssh.ssh_fileshare

.. autoapi-nested-parse::

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



Classes
-------

.. autoapisummary::

   mlos_bench.services.remote.ssh.ssh_fileshare.CopyMode
   mlos_bench.services.remote.ssh.ssh_fileshare.SshFileShareService


Module Contents
---------------

.. py:class:: CopyMode(*args, **kwds)

   Bases: :py:obj:`enum.Enum`


   Copy mode enum.


   .. py:attribute:: DOWNLOAD
      :value: 1



   .. py:attribute:: UPLOAD
      :value: 2



.. py:class:: SshFileShareService(config: dict[str, Any] | None = None, global_config: dict[str, Any] | None = None, parent: mlos_bench.services.base_service.Service | None = None, methods: dict[str, collections.abc.Callable] | list[collections.abc.Callable] | None = None)

   Bases: :py:obj:`mlos_bench.services.base_fileshare.FileShareService`, :py:obj:`mlos_bench.services.remote.ssh.ssh_service.SshService`


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

   Create a new file share with a given config.

   :param config: Free-format dictionary that contains the file share configuration.
                  It will be passed as a constructor parameter of the class
                  specified by `class_name`.
   :type config: dict
   :param global_config: Free-format dictionary of global parameters.
   :type global_config: dict
   :param parent: Parent service that can provide mixin functions.
   :type parent: Service
   :param methods: New methods to register with the service.
   :type methods: Union[dict[str, Callable], list[Callable], None]


   .. py:method:: download(params: dict, remote_path: str, local_path: str, recursive: bool = True) -> None

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

      :param params: Flat dictionary of (key, value) pairs of (optional) connection details.
      :type params: dict
      :param remote_path: Path to download from the remote file share, a file if recursive=False
                          or a directory if recursive=True.
      :type remote_path: str
      :param local_path: Path to store the downloaded content to.
      :type local_path: str
      :param recursive: If False, ignore the subdirectories;
                        if True (the default), download the entire directory tree.
      :type recursive: bool



   .. py:method:: upload(params: dict, local_path: str, remote_path: str, recursive: bool = True) -> None

      Uploads contents from a local path to remote share path.

      :param params: Flat dictionary of (key, value) pairs of (optional) connection details.
      :type params: dict
      :param local_path: Path to the local directory to upload contents from.
      :type local_path: str
      :param remote_path: Path in the remote file share to store the uploaded content to.
      :type remote_path: str
      :param recursive: If False, ignore the subdirectories;
                        if True (the default), upload the entire directory tree.
      :type recursive: bool