Alert
laktory.models.resources.databricks.Alert
¤
Bases: AlertBase
Databricks SQL Alert
Examples:
import io
from laktory import models
alert_yaml = '''
display_name: high-stock-price
parent_path: /alerts
query_id: ${resources.query-stock-prices.id}
condition:
op: GREATER_THAN
operand:
column:
name: close
threshold:
value:
double_value: 500.0
access_controls:
- group_name: account users
permission_level: CAN_VIEW
'''
alert = models.resources.databricks.Alert.model_validate_yaml(
io.StringIO(alert_yaml)
)
References
| BASE | DESCRIPTION |
|---|---|
condition
|
Trigger conditions of the alert. Block consists of the following attributes:
TYPE:
|
custom_body
|
Custom body of alert notification, if it exists. See Alerts API reference for custom templating instructions
TYPE:
|
custom_subject
|
Custom subject of alert notification, if it exists. This includes email subject, Slack notification header, etc. See Alerts API reference for custom templating instructions
TYPE:
|
display_name
|
Name of the alert
TYPE:
|
notify_on_ok
|
Whether to notify alert subscribers when alert returns back to normal
TYPE:
|
owner_user_name
|
Alert owner's username
TYPE:
|
query_id
|
ID of the query evaluated by the alert
TYPE:
|
seconds_to_retrigger
|
Number of seconds an alert must wait after being triggered to rearm itself. After rearming, it can be triggered again. If 0 or not specified, the alert will not be triggered again
TYPE:
|
| LAKTORY | DESCRIPTION |
|---|---|
access_controls
|
SQL Alert access controls
TYPE:
|
name_prefix
|
Prefix added to the alert display name
TYPE:
|
name_suffix
|
Suffix added to the alert display name
TYPE:
|
parent_path_
|
The path to a workspace folder (inside laktory root) containing the alert. If changed, the query will be recreated.
TYPE:
|
| ATTRIBUTE | DESCRIPTION |
|---|---|
additional_core_resources |
TYPE:
|
additional_core_resources
property
¤
- permissions
laktory.models.resources.databricks.alert.AlertCondition
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
empty_result_state
|
Alert state if the result is empty (
TYPE:
|
op
|
Operator used for comparison in alert evaluation. (Enum:
TYPE:
|
operand
|
Name of the column from the query result to use for comparison in alert evaluation:
TYPE:
|
threshold
|
Threshold value used for comparison in alert evaluation:
TYPE:
|
laktory.models.resources.databricks.alert.AlertConditionOperand
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
column
|
Block describing the column from the query result to use for comparison in alert evaluation:
TYPE:
|
laktory.models.resources.databricks.alert.AlertConditionOperandColumn
¤
laktory.models.resources.databricks.alert.AlertConditionThreshold
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
value
|
actual value used in comparison (one of the attributes is required):
TYPE:
|
laktory.models.resources.databricks.alert.AlertConditionThresholdValue
¤
Bases: BaseModel
| PARAMETER | DESCRIPTION |
|---|---|
bool_value
|
boolean value (
TYPE:
|
double_value
|
double value to compare against integer and double results
TYPE:
|
string_value
|
string value to compare against string results
TYPE:
|