Skeleton for backends

This commit is contained in:
einarf 2023-03-08 23:28:02 +01:00
parent 11fdffb719
commit 47d74a2ef7
5 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,37 @@
class BackupBase:
"""
Base class for specific backup types such as various databases.
A backup type is responsible for processing all actions defined
on a service. This includes pre-run and post-run actions.
All backup objects are instantiated before all the backup
execution begins to sanity check the configuration and
report the current parsed configuration to the user.
"""
def __init__(self, *args, **kwargs):
# Possibly pass in the service object here?
# Grab labels from service.
pass
def pre_run(self):
"""
Pre-run raw command.
Pre-run execution in a container.
"""
pass
def run(self):
"""
Run the backup
"""
raise NotImplementedError
def post_run(self):
"""
Post-run raw command.
Post-run execution in a container.
"""
pass

View File

@ -0,0 +1,9 @@
# Zepla
# listens
# to
# Asmongolds
# advice
# on
# Online
# Harassment