2023-01-23 13:43:18 +00:00
|
|
|
"""
|
|
|
|
An abstract class for BackBlaze, S3 etc.
|
2023-06-23 09:40:10 +00:00
|
|
|
It assumes that while some providers are supported via restic/rclone, others
|
|
|
|
may require different backends
|
2023-01-23 13:43:18 +00:00
|
|
|
"""
|
2024-07-26 19:59:44 +00:00
|
|
|
|
|
|
|
from abc import ABC
|
2023-06-23 12:04:33 +00:00
|
|
|
from selfprivacy_api.backup.backuppers import AbstractBackupper
|
2023-06-23 09:40:10 +00:00
|
|
|
from selfprivacy_api.graphql.queries.providers import (
|
|
|
|
BackupProvider as BackupProviderEnum,
|
|
|
|
)
|
2023-01-23 13:43:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
class AbstractBackupProvider(ABC):
|
2023-06-23 12:04:33 +00:00
|
|
|
backupper: AbstractBackupper
|
2023-02-01 11:58:55 +00:00
|
|
|
|
2023-06-23 09:40:10 +00:00
|
|
|
name: BackupProviderEnum
|
2023-06-13 22:40:53 +00:00
|
|
|
|
2023-05-29 15:34:26 +00:00
|
|
|
def __init__(self, login="", key="", location="", repo_id=""):
|
2023-06-23 12:04:33 +00:00
|
|
|
self.backupper.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
|