Merge "Add policy description for instance actions"

This commit is contained in:
Jenkins
2017-05-04 19:27:55 +00:00
committed by Gerrit Code Review

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
@@ -23,12 +21,33 @@ POLICY_ROOT = 'os_compute_api:os-instance-actions:%s'
instance_actions_policies = [
policy.RuleDefault(
name=POLICY_ROOT % 'events',
check_str=base.RULE_ADMIN_API),
policy.RuleDefault(
name=BASE_POLICY_NAME,
check_str=base.RULE_ADMIN_OR_OWNER),
base.create_rule_default(
POLICY_ROOT % 'events',
base.RULE_ADMIN_API,
"""Add events details in action details for a server.
This check is performed only after the check
os_compute_api:os-instance-actions passes""",
[
{
'method': 'GET',
'path': '/servers/{server_id}/os-instance-actions/{request_id}'
}
]),
base.create_rule_default(
BASE_POLICY_NAME,
base.RULE_ADMIN_OR_OWNER,
"""List actions and show action details for a server.""",
[
{
'method': 'GET',
'path': '/servers/{server_id}/os-instance-actions'
},
{
'method': 'GET',
'path': '/servers/{server_id}/os-instance-actions/{request_id}'
}
]),
]