Debian Codegraph @

neutron_lib/services/constants.py

raw
1 # All Rights Reserved.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"); you may
4 # not use this file except in compliance with the License. You may obtain
5 # a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 # License for the specific language governing permissions and limitations
13 # under the License.
14
15 from neutron_lib.api.definitions import l3
16 from neutron_lib.api.definitions import local_ip
17 from neutron_lib.api.definitions import qos
18 from neutron_lib.plugins import constants as plugin_const
19
20
21 # Registered extension parent resource check mapping
22 # If we want to register some service plugin resources into policy and check
23 # the owner when operating their subresources. We can write here to use
24 # existing policy engine for parent resource owner check.
25 # Each entry here should be PARENT_RESOURCE_NAME: SERVICE_PLUGIN_NAME,
26 # PARENT_RESOURCE_NAME is usually from api definition.
27 # SERVICE_PLUGIN_NAME is the service plugin which introduced the resource and
28 # registered the service plugin name in neutron-lib.
29 EXT_PARENT_RESOURCE_MAPPING = {
30 l3.FLOATINGIP: plugin_const.L3,
31 l3.ROUTER: plugin_const.CONNTRACKHELPER,
32 local_ip.RESOURCE_NAME: plugin_const.LOCAL_IP,
33 qos.POLICY: plugin_const.QOS,
34 }