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(2017, 7, 3, 13, 54, 9, 168436))[source]¶ Bases:
object- 
ACTION_MAP= {‘NORMAL’: ‘OKActions’, ‘NODATA’: ‘InsufficientDataActions’, ‘ALARM’: ‘AlarmActions’}¶ 
- 
ALARM= ‘ALARM’¶ 
- 
CEILOMETER_CONTROLLED= ‘CEILOMETER_CONTROLLED’¶ 
- 
NODATA= ‘NODATA’¶ 
- 
NORMAL= ‘NORMAL’¶ 
- 
SUSPENDED= ‘SUSPENDED’¶ 
- 
WATCH_STATES= (‘ALARM’, ‘NORMAL’, ‘NODATA’, ‘SUSPENDED’, ‘CEILOMETER_CONTROLLED’)¶ 
- 
created_at= None¶ 
- 
classmethod 
load(context, watch_name=None, watch=None)[source]¶ Load the watchrule object.
The object can be loaded either from the DB by name or from an existing DB object.
- 
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¶ 
-