Debian Codegraph @

networking_l2gw/policies/l2gw.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 import policy as base
14 from oslo_policy import policy
15
16
17 def list_rules():
18 return [
19 policy.DocumentedRuleDefault(
20 'create_l2_gateway',
21 base.RULE_ADMIN_ONLY,
22 'Create a L2 Gateway',
23 [
24 {
25 'method': 'POST',
26 'path': '/l2-gateways',
27 },
28 ]
29 ),
30 policy.DocumentedRuleDefault(
31 'update_l2_gateway',
32 base.RULE_ADMIN_ONLY,
33 'Update a L2 Gateway',
34 [
35 {
36 'method': 'PUT',
37 'path': '/l2-gateways/{id}',
38 },
39 ]
40 ),
41 policy.DocumentedRuleDefault(
42 'delete_l2_gateway',
43 base.RULE_ADMIN_ONLY,
44 'Delete a L2 Gateway',
45 [
46 {
47 'method': 'DELETE',
48 'path': '/l2-gateways/{id}',
49 },
50 ]
51 ),
52 policy.DocumentedRuleDefault(
53 'get_l2_gateways',
54 base.RULE_ADMIN_ONLY,
55 'Get a L2 Gateways',
56 [
57 {
58 'method': 'GET',
59 'path': '/l2-gateways',
60 },
61 ]
62 ),
63 policy.DocumentedRuleDefault(
64 'get_l2_gateway',
65 base.RULE_ADMIN_ONLY,
66 'Get a L2 Gateway',
67 [
68 {
69 'method': 'GET',
70 'path': '/l2-gateways/{id}',
71 },
72 ]
73 )
74 ]