airflow.providers.dingding.operators.dingding

DingdingOperator

该 operator 允许使用自定义机器人 API 发送钉钉消息。

模块内容

class airflow.providers.dingding.operators.dingding.DingdingOperator(*, dingding_conn_id='dingding_default', message_type='text', message=None, at_mobiles=None, at_all=False, **kwargs)[source]

基类: airflow.models.BaseOperator

该 operator 允许使用自定义机器人 API 发送钉钉消息。

另请参阅

有关如何使用此 operator 的更多信息,请参阅指南: 基本用法

参数:
  • dingding_conn_id (str) – 钉钉连接 ID,其密码字段包含 access token,主机字段可选地包含主机名。如果未设置主机,将使用默认值 https://oapi.dingtalk.com

  • message_type (str) – 您想发送到钉钉的消息类型,目前支持五种类型:text, link, markdown, actionCard, feedCard

  • message (str | dict | None) – 发送到聊天群组的消息

  • at_mobiles (list[str] | None) – 在消息中提醒特定用户

  • at_all (bool) – 是否提醒群组中所有人。如果为 True,将覆盖 at_mobiles

template_fields: collections.abc.Sequence[str] = ('message',)[source]
ui_color = '#4ea4d4'[source]
dingding_conn_id = 'dingding_default'[source]
message_type = 'text'[source]
message = None[source]
at_mobiles = None[source]
at_all = False[source]
execute(context)[source]

创建 operator 时继承此方法。

Context 与用于渲染 jinja 模板的字典相同。

参考 get_template_context 获取更多 context 信息。

此条目有帮助吗?