provider
¶
Backup provider classes
Classes:
-
BackupProviderBase
–Base BackupProvider class
-
MySQLBackupProvider
– -
MariaDbBackupProvider
– -
PostgresBackupProvider
–Postgres backup provider
-
RedisBackupProvider
–
Attributes¶
BACKUP_PROVIDERS
module-attribute
¶
BACKUP_PROVIDERS = [
MariaDbBackupProvider,
MySQLBackupProvider,
PostgresBackupProvider,
RedisBackupProvider,
]
Classes¶
BackupProviderBase
¶
BackupProviderBase(
container: Container,
compression: CompressionAlgorithm | None = None,
)
Base BackupProvider class
Backup provider constructor
Parameters:
-
container
¶Container
) –Container object
-
compression
¶CompressionAlgorithm | None
, default:None
) –Compression algorithm
Methods:
-
dump
–Dump database
-
restore
–Restore database
-
is_backup_provider
–Checks if container supports a backup provider
-
validate_file
–Validate the generated file
-
trigger_webhook
–Trigger webhook.
-
trigger_error_webhook
–Triggers an error on the webhook.
code
is appended to the address. -
trigger_success_webhook
–Triggers an success on the webhook.
-
get_dump_binary
–Get the binary used to dump the backup.
-
get_dump_args
–Arguments for the dump binary.
-
get_restore_binary
–Get the binary used to restore the backup.
-
get_restore_args
–Arguments for the restore binary.
-
get_container_env
–Get environment variables from container.
-
binary_exists_in_container
–Check if binary exists inside the container.
-
get_container_label
–Get labels for container.
-
get_service_name
–Get service name (only if started with docker compose).
Attributes:
-
name
(str
) –Backup provider name (e.g. postgres)
-
default_dump_binary
(str | None
) –Default dump binary
-
default_dump_args
(str | None
) –Default dump binary arguments
-
default_restore_binary
(str | None
) –Default restore binary
-
default_restore_args
(str | None
) –Default restore binary arguments
-
min_file_size
(int
) –Maximum file size, used to validate the generated file
-
pattern
(str | None
) –Pattern which is checked in the dumped file
-
plain_file_extension
(str
) –File extenstion used for the dumped file
-
compression
(CompressionAlgorithm | None
) –Compression algorithm
-
container
(Container
) –Container object
Attributes¶
default_dump_binary
class-attribute
instance-attribute
¶
Default dump binary
default_dump_args
class-attribute
instance-attribute
¶
Default dump binary arguments
default_restore_binary
class-attribute
instance-attribute
¶
Default restore binary
default_restore_args
class-attribute
instance-attribute
¶
Default restore binary arguments
min_file_size
class-attribute
instance-attribute
¶
Maximum file size, used to validate the generated file
pattern
class-attribute
instance-attribute
¶
Pattern which is checked in the dumped file
plain_file_extension
class-attribute
instance-attribute
¶
File extenstion used for the dumped file
compression
instance-attribute
¶
compression: CompressionAlgorithm | None = compression
Compression algorithm
Functions¶
trigger_webhook
¶
trigger_error_webhook
¶
Triggers an error on the webhook. code
is appended to the address.
trigger_success_webhook
¶
Triggers an success on the webhook.
get_container_env
¶
Get environment variables from container.
binary_exists_in_container
¶
Check if binary exists inside the container.
get_container_label
¶
Get labels for container.
get_service_name
¶
Get service name (only if started with docker compose).
MySQLBackupProvider
¶
MySQLBackupProvider(
container: Container,
compression: CompressionAlgorithm | None = None,
)
Backup provider constructor
Parameters:
-
container
¶Container
) –Container object
-
compression
¶CompressionAlgorithm | None
, default:None
) –Compression algorithm
Methods:
-
dump
– -
restore
– -
is_backup_provider
–Checks if container supports a backup provider
-
validate_file
–Validate the generated file
-
trigger_webhook
–Trigger webhook.
-
trigger_error_webhook
–Triggers an error on the webhook.
code
is appended to the address. -
trigger_success_webhook
–Triggers an success on the webhook.
-
get_dump_binary
–Get the binary used to dump the backup.
-
get_dump_args
–Arguments for the dump binary.
-
get_restore_binary
–Get the binary used to restore the backup.
-
get_restore_args
–Arguments for the restore binary.
-
get_container_env
–Get environment variables from container.
-
binary_exists_in_container
–Check if binary exists inside the container.
-
get_container_label
–Get labels for container.
-
get_service_name
–Get service name (only if started with docker compose).
Attributes:
-
default_dump_args
– -
default_restore_binary
(str | None
) –Default restore binary
-
default_restore_args
(str | None
) –Default restore binary arguments
-
min_file_size
(int
) –Maximum file size, used to validate the generated file
-
pattern
(str | None
) –Pattern which is checked in the dumped file
-
plain_file_extension
(str
) –File extenstion used for the dumped file
-
compression
(CompressionAlgorithm | None
) –Compression algorithm
-
container
(Container
) –Container object
-
name
– -
default_dump_binary
–
Attributes¶
default_restore_binary
class-attribute
instance-attribute
¶
Default restore binary
default_restore_args
class-attribute
instance-attribute
¶
Default restore binary arguments
min_file_size
class-attribute
instance-attribute
¶
Maximum file size, used to validate the generated file
pattern
class-attribute
instance-attribute
¶
Pattern which is checked in the dumped file
plain_file_extension
class-attribute
instance-attribute
¶
File extenstion used for the dumped file
compression
instance-attribute
¶
compression: CompressionAlgorithm | None = compression
Compression algorithm
Functions¶
trigger_webhook
¶
trigger_error_webhook
¶
Triggers an error on the webhook. code
is appended to the address.
trigger_success_webhook
¶
Triggers an success on the webhook.
get_container_env
¶
Get environment variables from container.
binary_exists_in_container
¶
Check if binary exists inside the container.
get_container_label
¶
Get labels for container.
get_service_name
¶
Get service name (only if started with docker compose).
MariaDbBackupProvider
¶
MariaDbBackupProvider(
container: Container,
compression: CompressionAlgorithm | None = None,
)
Backup provider constructor
Parameters:
-
container
¶Container
) –Container object
-
compression
¶CompressionAlgorithm | None
, default:None
) –Compression algorithm
Methods:
-
is_backup_provider
–Checks if container supports a backup provider
-
validate_file
–Validate the generated file
-
trigger_webhook
–Trigger webhook.
-
trigger_error_webhook
–Triggers an error on the webhook.
code
is appended to the address. -
trigger_success_webhook
–Triggers an success on the webhook.
-
get_dump_binary
–Get the binary used to dump the backup.
-
get_dump_args
–Arguments for the dump binary.
-
get_restore_binary
–Get the binary used to restore the backup.
-
get_restore_args
–Arguments for the restore binary.
-
get_container_env
–Get environment variables from container.
-
binary_exists_in_container
–Check if binary exists inside the container.
-
get_container_label
–Get labels for container.
-
get_service_name
–Get service name (only if started with docker compose).
-
dump
– -
restore
–
Attributes:
-
default_restore_binary
(str | None
) –Default restore binary
-
default_restore_args
(str | None
) –Default restore binary arguments
-
min_file_size
(int
) –Maximum file size, used to validate the generated file
-
pattern
(str | None
) –Pattern which is checked in the dumped file
-
plain_file_extension
(str
) –File extenstion used for the dumped file
-
compression
(CompressionAlgorithm | None
) –Compression algorithm
-
container
(Container
) –Container object
-
name
– -
default_dump_args
– -
default_dump_binary
–
Attributes¶
default_restore_binary
class-attribute
instance-attribute
¶
Default restore binary
default_restore_args
class-attribute
instance-attribute
¶
Default restore binary arguments
min_file_size
class-attribute
instance-attribute
¶
Maximum file size, used to validate the generated file
pattern
class-attribute
instance-attribute
¶
Pattern which is checked in the dumped file
plain_file_extension
class-attribute
instance-attribute
¶
File extenstion used for the dumped file
compression
instance-attribute
¶
compression: CompressionAlgorithm | None = compression
Compression algorithm
Functions¶
trigger_webhook
¶
trigger_error_webhook
¶
Triggers an error on the webhook. code
is appended to the address.
trigger_success_webhook
¶
Triggers an success on the webhook.
get_container_env
¶
Get environment variables from container.
binary_exists_in_container
¶
Check if binary exists inside the container.
get_container_label
¶
Get labels for container.
get_service_name
¶
Get service name (only if started with docker compose).
PostgresBackupProvider
¶
PostgresBackupProvider(
container: Container,
compression: CompressionAlgorithm | None = None,
)
Postgres backup provider
Backup provider constructor
Parameters:
-
container
¶Container
) –Container object
-
compression
¶CompressionAlgorithm | None
, default:None
) –Compression algorithm
Methods:
-
restore
–Restore database
-
is_backup_provider
–Checks if container supports a backup provider
-
validate_file
–Validate the generated file
-
trigger_webhook
–Trigger webhook.
-
trigger_error_webhook
–Triggers an error on the webhook.
code
is appended to the address. -
trigger_success_webhook
–Triggers an success on the webhook.
-
get_dump_binary
–Get the binary used to dump the backup.
-
get_dump_args
–Arguments for the dump binary.
-
get_restore_binary
–Get the binary used to restore the backup.
-
get_container_env
–Get environment variables from container.
-
binary_exists_in_container
–Check if binary exists inside the container.
-
get_container_label
–Get labels for container.
-
get_service_name
–Get service name (only if started with docker compose).
-
dump
–Overwrite dump method with custom postgres dump
-
get_restore_args
–Overwrite restore args with custom postgres arguments
Attributes:
-
min_file_size
(int
) –Maximum file size, used to validate the generated file
-
pattern
(str | None
) –Pattern which is checked in the dumped file
-
compression
(CompressionAlgorithm | None
) –Compression algorithm
-
container
(Container
) –Container object
-
name
– -
default_dump_binary
– -
default_dump_args
– -
default_restore_binary
– -
default_restore_args
– -
plain_file_extension
–
Attributes¶
min_file_size
class-attribute
instance-attribute
¶
Maximum file size, used to validate the generated file
pattern
class-attribute
instance-attribute
¶
Pattern which is checked in the dumped file
compression
instance-attribute
¶
compression: CompressionAlgorithm | None = compression
Compression algorithm
default_restore_args
class-attribute
instance-attribute
¶
Functions¶
trigger_webhook
¶
trigger_error_webhook
¶
Triggers an error on the webhook. code
is appended to the address.
trigger_success_webhook
¶
Triggers an success on the webhook.
get_container_env
¶
Get environment variables from container.
binary_exists_in_container
¶
Check if binary exists inside the container.
get_container_label
¶
Get labels for container.
get_service_name
¶
Get service name (only if started with docker compose).
RedisBackupProvider
¶
RedisBackupProvider(
container: Container,
compression: CompressionAlgorithm | None = None,
)
Backup provider constructor
Parameters:
-
container
¶Container
) –Container object
-
compression
¶CompressionAlgorithm | None
, default:None
) –Compression algorithm
Methods:
-
is_backup_provider
–Checks if container supports a backup provider
-
validate_file
–Validate the generated file
-
trigger_webhook
–Trigger webhook.
-
trigger_error_webhook
–Triggers an error on the webhook.
code
is appended to the address. -
trigger_success_webhook
–Triggers an success on the webhook.
-
get_dump_binary
–Get the binary used to dump the backup.
-
get_dump_args
–Arguments for the dump binary.
-
get_restore_binary
–Get the binary used to restore the backup.
-
get_restore_args
–Arguments for the restore binary.
-
get_container_env
–Get environment variables from container.
-
binary_exists_in_container
–Check if binary exists inside the container.
-
get_container_label
–Get labels for container.
-
get_service_name
–Get service name (only if started with docker compose).
-
dump
– -
restore
–
Attributes:
-
default_dump_args
(str | None
) –Default dump binary arguments
-
default_restore_binary
(str | None
) –Default restore binary
-
default_restore_args
(str | None
) –Default restore binary arguments
-
pattern
(str | None
) –Pattern which is checked in the dumped file
-
compression
(CompressionAlgorithm | None
) –Compression algorithm
-
container
(Container
) –Container object
-
name
– -
min_file_size
(int
) – -
default_dump_binary
– -
plain_file_extension
–
Attributes¶
default_dump_args
class-attribute
instance-attribute
¶
Default dump binary arguments
default_restore_binary
class-attribute
instance-attribute
¶
Default restore binary
default_restore_args
class-attribute
instance-attribute
¶
Default restore binary arguments
pattern
class-attribute
instance-attribute
¶
Pattern which is checked in the dumped file
compression
instance-attribute
¶
compression: CompressionAlgorithm | None = compression
Compression algorithm
Functions¶
trigger_webhook
¶
trigger_error_webhook
¶
Triggers an error on the webhook. code
is appended to the address.
trigger_success_webhook
¶
Triggers an success on the webhook.
get_container_env
¶
Get environment variables from container.
binary_exists_in_container
¶
Check if binary exists inside the container.
get_container_label
¶
Get labels for container.
get_service_name
¶
Get service name (only if started with docker compose).