The heat.engine.watchrule ModuleΒΆ
-
class
heat.engine.watchrule.WatchRule(context, watch_name, rule, stack_id=None, state='NODATA', wid=None, watch_data=None, last_evaluated=datetime.datetime(2015, 9, 14, 9, 41, 26, 238066))[source] Bases:
object-
ACTION_MAP= {'ALARM': 'AlarmActions', 'NODATA': 'InsufficientDataActions', 'NORMAL': 'OKActions'}
-
ALARM= 'ALARM'
-
CEILOMETER_CONTROLLED= 'CEILOMETER_CONTROLLED'
-
NODATA= 'NODATA'
-
NORMAL= 'NORMAL'
-
SUSPENDED= 'SUSPENDED'
-
WATCH_STATES= ('ALARM', 'NORMAL', 'NODATA', 'SUSPENDED', 'CEILOMETER_CONTROLLED')
-
create_watch_data(data)[source]
-
created_at= None
-
destroy()[source] Delete the watchrule from the database.
-
do_Average()[source]
-
do_Maximum()[source]
-
do_Minimum()[source]
-
do_SampleCount()[source] count all samples within the specified period
-
do_Sum()[source]
-
do_data_cmp(data, threshold)[source]
-
evaluate()[source]
-
get_alarm_state()[source]
-
get_details()[source]
-
classmethod
load(context, watch_name=None, watch=None)[source] Load the watchrule object, either by name or via an existing DB object
-
rule_actions(new_state)[source]
-
run_rule()[source]
-
set_watch_state(state)[source] Temporarily set the watch state, returns list of functions to be scheduled in the stack ThreadGroup for the specified state
-
state_set(state)[source] Persistently store the watch state
-
store()[source] Store the watchrule in the database and return its ID If self.id is set, we update the existing rule
-
updated_at= None
-
-
heat.engine.watchrule.rule_can_use_sample(wr, stats_data)[source]