Backup Base API¶
- class libcloud.backup.base.BackupDriver(key, secret=None, secure=True, host=None, port=None, **kwargs)[source]¶
A base BackupDriver class to derive from
This class is always subclassed by a specific driver.
- Parameters:
key (
str
) – API key or username to used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.
- Returns:
None
- cancel_target_job(job)[source]¶
Cancel a backup job on a target
- Parameters:
target (Instance of
BackupTarget
) – Backup target with the backup datajob (Instance of
BackupTargetJob
) – Backup target job to cancel
- Return type:
bool
- connectionCls¶
alias of
ConnectionUserAndKey
- create_target(name, address, type='Virtual', extra=None)[source]¶
Creates a new backup target
- Parameters:
name (
str
) – Name of the targetaddress (
str
) – Hostname, FQDN, IP, file path etc.type (
BackupTargetType
) – Backup target type (Physical, Virtual, …).extra (
dict
) – (optional) Extra attributes (driver specific).
- Return type:
Instance of
BackupTarget
- create_target_from_node(node, type='Virtual', extra=None)[source]¶
Creates a new backup target from an existing node. By default, this will use the first public IP of the node
- Parameters:
node (
Node
) – The Node to backuptype (
BackupTargetType
) – Backup target type (Physical, Virtual, …).extra (
dict
) – (optional) Extra attributes (driver specific).
- Return type:
Instance of
BackupTarget
- create_target_from_storage_container(container, type='Object', extra=None)[source]¶
Creates a new backup target from an existing storage container
- Parameters:
node (
Container
) – The Container to backuptype (
BackupTargetType
) – Backup target type (Physical, Virtual, …).extra (
dict
) – (optional) Extra attributes (driver specific).
- Return type:
Instance of
BackupTarget
- create_target_job(target, extra=None)[source]¶
Create a new backup job on a target
- Parameters:
target (Instance of
BackupTarget
) – Backup target with the backup dataextra (
dict
) – (optional) Extra attributes (driver specific).
- Return type:
Instance of
BackupTargetJob
- delete_target(target)[source]¶
Delete a backup target
- Parameters:
target (Instance of
BackupTarget
) – Backup target to delete
- get_supported_target_types()[source]¶
Get a list of backup target types this driver supports
- Returns:
list
of :class:BackupTargetType
- get_target_job(target, id)[source]¶
Get a specific backup job by ID
- Parameters:
target (Instance of
BackupTarget
) – Backup target with the backup dataid (Instance of
BackupTarget
) – Backup target with the backup data
- Return type:
- list_recovery_points(target, start_date=None, end_date=None)[source]¶
List the recovery points available for a target
- Parameters:
target (Instance of
BackupTarget
) – Backup target to deletestart_date (
datetime.datetime
) – The start date to show jobs between (optional)end_date (
datetime.datetime`
) – The end date to show jobs between (optional)
- Return type:
list
ofBackupTargetRecoveryPoint
- list_target_jobs(target)[source]¶
List the backup jobs on a target
- Parameters:
target (Instance of
BackupTarget
) – Backup target with the backup data- Return type:
list
ofBackupTargetJob
- list_targets()[source]¶
List all backuptargets
- Return type:
list
ofBackupTarget
- recover_target(target, recovery_point, path=None)[source]¶
Recover a backup target to a recovery point
- Parameters:
target (Instance of
BackupTarget
) – Backup target to deleterecovery_point (Instance of
BackupTarget
) – Backup target with the backup datapath (
str
) – The part of the recovery point to recover (optional)
- Return type:
Instance of
BackupTargetJob
- recover_target_out_of_place(target, recovery_point, recovery_target, path=None)[source]¶
Recover a backup target to a recovery point out-of-place
- Parameters:
target (Instance of
BackupTarget
) – Backup target with the backup datarecovery_point (Instance of
BackupTarget
) – Backup target with the backup datarecovery_target (Instance of
BackupTarget
) – Backup target with to recover the data topath (
str
) – The part of the recovery point to recover (optional)
- Return type:
Instance of
BackupTargetJob
- resume_target_job(job)[source]¶
Resume a suspended backup job on a target
- Parameters:
target (Instance of
BackupTarget
) – Backup target with the backup datajob (Instance of
BackupTargetJob
) – Backup target job to resume
- Return type:
bool
- suspend_target_job(job)[source]¶
Suspend a running backup job on a target
- Parameters:
target (Instance of
BackupTarget
) – Backup target with the backup datajob (Instance of
BackupTargetJob
) – Backup target job to suspend
- Return type:
bool
- update_target(target, name, address, extra)[source]¶
Update the properties of a backup target
- Parameters:
target (Instance of
BackupTarget
) – Backup target to updatename (
str
) – Name of the targetaddress (
str
) – Hostname, FQDN, IP, file path etc.extra (
dict
) – (optional) Extra attributes (driver specific).
- Return type:
Instance of
BackupTarget
- class libcloud.backup.base.BackupTarget(id, name, address, type, driver, extra=None)[source]¶
A backup target
- Parameters:
id (
str
) – Target idname (
str
) – Name of the targetaddress (
str
) – Hostname, FQDN, IP, file path etc.type (
BackupTargetType
) – Backup target type (Physical, Virtual, …).driver (
BackupDriver
) – BackupDriver instance.extra (
dict
) – (optional) Extra attributes (driver specific).
- class libcloud.backup.base.BackupTargetJob(id, status, progress, target, driver, extra=None)[source]¶
A backup target job
- Parameters:
id (
str
) – Job idstatus (
BackupTargetJobStatusType
) – Status of the jobprogress (
int
) – Progress of the job, as a percentagetarget (
BackupTarget
) – BackupTarget instance.driver (
BackupDriver
) – BackupDriver instance.extra (
dict
) – (optional) Extra attributes (driver specific).
- class libcloud.backup.base.BackupTargetRecoveryPoint(id, date, target, driver, extra=None)[source]¶
A backup target recovery point
- Parameters:
id (
str
) – Job iddate (
datetime.datetime
) – The date takentarget (
BackupTarget
) – BackupTarget instance.driver (
BackupDriver
) – BackupDriver instance.extra (
dict
) – (optional) Extra attributes (driver specific).
- recover(path=None)[source]¶
Recover this recovery point
- Parameters:
path (
str
) – The part of the recovery point to recover (optional)- Return type:
Instance of
BackupTargetJob
- recover_to(recovery_target, path=None)[source]¶
Recover this recovery point out of place
- Parameters:
recovery_target (Instance of
BackupTarget
) – Backup target with to recover the data topath (
str
) – The part of the recovery point to recover (optional)
- Return type:
Instance of
BackupTargetJob
- class libcloud.backup.types.BackupTargetType[source]¶
Backup Target type.
- DATABASE = 'Database'¶
Denotes a database target
- FILESYSTEM = 'Filesystem'¶
Denotes a file system (e.g. NAS)
- OBJECT = 'Object'¶
Denotes an object based file system
- PHYSICAL = 'Physical'¶
Denotes a physical host
- VIRTUAL = 'Virtual'¶
Denotes a virtual host
- VOLUME = 'Volume'¶
Denotes a block storage volume