mantik.remote_file_service.unicore_file_service¶
Attributes¶
Classes¶
Client that allows transferring files between unicore and |
Functions¶
|
Module Contents¶
- class mantik.remote_file_service.unicore_file_service.UnicoreFileService(username: str, password: str, auth_url: str, remote_base_path: str = '/', local_base_path: str = '.')[source]¶
Bases:
mantik.remote_file_service.abstract_file_service.AbstractFileService
Client that allows transferring files between unicore and the local machine.
To specify that a path is remote, start the path with remote: E.g. client.copy_file(“/path/local.file”, “remote:/path/local.file”) This would upload the file from local to unicore.
Permission handling is not supported here, as it’s not implemented by pyunicore. This includes viewing the file mode, and file owner.
- abstract change_permissions(target: FilePath, new_permissions: mantik.remote_file_service.abstract_file_service.FileMeta) None [source]¶
Change metadata (permissions) of a file.
Note: bash chmod
- copy_directory(source: FilePath, target: FilePath) mantik.remote_file_service.abstract_file_service.Directory [source]¶
Copy directory.
Note: bash cp
- copy_file(source: FilePath, target: FilePath) mantik.remote_file_service.abstract_file_service.File [source]¶
Copy file.
Note: bash cp
- create_directory(target: FilePath) mantik.remote_file_service.abstract_file_service.Directory [source]¶
Make a new directory.
Note: bash mkdir
- create_file_if_not_exists(target=FilePath) mantik.remote_file_service.abstract_file_service.File [source]¶
Create (empty) file if not exists.
Note: bash touch
- classmethod from_env(connection_id: uuid.UUID | None = None) UnicoreFileService [source]¶
Instantiate with environment variables.
Credentials are either fetched from mantik api or passed in through end vars.
- list_directory(target: FilePath) List[mantik.remote_file_service.abstract_file_service.Directory | mantik.remote_file_service.abstract_file_service.File] [source]¶
List content of directory.
Note: bash ls