Support delete Qemu disk image from API

Return the real disk image name in the 'hdx_disk_image_backed' property for Qemu VMs
This commit is contained in:
grossmj
2022-04-14 17:01:54 +07:00
parent a1c76ec4f2
commit e50bed5bee
13 changed files with 191 additions and 42 deletions

View File

@ -162,6 +162,22 @@ async def update_qemu_disk_image(
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.delete(
"/{node_id}/disk_image/{disk_name}",
status_code=status.HTTP_204_NO_CONTENT
)
async def delete_qemu_disk_image(
disk_name: str,
node: QemuVM = Depends(dep_node)
) -> Response:
"""
Delete a Qemu disk image.
"""
node.delete_disk_image(disk_name)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT)
async def start_qemu_node(node: QemuVM = Depends(dep_node)) -> Response:
"""