@@ -27,6 +27,8 @@ class RuleConfig(AsJson):
2727 - `tag_names`: A list of asset names that this rule should be applied to. ONLY VALID if defining rules outside of a telemetry config.
2828 - `contextual_channels`: A list of channel names that provide context but aren't directly used in the expression.
2929 - `is_external`: If this is an external rule.
30+ - `is_live`: If set to True then this rule will be evaluated on live data, otherwise live rule evaluation will be disabled.
31+ This rule can still be used, however, in report generation.
3032 """
3133
3234 name : str
@@ -38,6 +40,7 @@ class RuleConfig(AsJson):
3840 asset_names : List [str ]
3941 contextual_channels : List [str ]
4042 is_external : bool
43+ is_live : bool
4144 _rule_id : Optional [str ] # Allow passing of rule_id when existing config retrieved from API
4245
4346 def __init__ (
@@ -55,6 +58,7 @@ def __init__(
5558 sub_expressions : Dict [str , Any ] = {},
5659 contextual_channels : Optional [List [str ]] = None ,
5760 is_external : bool = False ,
61+ is_live : bool = False ,
5862 ):
5963 self .channel_references = _channel_references_from_dicts (channel_references )
6064 self .contextual_channels = contextual_channels or []
@@ -66,6 +70,7 @@ def __init__(
6670 self .description = description
6771 self .expression = self .__class__ .interpolate_sub_expressions (expression , sub_expressions )
6872 self .is_external = is_external
73+ self .is_live = is_live
6974 self ._rule_id = None
7075
7176 def as_json (self ) -> Any :
@@ -83,6 +88,7 @@ def as_json(self) -> Any:
8388 "description" : self .description ,
8489 "expression" : self .expression ,
8590 "is_external" : self .is_external ,
91+ "is_live" : self .is_live ,
8692 }
8793
8894 hash_map ["expression_channel_references" ] = self .channel_references
0 commit comments