vmm: api: Return 404 (not 500) for unknown device/disk id

Map NoDeviceToRemove and DeviceManager(UnknownDeviceId) to 404 Not
Found, update the OpenAPI 404 descriptions, and add unit tests.

Signed-off-by: Stepan Rabotkin <epicstyt@gmail.com>
Assisted-by: Claude:Opus-4.8
This commit is contained in:
Stepan Rabotkin
2026-07-27 14:26:39 +03:00
committed by Rob Bradford
parent a5e145bdef
commit 5e01807fa2
2 changed files with 48 additions and 3 deletions

View File

@@ -179,7 +179,7 @@ paths:
204:
description: The disk was successfully resized.
404:
description: The disk could not be resized because the VM is not created.
description: The disk could not be resized because the VM is not created, or no disk with the given identifier exists.
500:
description: The disk could not be resized.
@@ -237,7 +237,7 @@ paths:
204:
description: The device was successfully removed from the VM instance.
404:
description: The device could not be removed from the VM instance.
description: The device could not be removed because the VM is not created, or no device with the given identifier exists.
/vm.add-disk:
put: