From 62b2b670a239872666dd3d18ebbb80606b78ad9f Mon Sep 17 00:00:00 2001 From: ghanshyam Date: Wed, 17 May 2017 10:53:02 +0300 Subject: [PATCH] Add policy description for networks_associate This commit adds policy doc for networks_associate policies. Partial implement blueprint policy-docs Change-Id: I7c38b068ca2264470a211f8121fdb55dede1fdfd --- nova/policies/networks_associate.py | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/nova/policies/networks_associate.py b/nova/policies/networks_associate.py index b9e37b483940..bcf5b95148ce 100644 --- a/nova/policies/networks_associate.py +++ b/nova/policies/networks_associate.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-networks-associate' networks_associate_policies = [ - policy.RuleDefault( - name=BASE_POLICY_NAME, - check_str=base.RULE_ADMIN_API), + base.create_rule_default( + BASE_POLICY_NAME, + base.RULE_ADMIN_API, + """Associates and Disassociates a network from a host or project. + +These APIs are only available with nova-network which is deprecated.""", + [ + { + 'method': 'POST', + 'path': '/os-networks/{network_id}/action (disassociate_host)' + }, + { + 'method': 'POST', + 'path': '/os-networks/{network_id}/action' + ' (disassociate_project)' + }, + { + 'method': 'POST', + 'path': '/os-networks/{network_id}/action (associate_host)' + } + ]), ]