From 4d272c09f52da39664495dc80ac47a9fac80bc40 Mon Sep 17 00:00:00 2001 From: ghanshyam Date: Wed, 17 May 2017 10:39:23 +0300 Subject: [PATCH] Add policy description for server_usage This commit adds policy doc for server_usage policies. Partial implement blueprint policy-docs Change-Id: I50b32e58cef3ddba68ef471f2d9ad479e5593e01 --- nova/policies/server_usage.py | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/nova/policies/server_usage.py b/nova/policies/server_usage.py index 776af88f6c54..ac02ee2e97a0 100644 --- a/nova/policies/server_usage.py +++ b/nova/policies/server_usage.py @@ -13,8 +13,6 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_policy import policy - from nova.policies import base @@ -22,9 +20,27 @@ BASE_POLICY_NAME = 'os_compute_api:os-server-usage' server_usage_policies = [ - policy.RuleDefault( - name=BASE_POLICY_NAME, - check_str=base.RULE_ADMIN_OR_OWNER), + base.create_rule_default( + BASE_POLICY_NAME, + base.RULE_ADMIN_OR_OWNER, + """Add 'OS-SRV-USG:launched_at' & 'OS-SRV-USG:terminated_at' attribute +in the server response. + +This check is performed only after the check +'os_compute_api:servers:show' for GET /servers/{id} and +'os_compute_api:servers:detail' for GET /servers/detail passes""", + + + [ + { + 'method': 'GET', + 'path': '/servers/{id}' + }, + { + 'method': 'GET', + 'path': '/servers/detail' + } + ]), ]