diff --git a/heat/engine/resources/ceilometer/alarm.py b/heat/engine/resources/ceilometer/alarm.py index 5a2a19d03..60a2aeab2 100644 --- a/heat/engine/resources/ceilometer/alarm.py +++ b/heat/engine/resources/ceilometer/alarm.py @@ -78,6 +78,15 @@ class CeilometerAlarm(resource.Resource): 'Default': 'true', 'Description': _('True if alarm evaluation/actioning is enabled') }, + 'repeat_actions': { + 'Type': 'Boolean', + 'Default': 'false', + 'Description': _('True to trigger actions each time the threshold ' + 'is reached. ' + 'By default, actions are called when : ' + 'the threshold is reached AND the alarm\'s state ' + 'have changed') + }, 'matching_metadata': { 'Type': 'Map', 'Description': _('Counter should match this resource metadata ' @@ -93,12 +102,13 @@ class CeilometerAlarm(resource.Resource): 'evaluation_periods', 'period', 'statistic', 'alarm_actions', 'ok_actions', 'insufficient_data_actions', 'threshold', - 'enabled') + 'enabled', 'repeat_actions') def _actions_to_urls(self, props): kwargs = {} for k, v in iter(props.items()): - if k.endswith('_actions') and v is not None: + if k in ['alarm_actions', 'ok_actions', + 'insufficient_data_actions'] and v is not None: kwargs[k] = [] for act in v: # if the action is a resource name diff --git a/heat/tests/test_ceilometer_alarm.py b/heat/tests/test_ceilometer_alarm.py index 2a892fb3a..21e873d97 100644 --- a/heat/tests/test_ceilometer_alarm.py +++ b/heat/tests/test_ceilometer_alarm.py @@ -157,6 +157,7 @@ class CeilometerAlarmTest(HeatTestCase): snippet['Properties']['evaluation_periods'] = '2' snippet['Properties']['period'] = '90' snippet['Properties']['enabled'] = 'true' + snippet['Properties']['repeat_actions'] = True snippet['Properties']['statistic'] = 'max' snippet['Properties']['threshold'] = '39' snippet['Properties']['insufficient_data_actions'] = [] diff --git a/requirements.txt b/requirements.txt index 0a38879f9..e32ba9be2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,7 +18,7 @@ WebOb>=1.2.3,<1.3 python-keystoneclient>=0.3.2 python-swiftclient>=1.2 python-neutronclient>=2.3.0,<3 -python-ceilometerclient>=1.0.2 +python-ceilometerclient>=1.0.3 python-cinderclient>=1.0.4 PyYAML>=3.1.0 paramiko>=1.8.0