Merge "Add policy description for server_usage"
This commit is contained in:
commit
4d6ff4f835
|
@ -13,8 +13,6 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from oslo_policy import policy
|
|
||||||
|
|
||||||
from nova.policies import base
|
from nova.policies import base
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,9 +20,27 @@ BASE_POLICY_NAME = 'os_compute_api:os-server-usage'
|
||||||
|
|
||||||
|
|
||||||
server_usage_policies = [
|
server_usage_policies = [
|
||||||
policy.RuleDefault(
|
base.create_rule_default(
|
||||||
name=BASE_POLICY_NAME,
|
BASE_POLICY_NAME,
|
||||||
check_str=base.RULE_ADMIN_OR_OWNER),
|
base.RULE_ADMIN_OR_OWNER,
|
||||||
|
"""Add 'OS-SRV-USG:launched_at' & 'OS-SRV-USG:terminated_at' attribute
|
||||||
|
in the server response.
|
||||||
|
|
||||||
|
This check is performed only after the check
|
||||||
|
'os_compute_api:servers:show' for GET /servers/{id} and
|
||||||
|
'os_compute_api:servers:detail' for GET /servers/detail passes""",
|
||||||
|
|
||||||
|
|
||||||
|
[
|
||||||
|
{
|
||||||
|
'method': 'GET',
|
||||||
|
'path': '/servers/{id}'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'method': 'GET',
|
||||||
|
'path': '/servers/detail'
|
||||||
|
}
|
||||||
|
]),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue