~hudson-openstack/nova/trunk

« back to all changes in this revision

Viewing changes to nova/db/api.py

  • Committer: Tarmac
  • Author(s): Rick Harris
  • Date: 2011-09-22 16:42:20 UTC
  • mfrom: (1590.1.11 flavor_min_filter)
  • Revision ID: tarmac-20110922164220-ndscikwberuj3c7f
This patch adds flavor filtering, specifically the ability to flavor on minRam, minDisk, or both, per the 1.1 OSAPI spec.

In addition, this patch refactors instance_type_get_all to return a *list* of instance_types instead of a *dict*. This makes it more consistent with the rest of the DB API.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1349
1349
    return IMPL.instance_type_create(context, values)
1350
1350
 
1351
1351
 
1352
 
def instance_type_get_all(context, inactive=False):
 
1352
def instance_type_get_all(context, inactive=False, filters=None):
1353
1353
    """Get all instance types."""
1354
 
    return IMPL.instance_type_get_all(context, inactive)
 
1354
    return IMPL.instance_type_get_all(
 
1355
        context, inactive=inactive, filters=filters)
1355
1356
 
1356
1357
 
1357
1358
def instance_type_get(context, id):