From 5a8011f4f3fe28b555ceb24935003c513037c86d Mon Sep 17 00:00:00 2001 From: Anusha Unnam Date: Mon, 20 Mar 2017 23:05:26 +0000 Subject: [PATCH] Add description to policies in suspend_server.py The 'discoverable' policy is not documented as it will be removed in a future change. blueprint policy-docs Change-Id: Ie31ee38c6f36fae21c8b8b88ef6722f4a6e5aa6b --- nova/policies/suspend_server.py | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/nova/policies/suspend_server.py b/nova/policies/suspend_server.py index 5fe1ab81c1f0..39cda0964210 100644 --- a/nova/policies/suspend_server.py +++ b/nova/policies/suspend_server.py @@ -22,12 +22,26 @@ POLICY_ROOT = 'os_compute_api:os-suspend-server:%s' suspend_server_policies = [ - policy.RuleDefault( - name=POLICY_ROOT % 'resume', - check_str=base.RULE_ADMIN_OR_OWNER), - policy.RuleDefault( - name=POLICY_ROOT % 'suspend', - check_str=base.RULE_ADMIN_OR_OWNER), + base.create_rule_default( + POLICY_ROOT % 'resume', + base.RULE_ADMIN_OR_OWNER, + "Resume suspended server", + [ + { + 'method': 'POST', + 'path': '/servers/{server_id}/action (resume)' + } + ]), + base.create_rule_default( + POLICY_ROOT % 'suspend', + base.RULE_ADMIN_OR_OWNER, + "Suspend server", + [ + { + 'method': 'POST', + 'path': '/servers/{server_id}/action (suspend)' + } + ]), policy.RuleDefault( name=POLICY_ROOT % 'discoverable', check_str=base.RULE_ANY),