]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Document ceilometer alarm properties
authorBartosz Górski <bartosz.gorski@ntti3.com>
Thu, 12 Sep 2013 22:47:40 +0000 (15:47 -0700)
committerBartosz Górski <bartosz.gorski@ntti3.com>
Tue, 17 Sep 2013 00:16:15 +0000 (17:16 -0700)
This adds descriptions to the properties of OS::Ceilometer::Alarm.

Change-Id: I3851c8785c0bd94aae6412e75a02ee98ce13478b
Closes-Bug: #1224162

heat/engine/resources/ceilometer/alarm.py

index 487a56b75faa8047af358c3006742fd0700d921c..5a2a19d0383f748dfd59f03398e2d2aae8567e89 100644 (file)
@@ -20,37 +20,70 @@ from heat.engine import watchrule
 
 class CeilometerAlarm(resource.Resource):
 
-    properties_schema = {'comparison_operator': {'Type': 'String',
-                                                 'Required': True,
-                                                 'AllowedValues': ['ge',
-                                                                   'gt',
-                                                                   'eq',
-                                                                   'ne',
-                                                                   'lt',
-                                                                   'le']},
-                         'evaluation_periods': {'Type': 'String',
-                                                'Required': True},
-                         'counter_name': {'Type': 'String',
-                                          'Required': True},
-                         'period': {'Type': 'String',
-                                    'Required': True},
-                         'statistic': {'Type': 'String',
-                                       'Required': True,
-                                       'AllowedValues': ['count',
-                                                         'avg',
-                                                         'sum',
-                                                         'min',
-                                                         'max']},
-                         'threshold': {'Type': 'String',
-                                       'Required': True},
-                         'alarm_actions': {'Type': 'List'},
-                         'ok_actions': {'Type': 'List'},
-                         'insufficient_data_actions': {'Type': 'List'},
-                         'description': {'Type': 'String'},
-                         'source': {'Type': 'String'},
-                         'enabled': {'Type': 'Boolean',
-                                     'Default': 'true'},
-                         'matching_metadata': {'Type': 'Map'}}
+    properties_schema = {
+        'comparison_operator': {
+            'Type': 'String',
+            'Required': True,
+            'AllowedValues': ['ge', 'gt', 'eq', 'ne', 'lt', 'le'],
+            'Description': _('Operator used to compare specified statistic '
+                             'with threshold')
+        },
+        'evaluation_periods': {
+            'Type': 'String',
+            'Required': True,
+            'Description': _('Number of periods to evaluate over')
+        },
+        'counter_name': {
+            'Type': 'String',
+            'Required': True,
+            'Description': _('Counter name watched by the alarm')
+        },
+        'period': {
+            'Type': 'String',
+            'Required': True,
+            'Description': _('Period (seconds) to evaluate over')
+        },
+        'statistic': {
+            'Type': 'String',
+            'Required': True,
+            'AllowedValues': ['count', 'avg', 'sum', 'min', 'max'],
+            'Description': _('Counter statistic to evaluate')
+        },
+        'threshold': {
+            'Type': 'String',
+            'Required': True,
+            'Description': _('Threshold to evaluate against')
+        },
+        'alarm_actions': {
+            'Type': 'List',
+            'Description': _('A list of URLs (webhooks) to invoke when state '
+                             'transitions to alarm')
+        },
+        'ok_actions': {
+            'Type': 'List',
+            'Description': _('A list of URLs (webhooks) to invoke when state '
+                             'transitions to ok')
+        },
+        'insufficient_data_actions': {
+            'Type': 'List',
+            'Description': _('A list of URLs (webhooks) to invoke when state '
+                             'transitions to insufficient-data')
+        },
+        'description': {
+            'Type': 'String',
+            'Description': _('Description for the alarm')
+        },
+        'enabled': {
+            'Type': 'Boolean',
+            'Default': 'true',
+            'Description': _('True if alarm evaluation/actioning is enabled')
+        },
+        'matching_metadata': {
+            'Type': 'Map',
+            'Description': _('Counter should match this resource metadata '
+                             '(key=value) additionally to the counter_name')
+        }
+    }
 
     update_allowed_keys = ('Properties',)
     # allow the properties that affect the watch calculation.