Skip to content

Latest commit

 

History

History
488 lines (398 loc) · 18.3 KB

File metadata and controls

488 lines (398 loc) · 18.3 KB

AlarmRuleDefinition

tb_ce_client.models.AlarmRuleDefinition

Properties

Name Type Description Notes
id CalculatedFieldId JSON object with the Alarm Rule Id. Referencing non-existing Alarm Rule Id will cause error. [optional]
created_time int Timestamp of the alarm rule creation, in milliseconds [optional] [readonly]
tenant_id TenantId [optional]
entity_id EntityId [optional]
name str User defined name of the alarm rule. [optional]
debug_settings DebugSettings Debug settings object. [optional]
configuration_version int Version of alarm rule configuration. [optional]
configuration AlarmCalculatedFieldConfiguration
version int [optional]
additional_info object Additional parameters of the alarm rule. May include: 'description' (string). [optional]
debug_mode bool [optional]

Referenced Types

EntityId types (AdminSettingsId, AiModelId, AlarmId, ApiKeyId, ApiUsageStateId, AssetId, AssetProfileId, CalculatedFieldId, CustomerId, DashboardId, DeviceId, DeviceProfileId, DomainId, EdgeId, EntityViewId, JobId, MobileAppBundleId, MobileAppId, NotificationId, NotificationRequestId, NotificationRuleId, NotificationTargetId, NotificationTemplateId, OAuth2ClientId, OtaPackageId, QueueId, QueueStatsId, RpcId, RuleChainId, RuleNodeId, TbResourceId, TenantId, TenantProfileId, UserId, WidgetTypeId, WidgetsBundleId, etc.): {entity_type: EntityType, id: UUID} — all EntityId subtypes share this structure.

DebugSettings

Name Type Description Notes
failures_enabled bool Debug failures. [optional]
all_enabled bool Debug All. Used as a trigger for updating debugAllUntil. [optional]
all_enabled_until int Timestamp of the end time for the processing debug events. [optional]

EntityType (enum)

TENANT | CUSTOMER | USER | DASHBOARD | ASSET | DEVICE | ALARM | RULE_CHAIN | RULE_NODE | ENTITY_VIEW | … (36 values total)

CalculatedFieldConfiguration

Name Type Description Notes
output Output [optional]
type str

AlarmCalculatedFieldConfiguration (extends CalculatedFieldConfiguration, type=ALARM)

Name Type Description Notes
arguments Dict[str, Argument]
create_rules Dict[str, AlarmRule]
clear_rule AlarmRule [optional]
propagate bool [optional]
propagate_to_owner bool [optional]
propagate_to_tenant bool [optional]
propagate_relation_types List[str] [optional]

EntityAggregationCalculatedFieldConfiguration (extends CalculatedFieldConfiguration, type=ENTITY_AGGREGATION)

Name Type Description Notes
arguments Dict[str, Argument]
metrics Dict[str, AggMetric]
interval AggInterval
watermark Watermark [optional]
produce_intermediate_result bool [optional]

GeofencingCalculatedFieldConfiguration (extends CalculatedFieldConfiguration, type=GEOFENCING)

Name Type Description Notes
entity_coordinates EntityCoordinates
zone_groups Dict[str, ZoneGroupConfiguration]
scheduled_update_enabled bool [optional]
scheduled_update_interval int [optional]

PropagationCalculatedFieldConfiguration (extends CalculatedFieldConfiguration, type=PROPAGATION)

Name Type Description Notes
arguments Dict[str, Argument]
expression str [optional]
relation RelationPathLevel
apply_expression_to_resolved_arguments bool [optional]

RelatedEntitiesAggregationCalculatedFieldConfiguration (extends CalculatedFieldConfiguration, type=RELATED_ENTITIES_AGGREGATION)

Name Type Description Notes
relation RelationPathLevel
arguments Dict[str, Argument]
deduplication_interval_in_sec int [optional]
metrics Dict[str, AggMetric]
use_latest_ts bool [optional]
scheduled_update_interval int [optional]
scheduled_update_enabled bool [optional]

ScriptCalculatedFieldConfiguration (extends CalculatedFieldConfiguration, type=SCRIPT)

Name Type Description Notes
arguments Dict[str, Argument]
expression str [optional]

SimpleCalculatedFieldConfiguration (extends CalculatedFieldConfiguration, type=SIMPLE)

Name Type Description Notes
arguments Dict[str, Argument]
expression str [optional]
use_latest_ts bool [optional]

Argument

Name Type Description Notes
ref_entity_id EntityId [optional]
ref_dynamic_source_configuration CfArgumentDynamicSourceConfiguration [optional]
ref_entity_key ReferencedEntityKey [optional]
default_value str [optional]
limit int [optional]
time_window int [optional]

AlarmRule

Name Type Description Notes
condition AlarmCondition
alarm_details str [optional]
dashboard_id DashboardId [optional]

Output

