Alerts

Package: databricks.bundles.alerts

Classes

class Aggregation
SUM = 'SUM'
COUNT = 'COUNT'
COUNT_DISTINCT = 'COUNT_DISTINCT'
AVG = 'AVG'
MEDIAN = 'MEDIAN'
MIN = 'MIN'
MAX = 'MAX'
STDDEV = 'STDDEV'
class Alert
display_name: str

The display name of the alert.

evaluation: AlertV2Evaluation
query_text: str

Text of the query to be run.

schedule: CronSchedule
warehouse_id: str

ID of the SQL warehouse attached to the alert.

custom_description: str | None = None

Custom description for the alert. support mustache template.

custom_summary: str | None = None

Custom summary for the alert. support mustache template.

file_path: str | None = None
lifecycle: Lifecycle | None = None

Settings that control the deployment lifecycle of the resource, such as preventing it from being destroyed.

parent_path: str | None = None

The workspace path of the folder containing the alert. Can only be set on create, and cannot be updated.

permissions: list[Permission]

The permissions to apply to this resource.

run_as: AlertV2RunAs | None = None

Specifies the identity that will be used to run the alert. This field allows you to configure alerts to run as a specific user or service principal. - For user identity: Set user_name to the email of an active workspace user. Users can only set this to their own email. - For service principal: Set service_principal_name to the application ID. Requires the servicePrincipal/user role. If not specified, the alert will run as the request user.

run_as_user_name: str | None = None

[DEPRECATED] The run as username or application ID of service principal. On Create and Update, this field can be set to application ID of an active service principal. Setting this field requires the servicePrincipal/user role. Deprecated: Use run_as field instead. This field will be removed in a future release.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class AlertEvaluationState

UNSPECIFIED - default unspecify value for proto enum, do not use it in the code UNKNOWN - alert not yet evaluated TRIGGERED - alert is triggered OK - alert is not triggered ERROR - alert evaluation failed

UNKNOWN = 'UNKNOWN'
TRIGGERED = 'TRIGGERED'
OK = 'OK'
ERROR = 'ERROR'
class AlertV2Evaluation
comparison_operator: ComparisonOperator

Operator used for comparison in alert evaluation.

source: AlertV2OperandColumn

Source column from result to use to evaluate alert

empty_result_state: AlertEvaluationState | None = None

Alert state if result is empty. Please avoid setting this field to be UNKNOWN because UNKNOWN state is planned to be deprecated.

notification: AlertV2Notification | None = None

User or Notification Destination to notify when alert is triggered.

threshold: AlertV2Operand | None = None

Threshold to user for alert evaluation, can be a column or a value.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class AlertV2Notification
notify_on_ok: bool | None = None

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

retrigger_seconds: int | None = None

Number of seconds an alert waits after being triggered before it is allowed to send another notification. If set to 0 or omitted, the alert will not send any further notifications after the first trigger Setting this value to 1 allows the alert to send a notification on every evaluation where the condition is met, effectively making it always retrigger for notification purposes.

subscriptions: list[AlertV2Subscription]
classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class AlertV2Operand
column: AlertV2OperandColumn | None = None
value: AlertV2OperandValue | None = None
classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class AlertV2OperandColumn
name: str
aggregation: Aggregation | None = None

If not set, the behavior is equivalent to using First row in the UI.

display: str | None = None
classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class AlertV2OperandValue
bool_value: bool | None = None
double_value: float | None = None
string_value: str | None = None
classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class AlertV2RunAs
service_principal_name: str | None = None

Application ID of an active service principal. Setting this field requires the servicePrincipal/user role.

user_name: str | None = None

The email of an active workspace user. Can only set this field to their own email.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class AlertV2Subscription
destination_id: str | None = None
user_email: str | None = None
classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class ComparisonOperator
LESS_THAN = 'LESS_THAN'
GREATER_THAN = 'GREATER_THAN'
EQUAL = 'EQUAL'
NOT_EQUAL = 'NOT_EQUAL'
GREATER_THAN_OR_EQUAL = 'GREATER_THAN_OR_EQUAL'
LESS_THAN_OR_EQUAL = 'LESS_THAN_OR_EQUAL'
IS_NULL = 'IS_NULL'
IS_NOT_NULL = 'IS_NOT_NULL'
class CronSchedule
quartz_cron_schedule: str

A cron expression using quartz syntax that specifies the schedule for this pipeline. Should use the quartz format described here: http://www.quartz-scheduler.org/documentation/quartz-2.1.7/tutorials/tutorial-lesson-06.html

timezone_id: str

A Java timezone id. The schedule will be resolved using this timezone. This will be combined with the quartz_cron_schedule to determine the schedule. See https://docs.databricks.com/sql/language-manual/sql-ref-syntax-aux-conf-mgmt-set-timezone.html for details.

pause_status: SchedulePauseStatus | None = None

Indicate whether this schedule is paused or not.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class Lifecycle
prevent_destroy: bool | None = None

Lifecycle setting to prevent the resource from being destroyed.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class Permission
level: PermissionLevel

The permission level to apply. The allowed levels depend on the resource type.

group_name: str | None = None

The name of the group granted the permission level.

service_principal_name: str | None = None

The name of the service principal granted the permission level.

user_name: str | None = None

The name of the user granted the permission level.

classmethod from_dict(
value: dict,
) → Self
as_dict(
self,
) → dict
class PermissionLevel

Permission level

CAN_MANAGE = 'CAN_MANAGE'
CAN_RESTART = 'CAN_RESTART'
CAN_ATTACH_TO = 'CAN_ATTACH_TO'
IS_OWNER = 'IS_OWNER'
CAN_MANAGE_RUN = 'CAN_MANAGE_RUN'
CAN_VIEW = 'CAN_VIEW'
CAN_READ = 'CAN_READ'
CAN_RUN = 'CAN_RUN'
CAN_EDIT = 'CAN_EDIT'
CAN_USE = 'CAN_USE'
CAN_MANAGE_STAGING_VERSIONS = 'CAN_MANAGE_STAGING_VERSIONS'
CAN_MANAGE_PRODUCTION_VERSIONS = 'CAN_MANAGE_PRODUCTION_VERSIONS'
CAN_EDIT_METADATA = 'CAN_EDIT_METADATA'
CAN_VIEW_METADATA = 'CAN_VIEW_METADATA'
CAN_BIND = 'CAN_BIND'
CAN_QUERY = 'CAN_QUERY'
CAN_MONITOR = 'CAN_MONITOR'
CAN_CREATE = 'CAN_CREATE'
CAN_MONITOR_ONLY = 'CAN_MONITOR_ONLY'
CAN_CREATE_APP = 'CAN_CREATE_APP'
class SchedulePauseStatus
UNPAUSED = 'UNPAUSED'
PAUSED = 'PAUSED'