barman.clients.cloud_restore module#

class barman.clients.cloud_restore.CloudBackupDownloader(cloud_interface, catalog)View on GitHub#

Bases: object

Restore a backup from cloud storage.

__init__(cloud_interface, catalog)View on GitHub#

Object responsible for handling interactions with cloud storage

Parameters:
  • cloud_interface (CloudInterface) – The interface to use to upload the backup

  • server_name (str) – The name of the server as configured in Barman

  • catalog (CloudBackupCatalog) – The cloud backup catalog

_abc_impl = <_abc._abc_data object>#
abstract download_backup(backup_id, destination_dir)View on GitHub#

Download a backup from cloud storage

Parameters:
  • backup_id (str) – The backup id to restore

  • destination_dir (str) – Path to the destination directory

class barman.clients.cloud_restore.CloudBackupDownloaderObjectStore(cloud_interface, catalog)View on GitHub#

Bases: CloudBackupDownloader

Cloud storage download client for an object store backup

_abc_impl = <_abc._abc_data object>#
download_backup(backup_info, destination_dir, tablespaces)View on GitHub#

Download a backup from cloud storage

Parameters:
  • backup_info (BackupInfo) – The backup info for the backup to restore

  • destination_dir (str) – Path to the destination directory

class barman.clients.cloud_restore.CloudBackupDownloaderSnapshot(cloud_interface, catalog, snapshot_interface)View on GitHub#

Bases: CloudBackupDownloader

A minimal downloader for cloud backups which just retrieves the backup label.

__init__(cloud_interface, catalog, snapshot_interface)View on GitHub#

Object responsible for handling interactions with cloud storage

Parameters:
  • cloud_interface (CloudInterface) – The interface to use to upload the backup

  • server_name (str) – The name of the server as configured in Barman

  • catalog (CloudBackupCatalog) – The cloud backup catalog

  • snapshot_interface (CloudSnapshotInterface) – Interface for managing snapshots via a cloud provider API.

_abc_impl = <_abc._abc_data object>#
download_backup(backup_info, destination_dir, recovery_instance)View on GitHub#

Download a backup from cloud storage

Parameters:
  • backup_info (BackupInfo) – The backup info for the backup to restore

  • destination_dir (str) – Path to the destination directory

  • recovery_instance (str) – The name of the VM instance to which the disks cloned from the backup snapshots are attached.

barman.clients.cloud_restore._validate_config(config, backup_info)View on GitHub#

Additional validation for config such as mutually inclusive options.

Raises a ConfigurationException if any options are missing or incompatible.

Parameters:
  • config (argparse.Namespace) – The backup options provided at the command line.

  • backup_info (BackupInfo) – The backup info for the backup to restore

barman.clients.cloud_restore.main(args=None)View on GitHub#

The main script entry point

Parameters:

args (list[str]) – the raw arguments list. When not provided it defaults to sys.args[1:]

barman.clients.cloud_restore.parse_arguments(args=None)View on GitHub#

Parse command line arguments

Returns:

The options parsed

barman.clients.cloud_restore.tablespace_map(rules)View on GitHub#

Return a mapping from tablespace names to locations built from any –tablespace name:/loc/ation rules specified.