Name Type Description Notes
decimals_by_default int [optional]
name str [optional]
scope AttributeScope [optional]
strategy object [optional]
type str

AttributesOutput (extends Output, type=ATTRIBUTES)

Name Type Description Notes
strategy AttributesOutputStrategy [optional]

TimeSeriesOutput (extends Output, type=TIME_SERIES)

Name Type Description Notes
strategy TimeSeriesOutputStrategy [optional]

CfArgumentDynamicSourceConfiguration

Name Type Description Notes
type str

CurrentOwnerDynamicSourceConfiguration (extends CfArgumentDynamicSourceConfiguration, type=CURRENT_OWNER)

See CfArgumentDynamicSourceConfiguration for properties.

RelationPathQueryDynamicSourceConfiguration (extends CfArgumentDynamicSourceConfiguration, type=RELATION_PATH_QUERY)

Name Type Description Notes
levels List[RelationPathLevel] [optional]

ReferencedEntityKey

Name Type Description Notes
key str [optional]
type ArgumentType [optional]
scope AttributeScope [optional]

AlarmCondition

Name Type Description Notes
expression AlarmConditionExpression
schedule AlarmConditionValueAlarmSchedule [optional]
type str

DurationAlarmCondition (extends AlarmCondition, type=DURATION)

Name Type Description Notes
unit TimeUnit
value AlarmConditionValueLong

RepeatingAlarmCondition (extends AlarmCondition, type=REPEATING)

Name Type Description Notes
count AlarmConditionValueInteger

SimpleAlarmCondition (extends AlarmCondition, type=SIMPLE)

See AlarmCondition for properties.

AttributeScope (enum)

CLIENT_SCOPE | SERVER_SCOPE | SHARED_SCOPE

EntityCoordinates

Name Type Description Notes
latitude_key_name str
longitude_key_name str

ZoneGroupConfiguration

Name Type Description Notes
ref_entity_id EntityId [optional]
ref_dynamic_source_configuration CfArgumentDynamicSourceConfiguration [optional]
perimeter_key_name str
report_strategy GeofencingReportStrategy
create_relations_with_matched_zones bool [optional]
relation_type str [optional]
direction EntitySearchDirection [optional]

RelationPathLevel

Name Type Description Notes
direction EntitySearchDirection
relation_type str

AggMetric

Name Type Description Notes
function AggFunction [optional]
filter str [optional]
input AggInput [optional]
default_value float [optional]

AggInterval

Name Type Description Notes
type str

CustomInterval (extends AggInterval, type=CUSTOM)

Name Type Description Notes
tz str
offset_sec int [optional]
duration_sec int

DayInterval (extends AggInterval, type=DAY)

Name Type Description Notes
tz str
offset_sec int [optional]

HourInterval (extends AggInterval, type=HOUR)

Name Type Description Notes
tz str
offset_sec int [optional]

MonthInterval (extends AggInterval, type=MONTH)

Name Type Description Notes
tz str
offset_sec int [optional]

QuarterInterval (extends AggInterval, type=QUARTER)

Name Type Description Notes
tz str
offset_sec int [optional]

WeekInterval (extends AggInterval, type=WEEK)

Name Type Description Notes
tz str
offset_sec int [optional]

WeekSunSatInterval (extends AggInterval, type=WEEK_SUN_SAT)

Name Type Description Notes
tz str
offset_sec int [optional]

YearInterval (extends AggInterval, type=YEAR)

Name Type Description Notes
tz str
offset_sec int [optional]

Watermark

Name Type Description Notes
duration int [optional]

ArgumentType (enum)

TS_LATEST | ATTRIBUTE | TS_ROLLING

AlarmConditionExpression

Name Type Description Notes
type str

SimpleAlarmConditionExpression (extends AlarmConditionExpression, type=SIMPLE)

Name Type Description Notes
filters List[AlarmConditionFilter]
operation AlarmRuleComplexOperation [optional]

TbelAlarmConditionExpression (extends AlarmConditionExpression, type=TBEL)

Name Type Description Notes
expression str

AlarmConditionValueAlarmSchedule

Name Type Description Notes
static_value AlarmSchedule [optional]
dynamic_value_argument str [optional]

TimeSeriesOutputStrategy

Name Type Description Notes
type str

TimeSeriesImmediateOutputStrategy (extends TimeSeriesOutputStrategy, type=IMMEDIATE)

Name Type Description Notes
ttl int [optional]
save_time_series bool [optional]
save_latest bool [optional]
send_ws_update bool [optional]
process_cfs bool [optional]

TimeSeriesRuleChainOutputStrategy (extends TimeSeriesOutputStrategy, type=RULE_CHAIN)

See TimeSeriesOutputStrategy for properties.

AttributesOutputStrategy

Name Type Description Notes
type str

AttributesImmediateOutputStrategy (extends AttributesOutputStrategy, type=IMMEDIATE)

