From a36253b24cfe80ac2bf74f129ad7cc3d7d3a7f66 Mon Sep 17 00:00:00 2001 From: Anusha Unnam Date: Fri, 24 Mar 2017 17:21:22 +0000 Subject: [PATCH] Add description to policies in simple_tenant_usage.py The 'discoverable' policy is not documented as it will be removed in a future change. blueprint policy-docs Change-Id: I9373f5af135c7cea9369a0d157aaf5bf9491be57 --- nova/policies/simple_tenant_usage.py | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/nova/policies/simple_tenant_usage.py b/nova/policies/simple_tenant_usage.py index 70b64c56cfe..ffd66d4e1f4 100644 --- a/nova/policies/simple_tenant_usage.py +++ b/nova/policies/simple_tenant_usage.py @@ -22,12 +22,26 @@ simple_tenant_usage_policies = [ - policy.RuleDefault( - name=POLICY_ROOT % 'show', - check_str=base.RULE_ADMIN_OR_OWNER), - policy.RuleDefault( - name=POLICY_ROOT % 'list', - check_str=base.RULE_ADMIN_API), + base.create_rule_default( + POLICY_ROOT % 'show', + base.RULE_ADMIN_OR_OWNER, + "Show usage statistics for a specific tenant.", + [ + { + 'method': 'GET', + 'path': '/os-simple-tenant-usage/{tenant_id}' + } + ]), + base.create_rule_default( + POLICY_ROOT % 'list', + base.RULE_ADMIN_API, + "List per tenant usage statistics for all tenants.", + [ + { + 'method': 'GET', + 'path': '/os-simple-tenant-usage' + } + ]), policy.RuleDefault( name=POLICY_ROOT % 'discoverable', check_str=base.RULE_ANY),