Merge "Introduce scope_types in os-attach-interfaces"

This commit is contained in:
Zuul
2020-03-06 11:50:05 +00:00
committed by Gerrit Code Review
+19 -16
View File
@@ -24,11 +24,11 @@ POLICY_ROOT = 'os_compute_api:os-attach-interfaces:%s'
attach_interfaces_policies = [
policy.DocumentedRuleDefault(
BASE_POLICY_NAME,
base.RULE_ADMIN_OR_OWNER,
"List port interfaces or show details of a port interface attached "
"to a server",
[
name=BASE_POLICY_NAME,
check_str=base.RULE_ADMIN_OR_OWNER,
description="List port interfaces or show details of a port interface "
"attached to a server",
operations=[
{
'method': 'GET',
'path': '/servers/{server_id}/os-interface'
@@ -37,27 +37,30 @@ attach_interfaces_policies = [
'method': 'GET',
'path': '/servers/{server_id}/os-interface/{port_id}'
}
]),
],
scope_types=['system', 'project']),
policy.DocumentedRuleDefault(
POLICY_ROOT % 'create',
base.RULE_ADMIN_OR_OWNER,
"Attach an interface to a server",
[
name=POLICY_ROOT % 'create',
check_str=base.RULE_ADMIN_OR_OWNER,
description="Attach an interface to a server",
operations=[
{
'method': 'POST',
'path': '/servers/{server_id}/os-interface'
}
]),
],
scope_types=['system', 'project']),
policy.DocumentedRuleDefault(
POLICY_ROOT % 'delete',
base.RULE_ADMIN_OR_OWNER,
"Detach an interface from a server",
[
name=POLICY_ROOT % 'delete',
check_str=base.RULE_ADMIN_OR_OWNER,
description="Detach an interface from a server",
operations=[
{
'method': 'DELETE',
'path': '/servers/{server_id}/os-interface/{port_id}'
}
])
],
scope_types=['system', 'project'])
]