Debian Codegraph @

neutron_lib/api/definitions/subnet_segmentid_enforce.py

raw
1 # Copyright 2018 AT&T 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
16 import copy
17
18 from neutron_lib.api.definitions import segment
19 from neutron_lib.api.definitions import subnet
20 from neutron_lib.api.definitions import subnet_segmentid_writable
21
22
23 # The alias of the extension.
24 ALIAS = 'subnet-segmentid-enforce'
25
26 # Whether or not this extension is simply signaling behavior to the user
27 # or it actively modifies the attribute map.
28 IS_SHIM_EXTENSION = False
29
30 # Whether the extension is marking the adoption of standardattr model for
31 # legacy resources, or introducing new standardattr attributes. False or
32 # None if the standardattr model is adopted since the introduction of
33 # resource extension.
34 # If this is True, the alias for the extension should be prefixed with
35 # 'standard-attr-'.
36 IS_STANDARD_ATTR_EXTENSION = False
37
38 # The name of the extension.
39 NAME = 'Subnet SegmentID (policy enforced)'
40
41 # A prefix for API resources. An empty prefix means that the API is going
42 # to be exposed at the v2/ level as any other core resource.
43 API_PREFIX = ''
44
45 # The description of the extension.
46 DESCRIPTION = "Enforce segment_id policy rule."
47
48 # A timestamp of when the extension was introduced.
49 UPDATED_TIMESTAMP = "2018-09-04T00:00:00-00:00"
50
51 segment_id_attr_info = copy.deepcopy(
52 subnet_segmentid_writable.RESOURCE_ATTRIBUTE_MAP[
53 subnet.COLLECTION_NAME][segment.SEGMENT_ID])
54 segment_id_attr_info['enforce_policy'] = True
55
56 RESOURCE_ATTRIBUTE_MAP = {
57 subnet.COLLECTION_NAME: {
58 segment.SEGMENT_ID: segment_id_attr_info
59 }
60 }
61
62 # The subresource attribute map for the extension. It adds child resources
63 # to main extension's resource. The subresource map must have a parent and
64 # a parameters entry. If an extension does not need such a map, None can
65 # be specified (mandatory).
66 SUB_RESOURCE_ATTRIBUTE_MAP = {}
67
68 # The action map: it associates verbs with methods to be performed on
69 # the API resource.
70 ACTION_MAP = {}
71
72 # The action status.
73 ACTION_STATUS = {}
74
75 # The list of required extensions.
76 REQUIRED_EXTENSIONS = [subnet_segmentid_writable.ALIAS]
77
78 # The list of optional extensions.
79 OPTIONAL_EXTENSIONS = []