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

5 statements  

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

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

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

3# a copy of the License at 

4# 

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

6# 

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

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

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

10# License for the specific language governing permissions and limitations 

11# under the License. 

12 

13from nova.api.validation import parameter_types 

14 

15 

16add_fixed_ip = { 

17 'type': 'object', 

18 'properties': { 

19 'addFixedIp': { 

20 'type': 'object', 

21 'properties': { 

22 # The maxLength is from the column 'uuid' of the 

23 # table 'networks' 

24 'networkId': { 

25 'type': ['string', 'number'], 

26 'minLength': 1, 'maxLength': 36, 

27 }, 

28 }, 

29 'required': ['networkId'], 

30 'additionalProperties': False, 

31 }, 

32 }, 

33 'required': ['addFixedIp'], 

34 'additionalProperties': False, 

35} 

36 

37remove_fixed_ip = { 

38 'type': 'object', 

39 'properties': { 

40 'removeFixedIp': { 

41 'type': 'object', 

42 'properties': { 

43 'address': parameter_types.ip_address 

44 }, 

45 'required': ['address'], 

46 'additionalProperties': False, 

47 }, 

48 }, 

49 'required': ['removeFixedIp'], 

50 'additionalProperties': False, 

51} 

52 

53add_fixed_ip_response = { 

54 'type': 'null', 

55} 

56 

57remove_fixed_ip_response = { 

58 'type': 'null', 

59}