The heat.engine.watchrule Module

class heat.engine.watchrule.WatchRule(context, watch_name, rule, stack_id=None, state='NODATA', wid=None, watch_data=[], last_evaluated=datetime.datetime(2013, 8, 8, 17, 37, 6, 837031))[source]

Bases: object

ACTION_MAP = {'ALARM': 'AlarmActions', 'NODATA': 'InsufficientDataActions', 'NORMAL': 'OKActions'}
ALARM = 'ALARM'
NODATA = 'NODATA'
NORMAL = 'NORMAL'
WATCH_STATES = ('ALARM', 'NORMAL', 'NODATA')
create_watch_data(data)[source]
created_at = None
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]
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

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

This Page