Add VirtualInterface.destroy()

This adds a destroy() method for VirtualInterface which has not been
required before but is now.

Change-Id: Ie00f52153a816049f8efcc9aa8071371ce0b7e5a
Related-Bug: #1602357
This commit is contained in:
Dan Smith 2016-07-12 14:39:30 -07:00
parent 2714909fe8
commit 27d98d29c6
2 changed files with 17 additions and 0 deletions

View File

@ -687,6 +687,11 @@ def virtual_interface_delete_by_instance(context, instance_id):
return IMPL.virtual_interface_delete_by_instance(context, instance_id)
def virtual_interface_delete(context, id):
"""Delete virtual interface by id."""
return IMPL.virtual_interface_delete(context, id)
def virtual_interface_get_all(context):
"""Gets all virtual interfaces from the table."""
return IMPL.virtual_interface_get_all(context)

View File

@ -1640,6 +1640,18 @@ def virtual_interface_delete_by_instance(context, instance_uuid):
soft_delete()
@require_context
@pick_context_manager_writer
def virtual_interface_delete(context, id):
"""Delete virtual interface records.
:param id: id of the interface
"""
_virtual_interface_query(context).\
filter_by(id=id).\
soft_delete()
@require_context
@pick_context_manager_reader
def virtual_interface_get_all(context):