Add description to policies in extended_az and extend_ser_attrs

This updates the policy docs for extended_availability_zone.py and
extended_server_attributes.py

Partial implement blueprint policy-docs

Change-Id: I03848812da5a2848366f8ed6703fdae00330438d
This commit is contained in:
He Jie Xu 2017-05-02 11:11:20 +08:00 committed by John Garbutt
parent d6d5c6be0c
commit 4674965ac3
2 changed files with 40 additions and 10 deletions

View File

@ -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,20 @@ BASE_POLICY_NAME = 'os_compute_api:os-extended-availability-zone'
extended_availability_zone_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-EXT-AZ:availability_zone` into the server response.",
[
{
'method': 'GET',
'path': '/servers/{id}'
},
{
'method': 'GET',
'path': '/servers/detail'
}
]),
]

View File

@ -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,32 @@ BASE_POLICY_NAME = 'os_compute_api:os-extended-server-attributes'
extended_server_attributes_policies = [
policy.RuleDefault(
name=BASE_POLICY_NAME,
check_str=base.RULE_ADMIN_API),
base.create_rule_default(
BASE_POLICY_NAME,
base.RULE_ADMIN_API,
"""Return extended attributes for server.
This rule will control the visibility for a set of servers attributes:
OS-EXT-SRV-ATTR:host
OS-EXT-SRV-ATTR:instance_name
OS-EXT-SRV-ATTR:reservation_id (since microversion 2.3)
OS-EXT-SRV-ATTR:launch_index (since microversion 2.3)
OS-EXT-SRV-ATTR:hostname (since microversion 2.3)
OS-EXT-SRV-ATTR:kernel_id (since microversion 2.3)
OS-EXT-SRV-ATTR:ramdisk_id (since microversion 2.3)
OS-EXT-SRV-ATTR:root_device_name (since microversion 2.3)
OS-EXT-SRV-ATTR:user_data (since microversion 2.3)""",
[
{
'method': 'GET',
'path': '/servers/{id}'
},
{
'method': 'GET',
'path': '/servers/detail'
}
]
),
]