Debian Codegraph @

neutron_lib/api/definitions/bgpvpn_vni.py

raw
1 #
2 # Copyright 2017 Ericsson India Global Services Pvt Ltd. 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 #
16
17 from neutron_lib.api import converters as lib_converters
18 from neutron_lib.api.definitions import bgpvpn
19 from neutron_lib import constants
20
21
22 VNI = 'vni'
23
24 # The alias of the extension.
25 ALIAS = 'bgpvpn-vni'
26
27 # Whether or not this extension is simply signaling behavior to the user
28 # or it actively modifies the attribute map.
29 IS_SHIM_EXTENSION = False
30
31 # Whether the extension is marking the adoption of standardattr model for
32 # legacy resources, or introducing new standardattr attributes. False or
33 # None if the standardattr model is adopted since the introduction of
34 # resource extension.
35 # If this is True, the alias for the extension should be prefixed with
36 # 'standard-attr-'.
37 IS_STANDARD_ATTR_EXTENSION = False
38
39 # The name of the extension.
40 NAME = 'BGPVPN VXLAN VNI extension'
41
42 # A prefix for API resources. An empty prefix means that the API is going
43 # to be exposed at the v2/ level as any other core resource.
44 API_PREFIX = ''
45
46 # The description of the extension.
47 DESCRIPTION = "BGPVPN VXLAN VNI extension"
48
49 # A timestamp of when the extension was introduced.
50 UPDATED_TIMESTAMP = "2017-09-12T10:00:00-00:00"
51
52
53 RESOURCE_ATTRIBUTE_MAP = {
54 bgpvpn.COLLECTION_NAME: {
55 VNI: {'allow_post': True, 'allow_put': False,
56 'convert_to': lib_converters.convert_to_int_if_not_none,
57 'default': None,
58 'validate': {'type:range_or_none': [constants.MIN_VXLAN_VNI,
59 constants.MAX_VXLAN_VNI]
60 },
61 'is_visible': True, 'enforce_policy': True},
62 },
63 }
64
65 # The subresource attribute map for the extension. It adds child resources
66 # to main extension's resource. The subresource map must have a parent and
67 # a parameters entry. If an extension does not need such a map, None can
68 # be specified (mandatory).
69 SUB_RESOURCE_ATTRIBUTE_MAP = {}
70
71 # The action map: it associates verbs with methods to be performed on
72 # the API resource.
73 ACTION_MAP = {}
74
75 # The action status.
76 ACTION_STATUS = {
77 }
78
79 # The list of required extensions.
80 REQUIRED_EXTENSIONS = [bgpvpn.ALIAS]
81
82 # The list of optional extensions.
83 OPTIONAL_EXTENSIONS = []