Skip to content

Alert

laktory.models.resources.databricks.Alert ¤

Bases: BaseModel, PulumiResource, TerraformResource

Databricks SQL Query

ATTRIBUTE DESCRIPTION
access_controls

SQL Alert access controls

TYPE: list[AccessControl]

condition

Trigger conditions of the alert.

TYPE: AlertCondition

dirpath

Workspace directory inside rootpath in which the alert is deployed. Used only if parent_path is not specified.

TYPE: str

display_name

Name of the alert.

TYPE: str

query_id

ID of the query evaluated by the alert. Mutually exclusive with query.

TYPE: str

custom_body

Custom body of alert notification, if it exists. See Alerts API reference for custom templating instructions.

TYPE: str

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: str

name_prefix

Prefix added to the alert display name

TYPE: str

name_suffix

Suffix added to the alert display name

TYPE: str

notify_on_ok

Whether to notify alert subscribers when alert returns back to normal.

TYPE: bool

owner_user_name

Alert owner's username.

TYPE: str

parent_path

The path to a workspace folder containing the alert. Set to None to use user's home folder. Overwrite rootpath and dirpath. If changed, the alert will be recreated.

TYPE: str

rootpath

Root directory to which all alerts are deployed to. Can also be configured by settings LAKTORY_WORKSPACE_LAKTORY_ROOT environment variable. Default is /.laktory/. Used only if parent_path is not specified.

TYPE: str

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: int

Examples:

from laktory import models

alert = models.resources.databricks.Alert(
    display_name="My Alert",
    parent_path="/alerts",
    query_id="1",
    condition={
        "op": "GREATER_THAN",
        "operand": {"column": {"name": "value"}},
        "threshold": {"value": {"double_value": 42.0}},
    },
)
ATTRIBUTE DESCRIPTION
additional_core_resources
  • permissions

TYPE: list[PulumiResource]

Attributes¤

additional_core_resources property ¤

additional_core_resources
  • permissions

--

laktory.models.resources.databricks.alert.AlertCondition ¤

Bases: BaseModel

Alert Conditions

ATTRIBUTE DESCRIPTION
op

Operator used to compare in alert evaluation. (Enum: GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN, LESS_THAN_OR_EQUAL, EQUAL, NOT_EQUAL, IS_NULL)

TYPE: str

operand

Name of the column from the query result to use for comparison in alert evaluation.

TYPE: AlertConditionOperand

empty_result_state

Alert state if the result is empty (UNKNOWN, OK, TRIGGERED)

TYPE: str

threshold

Threshold value used for comparison in alert evaluation:

TYPE: AlertConditionThreshold

--

laktory.models.resources.databricks.alert.AlertConditionOperand ¤

Bases: BaseModel

ATTRIBUTE DESCRIPTION
column

Block describing the column from the query result to use for comparison in alert evaluation

TYPE: AlertConditionOperandColumn

--

laktory.models.resources.databricks.alert.AlertConditionThreshold ¤

Bases: BaseModel

ATTRIBUTE DESCRIPTION
value

Actual value used in comparison (one of the attributes is required)

TYPE: AlertConditionThresholdValue

--

laktory.models.resources.databricks.alert.AlertConditionOperandColumn ¤

Bases: BaseModel

ATTRIBUTE DESCRIPTION
name

Name of the column

TYPE: str

--

laktory.models.resources.databricks.alert.AlertConditionThresholdValue ¤

Bases: BaseModel

ATTRIBUTE DESCRIPTION
bool_value

boolean value (true or false) to compare against boolean results.

TYPE: bool

double_value

double value to compare against integer and double results.

TYPE: float

string_value

string value to compare against string results.

TYPE: str