def create_backup(ctxt, volume_id=fake.VOLUME_ID, display_name='test_backup', display_description='This is a test backup', status=fields.BackupStatus.CREATING, parent_id=None, temp_volume_id=None, temp_snapshot_id=None, snapshot_id=None, data_timestamp=None, **kwargs):
 values = {'user_id': (ctxt.user_id or fake.USER_ID), 'project_id': (ctxt.project_id or fake.PROJECT_ID), 'volume_id': volume_id, 'status': status, 'display_name': display_name, 'display_description': display_description, 'container': 'fake', 'availability_zone': 'fake', 'service': 'fake', 'size': ((5 * 1024) * 1024), 'object_count': 22, 'host': socket.gethostname(), 'parent_id': parent_id, 'temp_volume_id': temp_volume_id, 'temp_snapshot_id': temp_snapshot_id, 'snapshot_id': snapshot_id, 'data_timestamp': data_timestamp}
 values.update(kwargs)
 backup = objects.Backup(ctxt, **values)
 backup.create()
 return backup

def create_backup ( ctxt , volume_id = fake . VOLUME_ID , display_name = 'test_backup' , display_description = 'This is a test backup' , status = fields . BackupStatus . CREATING , parent_id = None , temp_volume_id = None , temp_snapshot_id = None , snapshot_id = None , data_timestamp = None , ** kwargs ) : values = { 'user_id' : ( ctxt . user_id or fake . USER_ID ) , 'project_id' : ( ctxt . project_id or fake . PROJECT_ID ) , 'volume_id' : volume_id , 'status' : status , 'display_name' : display_name , 'display_description' : display_description , 'container' : 'fake' , 'availability_zone' : 'fake' , 'service' : 'fake' , 'size' : ( ( 5 * 1024 ) * 1024 ) , 'object_count' : 22 , 'host' : socket . gethostname ( ) , 'parent_id' : parent_id , 'temp_volume_id' : temp_volume_id , 'temp_snapshot_id' : temp_snapshot_id , 'snapshot_id' : snapshot_id , 'data_timestamp' : data_timestamp } values . update ( kwargs ) backup = objects . Backup ( ctxt , ** values ) backup . create ( ) return backup
create a backup object .