From fabc658f49b69a0b237425f6a57000227dbe442a Mon Sep 17 00:00:00 2001 From: xianming mao Date: Wed, 15 Feb 2017 15:59:59 +0800 Subject: [PATCH] Add the backup variable structure in backup_driver interface Change-Id: Id6d25e1db12bff20c2e03e73693cfafbb947fb7b --- cinder/interface/backup_driver.py | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/cinder/interface/backup_driver.py b/cinder/interface/backup_driver.py index 8be05d9daf0..8ad139174bb 100644 --- a/cinder/interface/backup_driver.py +++ b/cinder/interface/backup_driver.py @@ -57,12 +57,35 @@ class BackupDriver(base.CinderInterface): If the parent backup is of different size, a full backup should be performed to ensure all data is included. - TODO(smcginnis) Document backup variable structure. - :param backup: The backup information. :param volume_file: The volume or file to write the backup to. :param backup_metadata: Whether to include volume metadata in the backup. + + The variable structure of backup in the following format:: + + { + 'id': id, + 'availability_zone': availability_zone, + 'service': driver_name, + 'user_id': context.user_id, + 'project_id': context.project_id, + 'display_name': name, + 'display_description': description, + 'volume_id': volume_id, + 'status': fields.BackupStatus.CREATING, + 'container': container, + 'parent_id': parent_id, + 'size': size, + 'host': host, + 'snapshot_id': snapshot_id, + 'data_timestamp': data_timestamp, + } + + service: backup driver + parent_id: parent backup id + size: equal to volume size + data_timestamp: backup creation time """ def restore(self, backup, volume_id, volume_file):