Debian Codegraph @

neutron_lib/api/definitions/address_group.py

raw
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
13 from neutron_lib.api import converters
14 from neutron_lib import constants
15 from neutron_lib.db import constants as db_const
16
17
18 ALIAS = 'address-group'
19 IS_SHIM_EXTENSION = False
20 IS_STANDARD_ATTR_EXTENSION = False
21 NAME = 'Address group'
22 DESCRIPTION = 'Support address group'
23 UPDATED_TIMESTAMP = '2020-07-15T10:00:00-00:00'
24
25 RESOURCE_NAME = 'address_group'
26 COLLECTION_NAME = 'address_groups'
27
28 RESOURCE_ATTRIBUTE_MAP = {
29 COLLECTION_NAME: {
30 'id': {'allow_post': False, 'allow_put': False,
31 'validate': {'type:uuid': None},
32 'is_visible': True,
33 'is_filter': True,
34 'is_sort_key': True,
35 'primary_key': True},
36 'name': {'allow_post': True, 'allow_put': True, 'default': '',
37 'validate': {
38 'type:string': db_const.NAME_FIELD_SIZE},
39 'is_filter': True,
40 'is_sort_key': True,
41 'is_visible': True},
42 'description': {'allow_post': True, 'allow_put': True, 'default': '',
43 'validate': {
44 'type:string':
45 db_const.LONG_DESCRIPTION_FIELD_SIZE},
46 'is_filter': True,
47 'is_sort_key': True,
48 'is_visible': True},
49 'project_id': {'allow_post': True,
50 'allow_put': False,
51 'validate': {
52 'type:string': db_const.PROJECT_ID_FIELD_SIZE},
53 'required_by_policy': True,
54 'is_filter': True,
55 'is_sort_key': True,
56 'is_visible': True},
57 'addresses': {'allow_post': True, 'allow_put': False,
58 'convert_to':
59 converters.convert_none_to_empty_list,
60 'default': constants.ATTR_NOT_SPECIFIED,
61 'validate': {'type:subnet_list': None},
62 'is_visible': True},
63 constants.SHARED: {'allow_post': False,
64 'allow_put': False,
65 'default': False,
66 'convert_to': converters.convert_to_boolean,
67 'is_visible': False,
68 'is_filter': False,
69 'is_sort_key': False},
70 }
71 }
72
73 SUB_RESOURCE_ATTRIBUTE_MAP = None
74
75 ACTION_MAP = {
76 RESOURCE_NAME: {
77 'add_addresses': 'PUT',
78 'remove_addresses': 'PUT'
79 },
80 }
81
82 ACTION_STATUS = {
83 }
84
85 REQUIRED_EXTENSIONS = [
86 'security-group'
87 ]
88
89 OPTIONAL_EXTENSIONS = [
90 ]