Add description to policies in hypervisors.py

blueprint policy-docs

Change-Id: Ie27ba40d8d5cfd811dc5a82f01fe9fa1e49e4ed6
Co-authored-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
Kevin_Zheng 2017-03-29 17:36:30 +08:00 committed by Zhenyu Zheng
parent 3cc34c2aa3
commit be7f40c92b
1 changed files with 45 additions and 3 deletions

View File

@ -26,9 +26,51 @@ hypervisors_policies = [
policy.RuleDefault(
name=POLICY_ROOT % 'discoverable',
check_str=base.RULE_ANY),
policy.RuleDefault(
name=BASE_POLICY_NAME,
check_str=base.RULE_ADMIN_API),
base.create_rule_default(
BASE_POLICY_NAME,
base.RULE_ADMIN_API,
"""Policy rule for hypervisor related APIs.
This rule will be checked for the following APIs:
List all hypervisors, list all hypervisors with details, show
summary statistics for all hypervisors over all compute nodes,
show details for a hypervisor, show the uptime of a hypervisor,
search hypervisor by hypervisor_hostname pattern and list all
servers on hypervisors that can match the provided hypervisor_hostname
pattern.""",
[
{
'path': '/os-hypervisors',
'method': 'GET'
},
{
'path': '/os-hypervisors/details',
'method': 'GET'
},
{
'path': '/os-hypervisors/statistics',
'method': 'GET'
},
{
'path': '/os-hypervisors/{hypervisor_id}',
'method': 'GET'
},
{
'path': '/os-hypervisors/{hypervisor_id}/uptime',
'method': 'GET'
},
{
'path': '/os-hypervisors/{hypervisor_hostname_pattern}/search',
'method': 'GET'
},
{
'path':
'/os-hypervisors/{hypervisor_hostname_pattern}/servers',
'method': 'GET'
}
]
),
]