~ubuntu-branches/ubuntu/raring/cinder/raring

« back to all changes in this revision

Viewing changes to cinder/db/api.py

  • Committer: Package Import Robot
  • Author(s): Chris J Arges
  • Date: 2013-01-15 10:10:28 UTC
  • mfrom: (7.1.1 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20130115101028-i1jf2lyewii1xf2e
Tags: 2013.1~g2-0ubuntu2
debian/patches/series: Enable skip_failed_tests to fix FTBFS. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
               help='Template string to be used to generate volume names'),
62
62
    cfg.StrOpt('snapshot_name_template',
63
63
               default='snapshot-%s',
64
 
               help='Template string to be used to generate snapshot names'),
65
 
    ]
 
64
               help='Template string to be used to generate snapshot names'), ]
66
65
 
67
66
FLAGS = flags.FLAGS
68
67
FLAGS.register_opts(db_opts)
155
154
 
156
155
def migration_get_by_instance_and_status(context, instance_uuid, status):
157
156
    """Finds a migration by the instance uuid its migrating."""
158
 
    return IMPL.migration_get_by_instance_and_status(context, instance_uuid,
159
 
            status)
 
157
    return IMPL.migration_get_by_instance_and_status(context,
 
158
                                                     instance_uuid,
 
159
                                                     status)
160
160
 
161
161
 
162
162
def migration_get_all_unconfirmed(context, confirm_window):
229
229
    return IMPL.volume_get(context, volume_id)
230
230
 
231
231
 
232
 
def volume_get_all(context):
 
232
def volume_get_all(context, marker, limit, sort_key, sort_dir):
233
233
    """Get all volumes."""
234
 
    return IMPL.volume_get_all(context)
 
234
    return IMPL.volume_get_all(context, marker, limit, sort_key, sort_dir)
235
235
 
236
236
 
237
237
def volume_get_all_by_host(context, host):
244
244
    return IMPL.volume_get_all_by_instance_uuid(context, instance_uuid)
245
245
 
246
246
 
247
 
def volume_get_all_by_project(context, project_id):
 
247
def volume_get_all_by_project(context, project_id, marker, limit, sort_key,
 
248
                              sort_dir):
248
249
    """Get all volumes belonging to a project."""
249
 
    return IMPL.volume_get_all_by_project(context, project_id)
 
250
    return IMPL.volume_get_all_by_project(context, project_id, marker, limit,
 
251
                                          sort_key, sort_dir)
250
252
 
251
253
 
252
254
def volume_get_iscsi_target_num(context, volume_id):
353
355
    return IMPL.volume_type_get_by_name(context, name)
354
356
 
355
357
 
356
 
def volume_type_destroy(context, name):
 
358
def volume_type_destroy(context, id):
357
359
    """Delete a volume type."""
358
 
    return IMPL.volume_type_destroy(context, name)
 
360
    return IMPL.volume_type_destroy(context, id)
359
361
 
360
362
 
361
363
def volume_get_active_by_window(context, begin, end=None, project_id=None):
378
380
    IMPL.volume_type_extra_specs_delete(context, volume_type_id, key)
379
381
 
380
382
 
381
 
def volume_type_extra_specs_update_or_create(context, volume_type_id,
382
 
                                               extra_specs):
 
383
def volume_type_extra_specs_update_or_create(context,
 
384
                                             volume_type_id,
 
385
                                             extra_specs):
383
386
    """Create or update volume type extra specs. This adds or modifies the
384
387
    key/value pairs specified in the extra specs dict argument"""
385
 
    IMPL.volume_type_extra_specs_update_or_create(context, volume_type_id,
386
 
                                                    extra_specs)
 
388
    IMPL.volume_type_extra_specs_update_or_create(context,
 
389
                                                  volume_type_id,
 
390
                                                  extra_specs)
387
391
 
388
392
 
389
393
###################
391
395
 
392
396
def volume_glance_metadata_create(context, volume_id, key, value):
393
397
    """Update the Glance metadata for the specified volume."""
394
 
    return IMPL.volume_glance_metadata_create(context, volume_id,
395
 
                                              key, value)
 
398
    return IMPL.volume_glance_metadata_create(context,
 
399
                                              volume_id,
 
400
                                              key,
 
401
                                              value)
396
402
 
397
403
 
398
404
def volume_glance_metadata_get(context, volume_id):