summaryrefslogtreecommitdiff
path: root/nova/policies
diff options
context:
space:
mode:
authorghanshyam <ghanshyammann@gmail.com>2017-05-17 11:12:41 +0300
committerGhanshyam Mann <ghanshyammann@gmail.com>2017-05-30 08:24:47 +0000
commite8afd7167a4a1debab893cb59269364d3c4e3b58 (patch)
treeaa64244d30e420881f1388dd7e6b8a76abc1e184 /nova/policies
parent1a643bf934e5b113a61b0dc9f812e66f55f19769 (diff)
downloadnova-e8afd7167a4a1debab893cb59269364d3c4e3b58.tar.gz
Add policy description for os-networks
This commit adds policy doc for os-networks policies. Partial implement blueprint policy-docs Change-Id: I33d2bafb2ccfa97f9b4198f35fd2add3d99b9d1c
Diffstat (limited to 'nova/policies')
-rw-r--r--nova/policies/networks.py50
1 files changed, 42 insertions, 8 deletions
diff --git a/nova/policies/networks.py b/nova/policies/networks.py
index a4d065f47d..ff68cc7ea0 100644
--- a/nova/policies/networks.py
+++ b/nova/policies/networks.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
@@ -23,12 +21,48 @@ POLICY_ROOT = 'os_compute_api:os-networks:%s'
networks_policies = [
- policy.RuleDefault(
- name=BASE_POLICY_NAME,
- check_str=base.RULE_ADMIN_API),
- policy.RuleDefault(
- name=POLICY_ROOT % 'view',
- check_str=base.RULE_ADMIN_OR_OWNER),
+ base.create_rule_default(
+ BASE_POLICY_NAME,
+ base.RULE_ADMIN_API,
+ """Create and delete a network, add and disassociate a network
+from a project.
+
+These APIs are only available with nova-network which is deprecated.""",
+ [
+ {
+ 'method': 'POST',
+ 'path': '/os-networks'
+ },
+ {
+ 'method': 'POST',
+ 'path': '/os-networks/add'
+ },
+ {
+ 'method': 'DELETE',
+ 'path': '/os-networks/{network_id}'
+ },
+ {
+ 'method': 'POST',
+ 'path': '/os-networks/{network_id}/action (disassociate)'
+ }
+ ]),
+ base.create_rule_default(
+ POLICY_ROOT % 'view',
+ base.RULE_ADMIN_OR_OWNER,
+ """List networks for the project and show details for a network.
+
+These APIs are proxy calls to the Network service. These are all
+deprecated.""",
+ [
+ {
+ 'method': 'GET',
+ 'path': '/os-networks'
+ },
+ {
+ 'method': 'GET',
+ 'path': '/os-networks/{network_id}'
+ }
+ ]),
]