Skip to main content
create_backup(backup_name=None, backup_type=None, backup_objects_map=, datasink_name=None, options=)[source]

Creates a database backup, containing a snapshot of existing objects, at the remote file store accessible via the data sink specified by input parameter datasink_name.

Parameters

backup_name (str) –

Name for this backup. If the backup already exists, only an incremental or differential backup can be made, unless recreate is set to true.

backup_type (str) –

Type of snapshot to create. Allowed values are:

  • differential – Snapshot of changes in the database objects and data since the last full snapshot.

  • full – Snapshot of the given database objects and data.

  • incremental – Snapshot of changes in the database objects and data since the last snapshot of any kind.

backup_objects_map (dict of str to str) –

Map of objects to be captured in the backup; must be specified when creating a full snapshot and left unspecified when creating an incremental or differential snapshot. Allowed keys are:

The default value is an empty dict ( ).

datasink_name (str) –

Data sink through which the backup will be stored.

options (dict of str to str) –

Optional parameters. Allowed keys are:

  • block_table_mutations – Whether or not to block all mutations on target tables while they are being backed up. Allowed values are:

    • true – Block all mutations on target tables while they are being backed up.

    • false – Only block mutations on a target table at the point a disk eviction is necessary.

    The default value is ‘false’.

  • checksum – Whether or not to calculate checksums for backup files. Allowed values are:

    • true

    • false

    The default value is ‘false’.

  • comment – Comments to store with this backup.

  • ddl_only – Whether or not, for tables, to only backup DDL and not table data. Allowed values are:

    • true – For tables, only back up DDL, not data.

    • false – For tables, back up DDL and data.

    The default value is ‘false’.

  • delete_intermediate_backups – Whether or not to delete any intermediate snapshots when the input parameter backup_type is set to differential. Allowed values are:

    • true

    • false

    The default value is ‘false’.

  • dry_run – Whether or not to perform a dry run of a backup operation. Allowed values are:

    • true

    • false

    The default value is ‘false’.

  • max_incremental_backups_to_keep – Maximum number of incremental snapshots to keep. The default value is ‘-1’.

  • recreate – Whether or not to replace an existing backup object with a new backup with a full snapshot, if one already exists. Allowed values are:

    • true

    • false

    The default value is ‘false’.

The default value is an empty dict ( ).

Returns

A dict with the following entries–

backup_name (str) –

Value of input parameter backup_name.

backup_id (long) –

ID of the snapshot created.

copied_bytes (long) –

Total size of all files copied for this snapshot.

copied_files (long) –

Total number of files copied for this snapshot.

copied_records (long) –

Total number of records in all files copied for this snapshot.

total_number_of_records (long) –

Total number of records that can be restored from this snapshot.

info (dict of str to str) –

Additional information.