Source code for pyenbc.remote.cloud_transfer

"""
Common API for many remote drives

.. versionadded:: 1.3


:githublink:`%|py|7`
"""
from pyquickhelper.loghelper import noLOG


[docs]class CloudTransfer: """ defines a common API for a remote storage :githublink:`%|py|13` """
[docs] def __init__(self, user, pwd, fLOG=None): """ constructor :param user: user name :param pwd: password :param fLOG: logging function :githublink:`%|py|22` """ self._user = user self._pwd = pwd self.fLOG = noLOG if fLOG is None else fLOG
[docs] def connect(self): """ connect :githublink:`%|py|30` """ raise NotImplementedError()
[docs] def close(self): """ close the connection :githublink:`%|py|36` """ raise NotImplementedError()
[docs] def upload_data(self, remote_path, data): """ upload binary data :param remote_path: path on the remote drive :param data: bytes :return: boolean :githublink:`%|py|46` """ raise NotImplementedError()
[docs] def download_data(self, remote_path): """ download binary data :param remote_path: path on the remote drive :return: data (bytes) :githublink:`%|py|55` """ raise NotImplementedError()