Documentation ¶
Overview ¶
Package barman contains the utilities to interact with barman-cloud.
This package is able to download the backup catalog, given an object store, and to find the required backup to recreate a cluster, given a certain point in time. It can also delete backups according to barman object store configuration and retention policies, and find the latest successful backup. This is useful to recovery from the last consistent state. We detect the possible commands to be executed, fulfilling the barman capabilities, and define an interface for building commands.
A backup catalog is represented by the Catalog structure, and can be created using the NewCatalog function or by downloading it from an object store via GetBackupList. A backup catalog is just a sorted list of BackupInfo objects.
We also have features to gather all the environment variables required for the barman-cloud utilities to work correctly.
The functions which call the barman-cloud utilities (such as GetBackupList) require the environment variables to be passed, and the calling code is supposed gather them (i.e. via the EnvSetCloudCredentials) before calling them. A Kubernetes client is required to get the environment variables, as we need to download the content from the required secrets, but is not required to call barman-cloud.
Index ¶
- func AppendCloudProviderOptionsFromBackup(options []string, backup *v1.Backup) ([]string, error)
- func AppendCloudProviderOptionsFromConfiguration(options []string, barmanConfiguration *v1.BarmanObjectStoreConfiguration) ([]string, error)
- func DeleteBackupsByPolicy(ctx context.Context, backupConfig *v1.BackupConfiguration, serverName string, ...) error
- func DeleteBackupsNotInCatalog(ctx context.Context, cli client.Client, cluster *v1.Cluster, ...) error
- func GetBackupByName(ctx context.Context, backupName string, serverName string, ...) (*catalog.BarmanBackup, error)
- func GetBackupList(ctx context.Context, barmanConfiguration *v1.BarmanObjectStoreConfiguration, ...) (*catalog.Catalog, error)
- func GetLatestBackup(ctx context.Context, serverName string, ...) (*catalog.BarmanBackup, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendCloudProviderOptionsFromBackup ¶
AppendCloudProviderOptionsFromBackup takes an options array and adds the cloud provider specified in the Backup object
func AppendCloudProviderOptionsFromConfiguration ¶
func AppendCloudProviderOptionsFromConfiguration( options []string, barmanConfiguration *v1.BarmanObjectStoreConfiguration, ) ([]string, error)
AppendCloudProviderOptionsFromConfiguration takes an options array and adds the cloud provider specified in the Barman configuration object
func DeleteBackupsByPolicy ¶
func DeleteBackupsByPolicy( ctx context.Context, backupConfig *v1.BackupConfiguration, serverName string, env []string, ) error
DeleteBackupsByPolicy executes a command that deletes backups, given the Barman object store configuration, the retention policies, the server name and the environment variables
func DeleteBackupsNotInCatalog ¶
func DeleteBackupsNotInCatalog( ctx context.Context, cli client.Client, cluster *v1.Cluster, catalog *catalog.Catalog, ) error
DeleteBackupsNotInCatalog deletes all Backup objects pointing to the given cluster that are not present in the backup anymore
func GetBackupByName ¶ added in v1.18.3
func GetBackupByName( ctx context.Context, backupName string, serverName string, barmanConfiguration *v1.BarmanObjectStoreConfiguration, env []string, ) (*catalog.BarmanBackup, error)
GetBackupByName returns the backup data found for a given backup
func GetBackupList ¶
func GetBackupList( ctx context.Context, barmanConfiguration *v1.BarmanObjectStoreConfiguration, serverName string, env []string, ) (*catalog.Catalog, error)
GetBackupList returns the catalog reading it from the object store
func GetLatestBackup ¶ added in v1.18.3
func GetLatestBackup( ctx context.Context, serverName string, barmanConfiguration *v1.BarmanObjectStoreConfiguration, env []string, ) (*catalog.BarmanBackup, error)
GetLatestBackup returns the latest executed backup
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package archiver manages the WAL archiving process
|
Package archiver manages the WAL archiving process |
Package capabilities stores the definition of the type for Barman capabilities
|
Package capabilities stores the definition of the type for Barman capabilities |
Package credentials is used to build environment for barman cloud commands
|
Package credentials is used to build environment for barman cloud commands |
Package restorer manages the WAL restore process
|
Package restorer manages the WAL restore process |
Package spool implements a WAL pooler keeping track of which WALs we have archived
|
Package spool implements a WAL pooler keeping track of which WALs we have archived |