alerts_legacy
Creates, updates, deletes, gets or lists an alerts_legacy
resource.
Overview
Name | alerts_legacy |
Type | Resource |
Id | databricks_workspace.dbsql.alerts_legacy |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Alert was successfully fetched.
Name | Datatype | Description |
---|---|---|
id | string | |
name | string | |
created_at | string | |
last_triggered_at | string | |
options | object | |
parent | string | |
query | object | |
rearm | integer | |
state | string | |
updated_at | string | |
user | object |
List of alerts was successfully fetched.
Name | Datatype | Description |
---|---|---|
id | string | |
name | string | |
created_at | string | |
last_triggered_at | string | |
options | object | |
parent | string | |
query | object | |
rearm | integer | |
state | string | |
updated_at | string | |
user | object |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | deployment_name | Gets an alert. | |
list | select | deployment_name | Gets a list of alerts. | |
create | insert | deployment_name | Creates an alert. An alert is a Databricks SQL object that periodically runs a query, evaluates a condition of its result, and notifies users or notification destinations if the condition was met. | |
update | update | deployment_name | Updates an alert. | |
delete | delete | deployment_name | Deletes an alert. Deleted alerts are no longer accessible and cannot be restored. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
SELECT
examples
- get
- list
Gets an alert.
SELECT
id,
name,
created_at,
last_triggered_at,
options,
parent,
query,
rearm,
state,
updated_at,
user
FROM databricks_workspace.dbsql.alerts_legacy
WHERE deployment_name = '{{ deployment_name }}' -- required;
Gets a list of alerts.
SELECT
id,
name,
created_at,
last_triggered_at,
options,
parent,
query,
rearm,
state,
updated_at,
user
FROM databricks_workspace.dbsql.alerts_legacy
WHERE deployment_name = '{{ deployment_name }}' -- required;
INSERT
examples
- create
- Manifest
Creates an alert. An alert is a Databricks SQL object that periodically runs a query, evaluates a condition of its result, and notifies users or notification destinations if the condition was met.
INSERT INTO databricks_workspace.dbsql.alerts_legacy (
data__name,
data__query_id,
data__rearm,
data__parent,
data__options,
deployment_name
)
SELECT
'{{ name }}',
'{{ query_id }}',
'{{ rearm }}',
'{{ parent }}',
'{{ options }}',
'{{ deployment_name }}'
RETURNING
id,
name,
created_at,
last_triggered_at,
options,
parent,
query,
rearm,
state,
updated_at,
user
;
# Description fields are for documentation purposes
- name: alerts_legacy
props:
- name: deployment_name
value: string
description: Required parameter for the alerts_legacy resource.
- name: name
value: required
- name: query_id
value: string
- name: rearm
value: required
- name: parent
value: UUID
- name: options
value: object
UPDATE
examples
- update
Updates an alert.
UPDATE databricks_workspace.dbsql.alerts_legacy
SET
data__name = '{{ name }}',
data__query_id = '{{ query_id }}',
data__rearm = '{{ rearm }}',
data__options = '{{ options }}'
WHERE
deployment_name = '{{ deployment_name }}' --required;
DELETE
examples
- delete
Deletes an alert. Deleted alerts are no longer accessible and cannot be restored.
DELETE FROM databricks_workspace.dbsql.alerts_legacy
WHERE deployment_name = '{{ deployment_name }}' --required;