bartender.filesystems.sftp#
Classes#
Configuration for SFTP file system. |
|
Remote filesystem using SFTP protocol. |
Module Contents#
- class bartender.filesystems.sftp.SftpFileSystemConfig#
Bases:
pydantic.BaseModelConfiguration for SFTP file system.
- Parameters:
ssh_config – SSH connection configuration.
entry – The entry directory. Used to localize description.
- ssh_config: bartender.shared.ssh.SshConnectConfig#
- entry: pathlib.Path#
- type: Literal['sftp'] = 'sftp'#
- class bartender.filesystems.sftp.SftpFileSystem(config: SftpFileSystemConfig)#
Bases:
bartender.filesystems.abstract.AbstractFileSystemRemote filesystem using SFTP protocol.
- Parameters:
config (SftpFileSystemConfig) –
- entry#
- ssh_config#
- conn: asyncssh.SSHClientConnection | None = None#
- localize_description(description: bartender.schedulers.abstract.JobDescription, entry: pathlib.Path) bartender.schedulers.abstract.JobDescription#
Make given job description local to this file system.
- Parameters:
description (bartender.schedulers.abstract.JobDescription) – A job description.
entry (pathlib.Path) – The path to replace with the entry path of this file system. For example given a file system with entry path of /remote/jobs and given job_dir in job description of /local/jobs/myjobid and given entry of /local/jobs will return description with job dir /remote/jobs/myjobid .
- Returns:
A job description local to this file system.
- Return type:
- async upload(src: bartender.schedulers.abstract.JobDescription, target: bartender.schedulers.abstract.JobDescription) None#
Uploads job directory of source description to job directory of target.
- Parameters:
src (bartender.schedulers.abstract.JobDescription) – Local directory to copy from.
target (bartender.schedulers.abstract.JobDescription) – Remote directory to copy to.
- Return type:
None
- async download(src: bartender.schedulers.abstract.JobDescription, target: bartender.schedulers.abstract.JobDescription) None#
Download job directory of source description to job directory of target.
- Parameters:
src (bartender.schedulers.abstract.JobDescription) – Remote directory to copy from.
target (bartender.schedulers.abstract.JobDescription) – Local directory to copy to.
- Return type:
None
- async delete(description: bartender.schedulers.abstract.JobDescription) None#
Delete job directory of description.
- Parameters:
description (bartender.schedulers.abstract.JobDescription) – Remote directory to delete.
- Return type:
None