Coverage for nova/api/openstack/compute/consoles.py: 84%

25 statements  

« prev     ^ index     » next       coverage.py v7.6.12, created at 2025-04-24 11:16 +0000

1# Copyright 2010 OpenStack Foundation 

2# All Rights Reserved. 

3# 

4# Licensed under the Apache License, Version 2.0 (the "License"); you may 

5# not use this file except in compliance with the License. You may obtain 

6# a copy of the License at 

7# 

8# http://www.apache.org/licenses/LICENSE-2.0 

9# 

10# Unless required by applicable law or agreed to in writing, software 

11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 

12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 

13# License for the specific language governing permissions and limitations 

14# under the License. 

15 

16from webob import exc 

17 

18from nova.api.openstack.compute.schemas import consoles as schema 

19from nova.api.openstack import wsgi 

20from nova.api import validation 

21 

22_removal_reason = """\ 

23This API only works with the Xen virt driver, which was deprecated in the 

2420.0.0 (Train) release. 

25It was removed in the 21.0.0 (Ussuri) release. 

26""" 

27 

28 

29class ConsolesController(wsgi.Controller): 

30 """(Removed) The Consoles controller for the OpenStack API. 

31 

32 This was removed during the Ussuri release along with the nova-console 

33 service. 

34 """ 

35 

36 @wsgi.expected_errors(410) 

37 @wsgi.removed('21.0.0', _removal_reason) 

38 @validation.query_schema(schema.index_query) 

39 def index(self, req, server_id): 

40 raise exc.HTTPGone() 

41 

42 @wsgi.expected_errors(410) 

43 @wsgi.removed('21.0.0', _removal_reason) 

44 @validation.schema(schema.create) 

45 def create(self, req, server_id, body): 

46 raise exc.HTTPGone() 

47 

48 @wsgi.expected_errors(410) 

49 @wsgi.removed('21.0.0', _removal_reason) 

50 @validation.query_schema(schema.show_query) 

51 def show(self, req, server_id, id): 

52 raise exc.HTTPGone() 

53 

54 @wsgi.expected_errors(410) 

55 @wsgi.removed('21.0.0', _removal_reason) 

56 def delete(self, req, server_id, id): 

57 raise exc.HTTPGone()