Implement policy in code (3)
This commit will move all default policies to code for: - telemetry:get_alarm_state - telemetry:change_alarm_state - telemetry:alarm_history - telemetry:query_alarm_history Change-Id: I78f7d723240a50cd9bb56b7a53dad7eb945c0850 Co-authored-By: Hieu LE <hieulq@vn.fujitsu.com>
This commit is contained in:
parent
84f27adcb8
commit
93d322c7c7
@ -100,6 +100,50 @@ rules = [
|
||||
'method': 'DELETE'
|
||||
}
|
||||
]
|
||||
),
|
||||
policy.DocumentedRuleDefault(
|
||||
name="telemetry:get_alarm_state",
|
||||
check_str=RULE_ADMIN_OR_OWNER,
|
||||
description='Get the state of this alarm.',
|
||||
operations=[
|
||||
{
|
||||
'path': '/v2/alarms/{alarm_id}/state',
|
||||
'method': 'GET'
|
||||
}
|
||||
]
|
||||
),
|
||||
policy.DocumentedRuleDefault(
|
||||
name="telemetry:change_alarm_state",
|
||||
check_str=RULE_ADMIN_OR_OWNER,
|
||||
description='Set the state of this alarm.',
|
||||
operations=[
|
||||
{
|
||||
'path': '/v2/alarms/{alarm_id}/state',
|
||||
'method': 'PUT'
|
||||
}
|
||||
]
|
||||
),
|
||||
policy.DocumentedRuleDefault(
|
||||
name="telemetry:alarm_history",
|
||||
check_str=RULE_ADMIN_OR_OWNER,
|
||||
description='Assembles the alarm history requested.',
|
||||
operations=[
|
||||
{
|
||||
'path': '/v2/alarms/{alarm_id}/history',
|
||||
'method': 'GET'
|
||||
}
|
||||
]
|
||||
),
|
||||
policy.DocumentedRuleDefault(
|
||||
name="telemetry:query_alarm_history",
|
||||
check_str=RULE_ADMIN_OR_OWNER,
|
||||
description='Define query for retrieving AlarmChange data.',
|
||||
operations=[
|
||||
{
|
||||
'path': '/v2/query/alarms/history',
|
||||
'method': 'POST'
|
||||
}
|
||||
]
|
||||
)
|
||||
]
|
||||
|
||||
|
@ -1,7 +0,0 @@
|
||||
{
|
||||
"telemetry:get_alarm_state": "rule:admin_or_owner",
|
||||
"telemetry:change_alarm_state": "rule:admin_or_owner",
|
||||
|
||||
"telemetry:alarm_history": "rule:admin_or_owner",
|
||||
"telemetry:query_alarm_history": "rule:admin_or_owner"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user