twindb_backup.copy package¶
Submodules¶
twindb_backup.copy.base_copy module¶
Base class for a backup copy
-
class
twindb_backup.copy.base_copy.
BaseCopy
(host, name)[source]¶ Bases:
object
Base class for a backup copy in status
Parameters: - host (str) – Hostname where the backup was taken from.
- name (str) – Base name of the backup copy file as it’s stored on the destination.
-
key
¶ It’s a relative path backup copy. It’s relative to the remote path as from the twindb config. It’s also a key in status, hence the name.
Returns: Path to file Return type: str Raises: UnknownSourceType – If source type is not defined
twindb_backup.copy.binlog_copy module¶
Class to describe Binlog backup copy
-
class
twindb_backup.copy.binlog_copy.
BinlogCopy
(host, name, created_at)[source]¶ Bases:
twindb_backup.copy.base_copy.BaseCopy
Instantiate a Binlog copy in status
Parameters: - host (str) – Hostname where the backup was taken from.
- name (str) – Base name of the backup copy file as it’s stored on the destination.
- created_at (int) – Time when copy created
-
created_at
¶ Time of created copy
-
name
¶ Binlog copy name as in SHOW BINARY LOGS.
twindb_backup.copy.exceptions module¶
Module for Backup copy exception classes.
-
exception
twindb_backup.copy.exceptions.
BackupCopyError
[source]¶ Bases:
twindb_backup.exceptions.TwinDBBackupError
General backup copy error
-
exception
twindb_backup.copy.exceptions.
UnknownSourceType
[source]¶ Bases:
twindb_backup.copy.exceptions.BackupCopyError
Raises when source type is not set
-
exception
twindb_backup.copy.exceptions.
WrongInputData
[source]¶ Bases:
twindb_backup.copy.exceptions.BackupCopyError
Raises when incorrent inputs are used
twindb_backup.copy.mysql_copy module¶
Class to describe MySQL backup copy
-
class
twindb_backup.copy.mysql_copy.
MySQLCopy
(*args, **kwargs)[source]¶ Bases:
twindb_backup.copy.periodic_copy.PeriodicCopy
Instantiate a MySQL copy.
Parameters: - host (str) – Hostname where the backup was taken from.
- run_type (str) – Run type when the backup was taken: daily, weekly, etc.
- name (str) – Base name of the backup copy file as it’s stored on the destination.
Raises: WrongInputData – if type is neither full or incremental, if name is not a basename.
-
backup_finished
¶ Timestamp when the backup job finished.
-
backup_started
¶ Timestamp when the backup job started.
-
binlog
¶ File name of the binlog.
-
config
¶ Dictionary of configs and their content.
-
created_at
¶ Timestamp when the backup job started.
-
duration
¶ Time in seconds it took to take the backup.
-
galera
¶ True if the backup was taken from Galera.
-
lsn
¶ LSN of the backup.
-
parent
¶ For incremental backup it is a base full copy name.
-
position
¶ Binlog position of the backup copy.
-
sort_key
¶
-
type
¶ Full or incremental.
-
wsrep_provider_version
¶ If it was Galera, value of wsrep_provider_version
twindb_backup.copy.periodic_copy module¶
Interval class for a backup copy
-
class
twindb_backup.copy.periodic_copy.
PeriodicCopy
(*args, **kwargs)[source]¶ Bases:
twindb_backup.copy.base_copy.BaseCopy
Interval class for a periodic backup copy in status
Parameters: - host (str) – Hostname where the backup was taken from.
- run_type (str) – Run type when the backup was taken: daily, weekly, etc.
- name (str) – Base name of the backup copy file as it’s stored on the destination.
-
host
¶ Host where the backup was taken
-
name
¶ Name of the backup. It’s basename w/o directory part.
-
run_type
¶ What run type was when the backup copy was taken.