~0x44/nova/bug838466

« back to all changes in this revision

Viewing changes to nova/db/api.py

  • Committer: Brian Waldon
  • Date: 2011-07-26 17:13:41 UTC
  • mfrom: (1324 nova)
  • mto: This revision was merged to the branch mainline in revision 1326.
  • Revision ID: brian.waldon@rackspace.com-20110726171341-jrclqn08ew7ngshr
merging trunk; resolving conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
314
314
    return IMPL.migration_get(context, migration_id)
315
315
 
316
316
 
317
 
def migration_get_by_instance_and_status(context, instance_id, status):
318
 
    """Finds a migration by the instance id its migrating."""
319
 
    return IMPL.migration_get_by_instance_and_status(context, instance_id,
 
317
def migration_get_by_instance_and_status(context, instance_uuid, status):
 
318
    """Finds a migration by the instance uuid its migrating."""
 
319
    return IMPL.migration_get_by_instance_and_status(context, instance_uuid,
320
320
            status)
321
321
 
322
322
 
332
332
    return IMPL.fixed_ip_associate(context, address, instance_id)
333
333
 
334
334
 
335
 
def fixed_ip_associate_pool(context, network_id, instance_id):
336
 
    """Find free ip in network and associate it to instance.
 
335
def fixed_ip_associate_pool(context, network_id, instance_id=None, host=None):
 
336
    """Find free ip in network and associate it to instance or host.
337
337
 
338
338
    Raises if one is not available.
339
339
 
340
340
    """
341
 
    return IMPL.fixed_ip_associate_pool(context, network_id, instance_id)
 
341
    return IMPL.fixed_ip_associate_pool(context, network_id,
 
342
                                        instance_id, host)
342
343
 
343
344
 
344
345
def fixed_ip_create(context, values):
361
362
    return IMPL.fixed_ip_get_all(context)
362
363
 
363
364
 
364
 
def fixed_ip_get_all_by_host(context, host):
365
 
    """Get all defined fixed ips used by a host."""
366
 
    return IMPL.fixed_ip_get_all_by_host(context, host)
 
365
def fixed_ip_get_all_by_instance_host(context, host):
 
366
    """Get all allocated fixed ips filtered by instance host."""
 
367
    return IMPL.fixed_ip_get_all_instance_by_host(context, host)
367
368
 
368
369
 
369
370
def fixed_ip_get_by_address(context, address):
376
377
    return IMPL.fixed_ip_get_by_instance(context, instance_id)
377
378
 
378
379
 
 
380
def fixed_ip_get_by_network_host(context, network_id, host):
 
381
    """Get fixed ip for a host in a network."""
 
382
    return IMPL.fixed_ip_get_by_network_host(context, network_id, host)
 
383
 
 
384
 
379
385
def fixed_ip_get_by_virtual_interface(context, vif_id):
380
386
    """Get fixed ips by virtual interface or raise if none exist."""
381
387
    return IMPL.fixed_ip_get_by_virtual_interface(context, vif_id)
1305
1311
    return IMPL.instance_type_get_all(context, inactive)
1306
1312
 
1307
1313
 
1308
 
def instance_type_get_by_id(context, id):
 
1314
def instance_type_get(context, id):
1309
1315
    """Get instance type by id."""
1310
 
    return IMPL.instance_type_get_by_id(context, id)
 
1316
    return IMPL.instance_type_get(context, id)
1311
1317
 
1312
1318
 
1313
1319
def instance_type_get_by_name(context, name):