Name Type Description Notes
send_attributes_updated_notification bool [optional]
update_attributes_only_on_value_change bool [optional]
save_attribute bool [optional]
send_ws_update bool [optional]
process_cfs bool [optional]

AttributesRuleChainOutputStrategy (extends AttributesOutputStrategy, type=RULE_CHAIN)

See AttributesOutputStrategy for properties.

GeofencingReportStrategy (enum)

REPORT_TRANSITION_EVENTS_ONLY | REPORT_PRESENCE_STATUS_ONLY | REPORT_TRANSITION_EVENTS_AND_PRESENCE_STATUS

EntitySearchDirection (enum)

FROM | TO

AggFunction (enum)

MIN | MAX | SUM | AVG | COUNT | COUNT_UNIQUE

AggInput

Name Type Description Notes
type str

AggFunctionInput (extends AggInput, type=function)

Name Type Description Notes
function str [optional]

AggKeyInput (extends AggInput, type=key)

Name Type Description Notes
key str [optional]

AlarmSchedule

Name Type Description Notes
type str

AnyTimeSchedule (extends AlarmSchedule, type=ANY_TIME)

See AlarmSchedule for properties.

CustomTimeSchedule (extends AlarmSchedule, type=CUSTOM)

Name Type Description Notes
timezone str [optional]
items List[CustomTimeScheduleItem] [optional]

SpecificTimeSchedule (extends AlarmSchedule, type=SPECIFIC_TIME)

Name Type Description Notes
timezone str [optional]
days_of_week List[int] [optional]
starts_on int [optional]
ends_on int [optional]

TimeUnit (enum)

NANOSECONDS | MICROSECONDS | MILLISECONDS | SECONDS | MINUTES | HOURS | DAYS

AlarmConditionValueLong

Name Type Description Notes
static_value int [optional]
dynamic_value_argument str [optional]

AlarmConditionValueInteger

Name Type Description Notes
static_value int [optional]
dynamic_value_argument str [optional]

AlarmConditionFilter

Name Type Description Notes
argument str
value_type EntityKeyValueType
operation AlarmRuleComplexOperation [optional]
predicates List[AlarmRuleKeyFilterPredicate]

AlarmRuleComplexOperation (enum)

AND | OR

EntityKeyValueType (enum)

STRING | NUMERIC | BOOLEAN | DATE_TIME

AlarmRuleKeyFilterPredicate

Name Type Description Notes
type str

AlarmRuleBooleanFilterPredicate (extends AlarmRuleKeyFilterPredicate, type=BOOLEAN)

Name Type Description Notes
operation AlarmRuleBooleanOperation
value AlarmConditionValueBoolean

AlarmRuleComplexFilterPredicate (extends AlarmRuleKeyFilterPredicate, type=COMPLEX)

Name Type Description Notes
operation AlarmRuleComplexOperation [optional]
predicates List[AlarmRuleKeyFilterPredicate] [optional]

NoDataFilterPredicate (extends AlarmRuleKeyFilterPredicate, type=NO_DATA)

Name Type Description Notes
unit TimeUnit
duration AlarmConditionValueLong

AlarmRuleNumericFilterPredicate (extends AlarmRuleKeyFilterPredicate, type=NUMERIC)

Name Type Description Notes
operation AlarmRuleNumericOperation
value AlarmConditionValueDouble

AlarmRuleStringFilterPredicate (extends AlarmRuleKeyFilterPredicate, type=STRING)

Name Type Description Notes
operation AlarmRuleStringOperation
value AlarmConditionValueString
ignore_case bool [optional]

CustomTimeScheduleItem

Name Type Description Notes
enabled bool [optional]
day_of_week int [optional]
starts_on int [optional]
ends_on int [optional]

AlarmRuleStringOperation (enum)

EQUAL | NOT_EQUAL | STARTS_WITH | ENDS_WITH | CONTAINS | NOT_CONTAINS | IN | NOT_IN

AlarmConditionValueString

Name Type Description Notes
static_value str [optional]
dynamic_value_argument str [optional]

AlarmRuleNumericOperation (enum)

EQUAL | NOT_EQUAL | GREATER | LESS | GREATER_OR_EQUAL | LESS_OR_EQUAL

AlarmConditionValueDouble

Name Type Description Notes
static_value float [optional]
dynamic_value_argument str [optional]

AlarmRuleBooleanOperation (enum)

EQUAL | NOT_EQUAL

AlarmConditionValueBoolean

Name Type Description Notes
static_value bool [optional]
dynamic_value_argument str [optional]

Conventions

  • Package: tb_ce_client.models
  • Attribute access: obj.id, obj.name, etc.
  • Serialize: obj.model_dump() or obj.model_dump(by_alias=True) for camelCase JSON
  • Deserialize: AlarmRuleDefinition.model_validate(data) or AlarmRuleDefinition.model_validate_json(json_str)
  • None fields: Optional attributes default to None; accessing them never raises exceptions