Coverage for watcher/common/policies/service.py: 100%
6 statements
« prev ^ index » next coverage.py v7.8.2, created at 2025-06-17 12:22 +0000
« prev ^ index » next coverage.py v7.8.2, created at 2025-06-17 12:22 +0000
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.
13from oslo_policy import policy
15from watcher.common.policies import base
17SERVICE = 'service:%s'
19rules = [
20 policy.DocumentedRuleDefault(
21 name=SERVICE % 'detail',
22 check_str=base.RULE_ADMIN_API,
23 description='List services with detail.',
24 operations=[
25 {
26 'path': '/v1/services/',
27 'method': 'GET'
28 }
29 ]
30 ),
31 policy.DocumentedRuleDefault(
32 name=SERVICE % 'get',
33 check_str=base.RULE_ADMIN_API,
34 description='Get a specific service.',
35 operations=[
36 {
37 'path': '/v1/services/{service_id}',
38 'method': 'GET'
39 }
40 ]
41 ),
42 policy.DocumentedRuleDefault(
43 name=SERVICE % 'get_all',
44 check_str=base.RULE_ADMIN_API,
45 description='List all services.',
46 operations=[
47 {
48 'path': '/v1/services/',
49 'method': 'GET'
50 }
51 ]
52 ),
53]
56def list_rules():
57 return rules