From aa19811139aeab74baf7065784b24fd66f6e32e2 Mon Sep 17 00:00:00 2001 From: Stepan Rabotkin Date: Fri, 24 Jul 2026 17:03:59 +0300 Subject: [PATCH] vmm: openapi: Add missing 404 responses to spec PR #8320 changed several endpoints to return 404 (Not Found) when the VM has not been created yet, but the OpenAPI specification was not updated to document these responses. Add the missing 404 entries for vm.info, resize, resize-zone and the (cold) add-disk/device/pmem/net/vsock/vdpa endpoints so the spec matches the implemented HTTP status codes. Signed-off-by: Stepan Rabotkin Assisted-by: Claude:Opus-4.8 --- vmm/src/api/openapi/cloud-hypervisor.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/vmm/src/api/openapi/cloud-hypervisor.yaml b/vmm/src/api/openapi/cloud-hypervisor.yaml index e0a888f65..f4603f9ea 100644 --- a/vmm/src/api/openapi/cloud-hypervisor.yaml +++ b/vmm/src/api/openapi/cloud-hypervisor.yaml @@ -40,6 +40,8 @@ paths: application/json: schema: $ref: "#/components/schemas/VmInfo" + 404: + description: The VM information is not available because the VM is not created. /vm.counters: get: @@ -176,6 +178,8 @@ paths: responses: 204: description: The disk was successfully resized. + 404: + description: The disk could not be resized because the VM is not created. 500: description: The disk could not be resized. @@ -192,6 +196,8 @@ paths: responses: 204: description: The memory zone was successfully resized. + 404: + description: The memory zone could not be resized because the VM is not created. 500: description: The memory zone could not be resized. @@ -252,6 +258,8 @@ paths: $ref: "#/components/schemas/PciDeviceInfo" 204: description: The new disk was successfully (cold) added to the VM instance. + 404: + description: The new disk could not be added because the VM is not created. 500: description: The new disk could not be added to the VM instance. @@ -274,6 +282,8 @@ paths: $ref: "#/components/schemas/PciDeviceInfo" 204: description: The new device was successfully (cold) added to the VM instance. + 404: + description: The new device could not be added because the VM is not created. 500: description: The new device could not be added to the VM instance. @@ -296,6 +306,8 @@ paths: $ref: "#/components/schemas/PciDeviceInfo" 204: description: The new device was successfully (cold) added to the VM instance. + 404: + description: The new device could not be added because the VM is not created. 500: description: The new device could not be added to the VM instance. @@ -318,6 +330,8 @@ paths: $ref: "#/components/schemas/PciDeviceInfo" 204: description: The new device was successfully (cold) added to the VM instance. + 404: + description: The new device could not be added because the VM is not created. 500: description: The new device could not be added to the VM instance. @@ -340,6 +354,8 @@ paths: $ref: "#/components/schemas/PciDeviceInfo" 204: description: The new device was successfully (cold) added to the VM instance. + 404: + description: The new device could not be added because the VM is not created. 500: description: The new device could not be added to the VM instance. @@ -362,6 +378,8 @@ paths: $ref: "#/components/schemas/PciDeviceInfo" 204: description: The new device was successfully (cold) added to the VM instance. + 404: + description: The new device could not be added because the VM is not created. 500: description: The new device could not be added to the VM instance. @@ -384,6 +402,8 @@ paths: $ref: "#/components/schemas/PciDeviceInfo" 204: description: The new vDPA device was successfully (cold) added to the VM instance. + 404: + description: The new vDPA device could not be added because the VM is not created. 500: description: The new vDPA device could not be added to the VM instance.