snowflake.core.alert.AlertResourceΒΆ

class snowflake.core.alert.AlertResource(name: Annotated[str, Strict(strict=True)], collection: AlertCollection)ΒΆ

Bases: SchemaObjectReferenceMixin[AlertCollection]

Represents a reference to a Snowflake Alert resource.

With this alert reference, you can create, update, delete, and fetch information about alerts, as well as perform certain actions on them.

Attributes

databaseΒΆ
fully_qualified_nameΒΆ
rootΒΆ

Methods

drop(if_exists: bool | None = False) β†’ NoneΒΆ

Drop this alert.

Parameters:

if_exists (bool, optional) – Check the existence of this alert before drop. The default value is False.

Examples

Deleting an alert using its reference:

>>> alert_reference.drop()
Copy

Deleting an alert using its reference if it exists:

>>> alert_reference.drop(if_exists=True)
Copy
execute() β†’ NoneΒΆ

Execute an alert.

Examples

Use an alert reference to execute it:

>>> alert_reference.execute()
Copy
fetch() β†’ AlertΒΆ

Fetch the details of an alert.

Examples

Fetching an alert reference to print its name and query properties:

>>> my_alert = alert_reference.fetch()
>>> print(my_alert.name, my_alert.condition, my_alert.action)
Copy