
from oslo_policy import policy

from nova.policies import base


BASE_POLICY_NAME = 'os_compute_api:os-fixed-ips'


fixed_ips_policies = [
    policy.RuleDefault(
        name=BASE_POLICY_NAME,
        check_str=base.RULE_ADMIN_API),
]


def list_rules():
    return fixed_ips_policies


from nova.policies import base


BASE_POLICY_NAME = 'os_compute_api:os-fixed-ips'


fixed_ips_policies = [
    base.create_rule_default(
        BASE_POLICY_NAME,
        base.RULE_ADMIN_API,
        """Shows details for, reserve and unreserve a fixed IP address.

These APIs are only available with nova-network which is deprecated.""",
        [
            {
                'method': 'GET',
                'path': '/os-fixed-ips/{fixed_ip}'
            },
            {
                'method': 'POST',
                'path': '/os-fixed-ips/{fixed_ip}/action (reserve)'
            },
            {
                'method': 'POST',
                'path': '/os-fixed-ips/{fixed_ip}/action (unreserve)'
            }
        ]),
]


def list_rules():
    return fixed_ips_policies

Add policy description for os-fixed-ips
Add policy description for os-fixed-ips

This commit adds policy doc for os-fixed-ips policies.

Partial implement blueprint policy-docs

Change-Id: Ief255af699cee217ebf963a2c36f9e819ef4ef90

- 
- from oslo_policy import policy
  
  from nova.policies import base
  
  
  BASE_POLICY_NAME = 'os_compute_api:os-fixed-ips'
  
  
  fixed_ips_policies = [
-     policy.RuleDefault(
+     base.create_rule_default(
-         name=BASE_POLICY_NAME,
+         BASE_POLICY_NAME,
-         check_str=base.RULE_ADMIN_API),
+         base.RULE_ADMIN_API,
+         """Shows details for, reserve and unreserve a fixed IP address.
+ 
+ These APIs are only available with nova-network which is deprecated.""",
+         [
+             {
+                 'method': 'GET',
+                 'path': '/os-fixed-ips/{fixed_ip}'
+             },
+             {
+                 'method': 'POST',
+                 'path': '/os-fixed-ips/{fixed_ip}/action (reserve)'
+             },
+             {
+                 'method': 'POST',
+                 'path': '/os-fixed-ips/{fixed_ip}/action (unreserve)'
+             }
+         ]),
  ]
  
  
  def list_rules():
      return fixed_ips_policies
  
Add policy description for os-fixed-ips
## Code Before:

from oslo_policy import policy

from nova.policies import base


BASE_POLICY_NAME = 'os_compute_api:os-fixed-ips'


fixed_ips_policies = [
    policy.RuleDefault(
        name=BASE_POLICY_NAME,
        check_str=base.RULE_ADMIN_API),
]


def list_rules():
    return fixed_ips_policies

## Instruction:
Add policy description for os-fixed-ips
## Code After:

from nova.policies import base


BASE_POLICY_NAME = 'os_compute_api:os-fixed-ips'


fixed_ips_policies = [
    base.create_rule_default(
        BASE_POLICY_NAME,
        base.RULE_ADMIN_API,
        """Shows details for, reserve and unreserve a fixed IP address.

These APIs are only available with nova-network which is deprecated.""",
        [
            {
                'method': 'GET',
                'path': '/os-fixed-ips/{fixed_ip}'
            },
            {
                'method': 'POST',
                'path': '/os-fixed-ips/{fixed_ip}/action (reserve)'
            },
            {
                'method': 'POST',
                'path': '/os-fixed-ips/{fixed_ip}/action (unreserve)'
            }
        ]),
]


def list_rules():
    return fixed_ips_policies
