Fix policy doc for host_status and extended servers attribute

In microversion 2.75, host_status and extended-server-attributes
were added in PUT /servers/{server-id} and POST /servers/action {rebuild }
API response with respective policy enforcement[1].

But PUT and rebuild APIs were missed to mentioned in policy doc
for 'os_compute_api:servers:show:host_status'
'os_compute_api:os-extended-server-attributes'

- https://docs.openstack.org/nova/latest/configuration/policy.html

Closes-Bug: #1849164

[1]
964d7dc879/nova/api/openstack/compute/servers.py (L854)

964d7dc879/nova/api/openstack/compute/servers.py (L1161)

Change-Id: Ifac1e60f5c8d9c5e3a0a9dacc398c339c2216689
This commit is contained in:
Ghanshyam Mann
2019-10-21 16:12:36 +00:00
committed by Matt Riedemann
parent b2122f7702
commit 4722fe5ba5
2 changed files with 28 additions and 1 deletions

View File

@@ -38,6 +38,10 @@ This rule will control the visibility for a set of servers attributes:
- ``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)
Microvision 2.75 added the above attributes in the ``PUT /servers/{server_id}``
and ``POST /servers/{server_id}/action (rebuild)`` API responses which are
also controlled by this policy rule, like the ``GET /servers*`` APIs.
""",
[
{
@@ -47,6 +51,14 @@ This rule will control the visibility for a set of servers attributes:
{
'method': 'GET',
'path': '/servers/detail'
},
{
'method': 'PUT',
'path': '/servers/{server_id}'
},
{
'method': 'POST',
'path': '/servers/{server_id}/action (rebuild)'
}
]
),

View File

@@ -92,7 +92,14 @@ rules = [
policy.DocumentedRuleDefault(
SERVERS % 'show:host_status',
base.RULE_ADMIN_API,
"Show a server with additional host status information",
"""
Show a server with additional host status information.
Microvision 2.75 added the ``host_status`` attribute in the
``PUT /servers/{server_id}`` and ``POST /servers/{server_id}/action (rebuild)``
API responses which are also controlled by this policy rule, like the
``GET /servers*`` APIs.
""",
[
{
'method': 'GET',
@@ -101,6 +108,14 @@ rules = [
{
'method': 'GET',
'path': '/servers/detail'
},
{
'method': 'PUT',
'path': '/servers/{server_id}'
},
{
'method': 'POST',
'path': '/servers/{server_id}/action (rebuild)'
}
]),
policy.DocumentedRuleDefault(