airflow.providers.apprise.hooks.apprise¶
类¶
使用 Apprise(https://github.com/caronc/apprise) 与通知服务进行交互。 |
模块内容¶
- class airflow.providers.apprise.hooks.apprise.AppriseHook(apprise_conn_id=default_conn_name)[source]¶
Bases:
airflow.hooks.base.BaseHook
使用 Apprise(https://github.com/caronc/apprise) 与通知服务进行交互。
Apprise 支持的通知服务的完整列表可以在以下位置找到:https://github.com/caronc/apprise/wiki#notification-services。
- 参数:
apprise_conn_id (str) – Apprise 连接 ID,其 config 字段中配置了服务。
- notify(body, title=None, notify_type=NotifyType.INFO, body_format=NotifyFormat.TEXT, tag='all', attach=None, interpret_escapes=None, config=None)[source]¶
发送消息到插入的服务。
- 参数:
body (str) – 指定消息正文
title (str | None) – 指定消息标题。(可选)
notify_type (apprise.NotifyType) – 指定消息类型(默认为 info)。可能的值有 “info”、“success”、“failure” 和 “warning”
body_format (apprise.NotifyFormat) – 指定输入消息格式(默认为 text)。可能的值有 “text”、“html” 和 “markdown”。
tag (str | collections.abc.Iterable[str]) – 指定一个或多个标签来过滤要通知的服务
attach (apprise.AppriseAttachment | None) – 指定一个或多个文件附件位置
interpret_escapes (bool | None) – 启用对反斜杠转义字符的解释。例如,这将把诸如 n 和 r 之类的序列转换为其对应的 ASCII 换行符和回车符。
config (apprise.AppriseConfig | None) – 指定一个或多个配置