Merge "Add new APIs and deprecate old API for migrations"
This commit is contained in:
commit
7ddec4256d
@ -511,6 +511,13 @@ def migration_get_all_by_filters(context, filters):
|
||||
return IMPL.migration_get_all_by_filters(context, filters)
|
||||
|
||||
|
||||
def migration_get_in_progress_by_instance(context, instance_uuid,
|
||||
migration_type=None):
|
||||
"""Finds all migrations of an instance in progress."""
|
||||
return IMPL.migration_get_in_progress_by_instance(context, instance_uuid,
|
||||
migration_type)
|
||||
|
||||
|
||||
####################
|
||||
|
||||
|
||||
|
@ -4547,6 +4547,23 @@ def migration_get_in_progress_by_host_and_node(context, host, node):
|
||||
all()
|
||||
|
||||
|
||||
@main_context_manager.reader
|
||||
def migration_get_in_progress_by_instance(context, instance_uuid,
|
||||
migration_type=None):
|
||||
# TODO(Shaohe Feng) we should share the in-progress list.
|
||||
# TODO(Shaohe Feng) will also summarize all status to a new
|
||||
# MigrationStatus class.
|
||||
query = model_query(context, models.Migration).\
|
||||
filter_by(instance_uuid=instance_uuid).\
|
||||
filter(models.Migration.status.in_(['queued', 'preparing',
|
||||
'running',
|
||||
'post-migrating']))
|
||||
if migration_type:
|
||||
query = query.filter(models.Migration.migration_type == migration_type)
|
||||
|
||||
return query.all()
|
||||
|
||||
|
||||
@main_context_manager.reader
|
||||
def migration_get_all_by_filters(context, filters):
|
||||
query = model_query(context, models.Migration)
|
||||
|
Loading…
x
Reference in New Issue
Block a user