Coverage for nova/api/openstack/compute/cells.py: 82%

50 statements  

« prev     ^ index     » next       coverage.py v7.6.12, created at 2025-04-17 15:08 +0000

1# Copyright 2011-2012 OpenStack Foundation 

2# All Rights Reserved. 

3# Copyright 2013 Red Hat, Inc. 

4# 

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

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

7# a copy of the License at 

8# 

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

10# 

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

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

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

14# License for the specific language governing permissions and limitations 

15# under the License. 

16 

17from webob import exc 

18 

19from nova.api.openstack.compute.schemas import cells as schema 

20from nova.api.openstack import wsgi 

21from nova.api import validation 

22 

23_removal_reason = """\ 

24This API only works in a Cells v1 deployment, which was deprecated in the 

2516.0.0 (Pike) release. It is not used with Cells v2, which is required 

26beginning in the 15.0.0 (Ocata) release. 

27It was removed in the 20.0.0 (Train) release. 

28""" 

29 

30 

31class CellsController(wsgi.Controller): 

32 """(Removed) Controller for Cell resources. 

33 

34 This was removed during the Train release in favour of cells v2. 

35 """ 

36 

37 @wsgi.expected_errors(410) 

38 @wsgi.removed('20.0.0', _removal_reason) 

39 @validation.query_schema(schema.index_query) 

40 def index(self, req): 

41 raise exc.HTTPGone() 

42 

43 @wsgi.expected_errors(410) 

44 @wsgi.removed('20.0.0', _removal_reason) 

45 @validation.query_schema(schema.detail_query) 

46 def detail(self, req): 

47 raise exc.HTTPGone() 

48 

49 @wsgi.expected_errors(410) 

50 @wsgi.removed('20.0.0', _removal_reason) 

51 @validation.query_schema(schema.info_query) 

52 def info(self, req): 

53 raise exc.HTTPGone() 

54 

55 @wsgi.expected_errors(410) 

56 @wsgi.removed('20.0.0', _removal_reason) 

57 @validation.query_schema(schema.capacities_query) 

58 def capacities(self, req, id=None): 

59 raise exc.HTTPGone() 

60 

61 @wsgi.expected_errors(410) 

62 @wsgi.removed('20.0.0', _removal_reason) 

63 @validation.query_schema(schema.show_query) 

64 def show(self, req, id): 

65 raise exc.HTTPGone() 

66 

67 @wsgi.expected_errors(410) 

68 @wsgi.removed('20.0.0', _removal_reason) 

69 def delete(self, req, id): 

70 raise exc.HTTPGone() 

71 

72 @wsgi.expected_errors(410) 

73 @wsgi.removed('20.0.0', _removal_reason) 

74 @validation.schema(schema.create) 

75 def create(self, req, body): 

76 raise exc.HTTPGone() 

77 

78 @wsgi.expected_errors(410) 

79 @wsgi.removed('20.0.0', _removal_reason) 

80 @validation.schema(schema.update) 

81 def update(self, req, id, body): 

82 raise exc.HTTPGone() 

83 

84 @wsgi.expected_errors(410) 

85 @wsgi.removed('20.0.0', _removal_reason) 

86 @validation.schema(schema.sync_instances) 

87 def sync_instances(self, req, body): 

88 raise exc.HTTPGone()