diff --git a/aodh/api/policies.py b/aodh/api/policies.py index 28a1b7530..2f11c1476 100644 --- a/aodh/api/policies.py +++ b/aodh/api/policies.py @@ -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' + } + ] ) ] diff --git a/aodh/api/policy.json b/aodh/api/policy.json deleted file mode 100644 index f125cc0d1..000000000 --- a/aodh/api/policy.json +++ /dev/null @@ -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" -}