libcloud.backup.drivers.gce module
- class libcloud.backup.drivers.gce.GCEBackupDriver(user_id, key=None, project=None, auth_type=None, scopes=None, credential_file=None, **kwargs)[source]
Bases:
BackupDriver
- Parameters:
user_id (
str
) – The email address (for service accounts) or Client ID (for installed apps) to be used for authentication.key (
str
) – The RSA Key (for service accounts) or file path containing key or Client Secret (for installed apps) to be used for authentication.project (
str
) – Your GCE project name. (required)auth_type (
str
) – Accepted values are “SA” or “IA” or “GCE” (“Service Account” or “Installed Application” or “GCE” if libcloud is being used on a GCE instance with service account enabled). If not supplied, auth_type will be guessed based on value of user_id or if the code is being executed in a GCE instance.scopes (
list
) – List of authorization URLs. Default is empty and grants read/write to Compute, Storage, DNS.credential_file (
str
) – Path to file for caching authentication information used by GCEConnection.
- cancel_target_job(target, 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
GCEConnection
- create_target(name, address, type='Volume', extra=None)[source]
Creates a new backup target
- Parameters:
name (
str
) – Name of the targetaddress (
str
) – The volume ID.type (
BackupTargetType
) – Backup target type (Physical, Virtual, …).extra (
dict
) – (optional) Extra attributes (driver specific).
- Return type:
Instance of
BackupTarget
- create_target_from_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_from_node(node, type='Virtual', extra=None)[source]
Creates a new backup target from an existing 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_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:
BackupTargetJob
- 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
- name = 'Google Compute Engine Backup Driver'
- 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(target, 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(target, 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
- website = 'http://cloud.google.com/'