selfprivacy-rest-api/selfprivacy_api/backup/providers/provider.py

23 lines
705 B
Python
Raw Normal View History

"""
An abstract class for BackBlaze, S3 etc.
It assumes that while some providers are supported via restic/rclone, others may
require different backends
"""
from abc import ABC
from selfprivacy_api.backup.backuper import AbstractBackuper
class AbstractBackupProvider(ABC):
@property
def backuper(self) -> AbstractBackuper:
raise NotImplementedError
2023-02-01 11:58:55 +00:00
2023-05-29 15:34:26 +00:00
def __init__(self, login="", key="", location="", repo_id=""):
self.backuper.set_creds(login, key, location)
2023-02-01 11:58:55 +00:00
self.login = login
self.key = key
2023-05-29 15:34:26 +00:00
self.location = location
# We do not need to do anything with this one
# Just remember in case the app forgets
self.repo_id = repo_id