airflow.providers.slack.notifications.slack

属性

ICON_URL

send_slack_notification

SlackNotifier

Slack BaseNotifier。

模块内容

airflow.providers.slack.notifications.slack.ICON_URL: str = 'https://raw.githubusercontent.com/apache/airflow/main/airflow-core/src/airflow/ui/public/pin_100.png'[source]
class airflow.providers.slack.notifications.slack.SlackNotifier(*, slack_conn_id=SlackHook.default_conn_name, text='This is a default message', channel='#general', username='Airflow', icon_url=ICON_URL, attachments=(), blocks=(), base_url=None, proxy=None, timeout=None, retry_handlers=None, unfurl_links=True, unfurl_media=True)[source]

基类: airflow.providers.common.compat.notifier.BaseNotifier

Slack BaseNotifier。

参数
  • slack_conn_id (str) – Slack API 令牌 (https://api.slack.com/web)。

  • text (str) – 消息的内容

  • channel (str) – 发送消息的频道。可选

  • username (str) – 发送消息时使用的用户名。可选

  • icon_url (str) – 消息使用的图标。可选

  • blocks (collections.abc.Sequence) – 与消息一起发送的块列表。可选

  • timeout (int | None) – 客户端连接并接收 Slack 响应的最大等待秒数。可选

  • base_url (str | None) – 表示 Slack API 基本 URL 的字符串。可选

  • proxy (str | None) – 用于进行 Slack API 调用的代理。可选

  • retry_handlers (list[slack_sdk.http_retry.RetryHandler] | None) – 用于在 slack_sdk.WebClient 中自定义重试逻辑的处理程序列表。可选

  • attachments (collections.abc.Sequence) – (legacy) 与消息一起发送的附件列表。可选

  • unfurl_links (bool) – 指示文本 URL 是否应展开的选项。可选

  • unfurl_media (bool) – 指示媒体 URL 是否应展开的选项。可选

template_fields = ('text', 'channel', 'username', 'attachments', 'blocks')[source]
slack_conn_id = 'slack_api_default'[source]
text = 'This is a default message'[source]
channel = '#general'[source]
username = 'Airflow'[source]
icon_url = 'https://raw.githubusercontent.com/apache/airflow/main/airflow-core/src/airflow/ui/public/pin_100.png'[source]
attachments = ()[source]
blocks = ()[source]
base_url = None[source]
timeout = None[source]
proxy = None[source]
retry_handlers = None[source]
unfurl_media = True[source]
property hook: airflow.providers.slack.hooks.slack.SlackHook[source]

Slack Hook。

notify(context)[source]

发送消息到 Slack 频道。

airflow.providers.slack.notifications.slack.send_slack_notification[source]

此条目有帮助吗?