Update device image delete api

This commit updates the device image delete api to return
the device image information required by sysinv-api-proxy
in order to delete the image file from vault.

Story: 2007875
Task: 40372

Change-Id: Ie19993b9124a0fe82118462e1ccc25ba606a14ac
Signed-off-by: Teresa Ho <teresa.ho@windriver.com>
This commit is contained in:
Teresa Ho 2020-07-16 14:04:08 -04:00
parent f5cb633b7f
commit 83f105056c
1 changed files with 2 additions and 1 deletions

View File

@ -259,7 +259,7 @@ class DeviceImageController(rest.RestController):
return dict(success="", error="", device_image=device_image_dict)
@cutils.synchronized(LOCK_NAME)
@wsme_pecan.wsexpose(None, types.uuid, status_code=204)
@wsme_pecan.wsexpose(DeviceImage, types.uuid, status_code=202)
def delete(self, deviceimage_uuid):
"""Delete a device image."""
device_image = objects.device_image.get_by_uuid(
@ -278,6 +278,7 @@ class DeviceImageController(rest.RestController):
filename = cutils.format_image_filename(device_image)
pecan.request.rpcapi.delete_bitstream_file(pecan.request.context,
filename)
return DeviceImage.convert_with_links(device_image)
@cutils.synchronized(LOCK_NAME)
@wsme_pecan.wsexpose(DeviceImage, types.uuid, wtypes.text, body=types.apidict)