Alert
A legacy Databricks SQL alert. An alert runs a saved query, compares a column of the result against a threshold, and notifies its subscribers when the condition is met. See https://docs.databricks.com/aws/en/sql/user/alerts/legacy for details.
Alert object
A legacy Databricks SQL alert. An alert runs a saved query, compares a column of the result against a threshold, and notifies its subscribers when the condition is met. See https://docs.databricks.com/aws/en/sql/user/alerts/legacy for details.
- idstringIDImmutable
UUID identifying the alert.
- display_namestring
Display name of the alert, shown in list views and notifications. It must not be empty.
- query_idstring
UUID of the saved query whose result the alert evaluates. The caller must have permission to view the query.
- statestring
Current state of the alert's trigger status:
TRIGGEREDif the condition was met on the last evaluation,OKif it was not, andUNKNOWNif the alert has not yet been evaluated or ran into an error during the last evaluation.UNKNOWNOKTRIGGERED
- seconds_to_retriggerint32
Number of seconds the alert waits after a notification before it can notify again while its state stays
TRIGGERED. If 0 or not specified, the alert notifies once when its state changes toTRIGGEREDand does not notify again until its state has changed.
- lifecycle_statestring
Lifecycle state of the alert:
ACTIVE, orTRASHEDafter it has been moved to the trash.ACTIVETRASHED
- trigger_timestring
Timestamp when the alert was last triggered, if the alert has been triggered before.
- custom_bodystring
Custom body of the alert notification. It can use the template variables and HTML described at https://docs.databricks.com/aws/en/sql/user/alerts/legacy. If omitted, the default notification body is used.
- custom_subjectstring
Custom subject of the alert notification, used as the email subject or the Slack message header. It can use the template variables described at https://docs.databricks.com/aws/en/sql/user/alerts/legacy. If omitted, the default subject is used.
- conditionobject
Condition that triggers the alert: a column of the query result, a comparison operator, and a threshold value. The value in the first row of the column is evaluated; aggregations are not supported through this API.
Show child attributesHide child attributes
- opstring
Comparison operator applied between the operand column value and the threshold. The alert is triggered when the comparison is true.
IS_NULLtriggers when the column value is null; a threshold must still be supplied but its value is ignored.GREATER_THANGREATER_THAN_OR_EQUALLESS_THANLESS_THAN_OR_EQUALEQUALNOT_EQUALIS_NULL
- operandobject
Left-hand side of the comparison. Through this API it must be a
columnnaming a column of the query result; the value in the first row of that column is compared against the threshold.Show child attributesHide child attributes
- valueobject
A fixed value. Used for the
thresholdof a condition.Show child attributesHide child attributes
- string_valuestring
String threshold, for string or timestamp columns.
- double_valuedouble
Numeric threshold, for numeric columns.
- bool_valueboolean
Boolean threshold, for boolean columns.
- columnobject
A column of the query result. Used for the
operandof a condition.Show child attributesHide child attributes
- namestring
Name of the column in the query result.
- thresholdobject
Right-hand side of the comparison. Through this API it must be a fixed
valuewhose type matches the operand column.Show child attributesHide child attributes
- valueobject
A fixed value. Used for the
thresholdof a condition.Show child attributesHide child attributes
- string_valuestring
String threshold, for string or timestamp columns.
- double_valuedouble
Numeric threshold, for numeric columns.
- bool_valueboolean
Boolean threshold, for boolean columns.
- columnobject
A column of the query result. Used for the
operandof a condition.Show child attributesHide child attributes
- namestring
Name of the column in the query result.
- empty_result_statestring
State the alert takes when the query returns no rows. Defaults to
UNKNOWNwhen not set.UNKNOWNOKTRIGGERED
- owner_user_namestring
The owner's username. This field is set to "Unavailable" if the user has been deleted.
- parent_pathstring
Workspace path of the folder containing the alert. Defaults to the creator's home folder when omitted on create. It cannot be changed after creation.
- create_timestring
The timestamp indicating when the alert was created.
- update_timestring
The timestamp indicating when the alert was updated.
- notify_on_okboolean
Whether to notify subscribers when the alert state changes from
TRIGGEREDback toOK. Defaults to true.
Get an alert GA
GET
Gets an alert.
API scopes: sql
Parameters
- idstringRequiredpath
UUID of the alert to fetch.
Response
Returns the Alert object.
List alerts GA
GET
Gets a list of alerts accessible to the user, ordered by creation time. Warning: Calling this API concurrently 10 or more times could result in throttling, service degradation, or a temporary ban.
API scopes: sql
Parameters
- page_tokenstringquery
Token from the
next_page_tokenof a previous response. Omit it to fetch the first page.
- page_sizeint32<= 100query
Maximum number of alerts to return per page.
Response
- resultsarray of object
Alerts on this page.
Show child attributesHide child attributes
- idstringIDImmutable
UUID identifying the alert.
- display_namestring
Display name of the alert, shown in list views and notifications. It must not be empty.
- query_idstring
UUID of the saved query whose result the alert evaluates. The caller must have permission to view the query.
- statestring
Current state of the alert's trigger status:
TRIGGEREDif the condition was met on the last evaluation,OKif it was not, andUNKNOWNif the alert has not yet been evaluated or ran into an error during the last evaluation.UNKNOWNOKTRIGGERED
- seconds_to_retriggerint32
Number of seconds the alert waits after a notification before it can notify again while its state stays
TRIGGERED. If 0 or not specified, the alert notifies once when its state changes toTRIGGEREDand does not notify again until its state has changed.
- lifecycle_statestring
Lifecycle state of the alert:
ACTIVE, orTRASHEDafter it has been moved to the trash.ACTIVETRASHED
- trigger_timestring
Timestamp when the alert was last triggered, if the alert has been triggered before.
- custom_bodystring
Custom body of the alert notification. It can use the template variables and HTML described at https://docs.databricks.com/aws/en/sql/user/alerts/legacy. If omitted, the default notification body is used.
- custom_subjectstring
Custom subject of the alert notification, used as the email subject or the Slack message header. It can use the template variables described at https://docs.databricks.com/aws/en/sql/user/alerts/legacy. If omitted, the default subject is used.
- conditionobject
Condition that triggers the alert: a column of the query result, a comparison operator, and a threshold value. The value in the first row of the column is evaluated; aggregations are not supported through this API.
Show child attributesHide child attributes
- opstring
Comparison operator applied between the operand column value and the threshold. The alert is triggered when the comparison is true.
IS_NULLtriggers when the column value is null; a threshold must still be supplied but its value is ignored.GREATER_THANGREATER_THAN_OR_EQUALLESS_THANLESS_THAN_OR_EQUALEQUALNOT_EQUALIS_NULL
- operandobject
Left-hand side of the comparison. Through this API it must be a
columnnaming a column of the query result; the value in the first row of that column is compared against the threshold.Show child attributesHide child attributes
- valueobject
A fixed value. Used for the
thresholdof a condition.Show child attributesHide child attributes
- string_valuestring
String threshold, for string or timestamp columns.
- double_valuedouble
Numeric threshold, for numeric columns.
- bool_valueboolean
Boolean threshold, for boolean columns.
- columnobject
A column of the query result. Used for the
operandof a condition.Show child attributesHide child attributes
- namestring
Name of the column in the query result.
- thresholdobject
Right-hand side of the comparison. Through this API it must be a fixed
valuewhose type matches the operand column.Show child attributesHide child attributes
- valueobject
A fixed value. Used for the
thresholdof a condition.Show child attributesHide child attributes
- string_valuestring
String threshold, for string or timestamp columns.
- double_valuedouble
Numeric threshold, for numeric columns.
- bool_valueboolean
Boolean threshold, for boolean columns.
- columnobject
A column of the query result. Used for the
operandof a condition.Show child attributesHide child attributes
- namestring
Name of the column in the query result.
- empty_result_statestring
State the alert takes when the query returns no rows. Defaults to
UNKNOWNwhen not set.UNKNOWNOKTRIGGERED
- owner_user_namestring
The owner's username. This field is set to "Unavailable" if the user has been deleted.
- create_timestring
The timestamp indicating when the alert was created.
- update_timestring
The timestamp indicating when the alert was updated.
- notify_on_okboolean
Whether to notify subscribers when the alert state changes from
TRIGGEREDback toOK. Defaults to true.
- next_page_tokenstring
Token to pass as
page_tokento fetch the next page. Omitted when there are no more pages.
Create an alert GA
POST
Creates an alert.
API scopes: sql
Request body
- alertobject
The alert to create. A display name, a
query_id, and aconditionare required.Show child attributesHide child attributes
- display_namestring
Display name of the alert, shown in list views and notifications. It must not be empty.
- query_idstring
UUID of the saved query whose result the alert evaluates. The caller must have permission to view the query.
- seconds_to_retriggerint32
Number of seconds the alert waits after a notification before it can notify again while its state stays
TRIGGERED. If 0 or not specified, the alert notifies once when its state changes toTRIGGEREDand does not notify again until its state has changed.
- custom_bodystring
Custom body of the alert notification. It can use the template variables and HTML described at https://docs.databricks.com/aws/en/sql/user/alerts/legacy. If omitted, the default notification body is used.
- custom_subjectstring
Custom subject of the alert notification, used as the email subject or the Slack message header. It can use the template variables described at https://docs.databricks.com/aws/en/sql/user/alerts/legacy. If omitted, the default subject is used.
- conditionobject
Condition that triggers the alert: a column of the query result, a comparison operator, and a threshold value. The value in the first row of the column is evaluated; aggregations are not supported through this API.
Show child attributesHide child attributes
- opstring
Comparison operator applied between the operand column value and the threshold. The alert is triggered when the comparison is true.
IS_NULLtriggers when the column value is null; a threshold must still be supplied but its value is ignored.GREATER_THANGREATER_THAN_OR_EQUALLESS_THANLESS_THAN_OR_EQUALEQUALNOT_EQUALIS_NULL
- operandobject
Left-hand side of the comparison. Through this API it must be a
columnnaming a column of the query result; the value in the first row of that column is compared against the threshold.Show child attributesHide child attributes
- valueobject
A fixed value. Used for the
thresholdof a condition.Show child attributesHide child attributes
- string_valuestring
String threshold, for string or timestamp columns.
- double_valuedouble
Numeric threshold, for numeric columns.
- bool_valueboolean
Boolean threshold, for boolean columns.
- columnobject
A column of the query result. Used for the
operandof a condition.Show child attributesHide child attributes
- namestring
Name of the column in the query result.
- thresholdobject
Right-hand side of the comparison. Through this API it must be a fixed
valuewhose type matches the operand column.Show child attributesHide child attributes
- valueobject
A fixed value. Used for the
thresholdof a condition.Show child attributesHide child attributes
- string_valuestring
String threshold, for string or timestamp columns.
- double_valuedouble
Numeric threshold, for numeric columns.
- bool_valueboolean
Boolean threshold, for boolean columns.
- columnobject
A column of the query result. Used for the
operandof a condition.Show child attributesHide child attributes
- namestring
Name of the column in the query result.
- empty_result_statestring
State the alert takes when the query returns no rows. Defaults to
UNKNOWNwhen not set.UNKNOWNOKTRIGGERED
- parent_pathstring
Workspace path of the folder containing the alert. Defaults to the creator's home folder when omitted on create. It cannot be changed after creation.
- notify_on_okboolean
Whether to notify subscribers when the alert state changes from
TRIGGEREDback toOK. Defaults to true.
- auto_resolve_display_nameboolean
If true, automatically resolve alert display name conflicts. Otherwise, fail the request if the alert's display name conflicts with an existing alert's display name.
Response
Returns the Alert object.
Update an alert GA
PATCH
Updates the fields of an alert named in update_mask. Changing owner_user_name requires
workspace admin privileges; changing any other field requires CAN MANAGE permission on the alert.
API scopes: sql
Parameters
- idstringRequiredpath
UUID of the alert to update.
Request body
- alertobject
Alert fields to update. Only the fields named in
update_maskare changed.Show child attributesHide child attributes
- display_namestring
Display name of the alert, shown in list views and notifications. It must not be empty.
- query_idstring
UUID of the saved query whose result the alert evaluates. The caller must have permission to view the query.
- seconds_to_retriggerint32
Number of seconds the alert waits after a notification before it can notify again while its state stays
TRIGGERED. If 0 or not specified, the alert notifies once when its state changes toTRIGGEREDand does not notify again until its state has changed.
- custom_bodystring
Custom body of the alert notification. It can use the template variables and HTML described at https://docs.databricks.com/aws/en/sql/user/alerts/legacy. If omitted, the default notification body is used.
- custom_subjectstring
Custom subject of the alert notification, used as the email subject or the Slack message header. It can use the template variables described at https://docs.databricks.com/aws/en/sql/user/alerts/legacy. If omitted, the default subject is used.
- conditionobject
Condition that triggers the alert: a column of the query result, a comparison operator, and a threshold value. The value in the first row of the column is evaluated; aggregations are not supported through this API.
Show child attributesHide child attributes
- opstring
Comparison operator applied between the operand column value and the threshold. The alert is triggered when the comparison is true.
IS_NULLtriggers when the column value is null; a threshold must still be supplied but its value is ignored.GREATER_THANGREATER_THAN_OR_EQUALLESS_THANLESS_THAN_OR_EQUALEQUALNOT_EQUALIS_NULL
- operandobject
Left-hand side of the comparison. Through this API it must be a
columnnaming a column of the query result; the value in the first row of that column is compared against the threshold.Show child attributesHide child attributes
- valueobject
A fixed value. Used for the
thresholdof a condition.Show child attributesHide child attributes
- string_valuestring
String threshold, for string or timestamp columns.
- double_valuedouble
Numeric threshold, for numeric columns.
- bool_valueboolean
Boolean threshold, for boolean columns.
- columnobject
A column of the query result. Used for the
operandof a condition.Show child attributesHide child attributes
- namestring
Name of the column in the query result.
- thresholdobject
Right-hand side of the comparison. Through this API it must be a fixed
valuewhose type matches the operand column.Show child attributesHide child attributes
- valueobject
A fixed value. Used for the
thresholdof a condition.Show child attributesHide child attributes
- string_valuestring
String threshold, for string or timestamp columns.
- double_valuedouble
Numeric threshold, for numeric columns.
- bool_valueboolean
Boolean threshold, for boolean columns.
- columnobject
A column of the query result. Used for the
operandof a condition.Show child attributesHide child attributes
- namestring
Name of the column in the query result.
- empty_result_statestring
State the alert takes when the query returns no rows. Defaults to
UNKNOWNwhen not set.UNKNOWNOKTRIGGERED
- owner_user_namestring
The owner's username. This field is set to "Unavailable" if the user has been deleted.
- notify_on_okboolean
Whether to notify subscribers when the alert state changes from
TRIGGEREDback toOK. Defaults to true.
- update_maskstringRequired
Comma-separated list of the alert fields to update, such as
display_nameorcondition. Fields not listed keep their current values.
- auto_resolve_display_nameboolean
If true, automatically resolve alert display name conflicts. Otherwise, fail the request if the alert's display name conflicts with an existing alert's display name.
Response
Returns the Alert object.
Delete an alert GA
DELETE
Moves an alert to the trash. Trashed alerts immediately disappear from searches and list views, and can no longer trigger. You can restore a trashed alert through the UI. A trashed alert is permanently deleted after 30 days.
API scopes: sql
Parameters
- idstringRequiredpath
UUID of the alert to move to the trash.