~citrix-openstack/nova/xenapi

« back to all changes in this revision

Viewing changes to nova/db/api.py

merged trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
 
81
81
 
82
82
def service_get(context, service_id):
83
 
    """Get an service or raise if it does not exist."""
 
83
    """Get a service or raise if it does not exist."""
84
84
    return IMPL.service_get(context, service_id)
85
85
 
86
86
 
 
87
def service_get_by_host_and_topic(context, host, topic):
 
88
    """Get a service by host it's on and topic it listens to"""
 
89
    return IMPL.service_get_by_host_and_topic(context, host, topic)
 
90
 
 
91
 
87
92
def service_get_all(context, disabled=False):
88
93
    """Get all services."""
89
94
    return IMPL.service_get_all(context, disabled)
254
259
 
255
260
####################
256
261
 
 
262
def migration_update(context, id, values):
 
263
    """Update a migration instance"""
 
264
    return IMPL.migration_update(context, id, values)
 
265
 
 
266
 
 
267
def migration_create(context, values):
 
268
    """Create a migration record"""
 
269
    return IMPL.migration_create(context, values)
 
270
 
 
271
 
 
272
def migration_get(context, migration_id):
 
273
    """Finds a migration by the id"""
 
274
    return IMPL.migration_get(context, migration_id)
 
275
 
 
276
 
 
277
def migration_get_by_instance_and_status(context, instance_id, status):
 
278
    """Finds a migration by the instance id its migrating"""
 
279
    return IMPL.migration_get_by_instance_and_status(context, instance_id,
 
280
            status)
 
281
 
 
282
####################
 
283
 
257
284
 
258
285
def fixed_ip_associate(context, address, instance_id):
259
286
    """Associate fixed ip to instance.
630
657
###############
631
658
 
632
659
 
633
 
def auth_destroy_token(context, token):
 
660
def auth_token_destroy(context, token_id):
634
661
    """Destroy an auth token."""
635
 
    return IMPL.auth_destroy_token(context, token)
636
 
 
637
 
 
638
 
def auth_get_token(context, token_hash):
 
662
    return IMPL.auth_token_destroy(context, token_id)
 
663
 
 
664
 
 
665
def auth_token_get(context, token_hash):
639
666
    """Retrieves a token given the hash representing it."""
640
 
    return IMPL.auth_get_token(context, token_hash)
641
 
 
642
 
 
643
 
def auth_create_token(context, token):
 
667
    return IMPL.auth_token_get(context, token_hash)
 
668
 
 
669
 
 
670
def auth_token_update(context, token_hash, values):
 
671
    """Updates a token given the hash representing it."""
 
672
    return IMPL.auth_token_update(context, token_hash, values)
 
673
 
 
674
 
 
675
def auth_token_create(context, token):
644
676
    """Creates a new token."""
645
 
    return IMPL.auth_create_token(context, token)
 
677
    return IMPL.auth_token_create(context, token)
646
678
 
647
679
 
648
680
###################
1002
1034
    return IMPL.console_get(context, console_id, instance_id)
1003
1035
 
1004
1036
 
 
1037
    ##################
 
1038
 
 
1039
 
 
1040
def instance_type_create(context, values):
 
1041
    """Create a new instance type"""
 
1042
    return IMPL.instance_type_create(context, values)
 
1043
 
 
1044
 
 
1045
def instance_type_get_all(context, inactive=0):
 
1046
    """Get all instance types"""
 
1047
    return IMPL.instance_type_get_all(context, inactive)
 
1048
 
 
1049
 
 
1050
def instance_type_get_by_name(context, name):
 
1051
    """Get instance type by name"""
 
1052
    return IMPL.instance_type_get_by_name(context, name)
 
1053
 
 
1054
 
 
1055
def instance_type_get_by_flavor_id(context, id):
 
1056
    """Get instance type by name"""
 
1057
    return IMPL.instance_type_get_by_flavor_id(context, id)
 
1058
 
 
1059
 
 
1060
def instance_type_destroy(context, name):
 
1061
    """Delete a instance type"""
 
1062
    return IMPL.instance_type_destroy(context, name)
 
1063
 
 
1064
 
 
1065
def instance_type_purge(context, name):
 
1066
    """Purges (removes) an instance type from DB
 
1067
       Use instance_type_destroy for most cases
 
1068
    """
 
1069
    return IMPL.instance_type_purge(context, name)
 
1070
 
 
1071
 
1005
1072
####################
1006
1073
 
1007
1074