From f80e4935e8e223ed17d75af1f0efae2f5362028e Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Fri, 29 Nov 2024 13:04:09 +0000 Subject: [PATCH] api: Add response body schemas for servers APIs (6/6) The last one: delete. Very simple, as always. Change-Id: I08a2dbcd86cf652e9cda193f64edfa655f986506 Signed-off-by: Stephen Finucane --- nova/api/openstack/compute/schemas/servers.py | 2 ++ nova/api/openstack/compute/servers.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/nova/api/openstack/compute/schemas/servers.py b/nova/api/openstack/compute/schemas/servers.py index 1275230d5b..305d322364 100644 --- a/nova/api/openstack/compute/schemas/servers.py +++ b/nova/api/openstack/compute/schemas/servers.py @@ -1771,6 +1771,8 @@ revert_resize_response = {'type': 'null'} reboot_response = {'type': 'null'} +delete_response = {'type': 'null'} + start_server_response = {'type': 'null'} stop_server_response = {'type': 'null'} diff --git a/nova/api/openstack/compute/servers.py b/nova/api/openstack/compute/servers.py index fc628c48e2..96f2a551d4 100644 --- a/nova/api/openstack/compute/servers.py +++ b/nova/api/openstack/compute/servers.py @@ -89,6 +89,7 @@ INVALID_FLAVOR_IMAGE_EXCEPTIONS = ( ) +@validation.validated class ServersController(wsgi.Controller): """The Server API base controller class for the OpenStack API.""" @@ -1143,6 +1144,7 @@ class ServersController(wsgi.Controller): @wsgi.response(204) @wsgi.expected_errors((404, 409)) + @validation.response_body_schema(schema.delete_response) def delete(self, req, id): """Destroys a server.""" try: