Coverage for nova/api/openstack/compute/schemas/rescue.py: 100%

5 statements  

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

1# Copyright 2014 NEC Corporation. 

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 nova.api.validation import parameter_types 

17 

18rescue = { 

19 'type': 'object', 

20 'properties': { 

21 'rescue': { 

22 'type': ['object', 'null'], 

23 'properties': { 

24 'adminPass': parameter_types.admin_password, 

25 'rescue_image_ref': parameter_types.image_id, 

26 }, 

27 'additionalProperties': False, 

28 }, 

29 }, 

30 'required': ['rescue'], 

31 'additionalProperties': False, 

32} 

33 

34# TODO(stephenfin): Restrict the value to 'null' in a future API version 

35unrescue = { 

36 'type': 'object', 

37 'properties': { 

38 'unrescue': {}, 

39 }, 

40 'required': ['unrescue'], 

41 'additionalProperties': False, 

42} 

43 

44rescue_response = { 

45 'type': 'object', 

46 'properties': { 

47 'adminPass': { 

48 'type': 'string', 

49 }, 

50 }, 

51 'additionalProperties': False, 

52} 

53 

54unrescue_response = { 

55 'type': 'null', 

56}