Coverage for watcher/common/policies/data_model.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.8.2, created at 2025-06-17 12:22 +0000

1# Copyright 2019 ZTE Corporation. 

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 

15from oslo_policy import policy 

16 

17from watcher.common.policies import base 

18 

19DATA_MODEL = 'data_model:%s' 

20 

21rules = [ 

22 policy.DocumentedRuleDefault( 

23 name=DATA_MODEL % 'get_all', 

24 check_str=base.RULE_ADMIN_API, 

25 description='List data model.', 

26 operations=[ 

27 { 

28 'path': '/v1/data_model', 

29 'method': 'GET' 

30 } 

31 ] 

32 ), 

33] 

34 

35 

36def list_rules(): 

37 return rules