Skip to main content

Apache Airflow Mattermost provider

Project description

Apache Airflow Mattermost Provider

GitHub branch check runs Read the Docs (version) PyPI - Version

The package is Apache Airflow provider for integrating with Mattermost using webhooks

Features

  • Hook
  • Operator
  • Notifier

Hook

Provides custom connection type and sends messages via webhook

connection

Operator

To send messages within DAGs, supports templating

from airflow.decorators import dag

from airflow_providers_mattermost.operators import MattermostOperator


@dag(
    dag_id='mattermost_dag'
)
def mattermost():
    send_message_to_mattermost = MattermostOperator(
        task_id='send_message_to_mattermost',
        conn_id='mattermost',
        channel='off-topic',
        message='Hello from {{ dag.dag_id }} in Airflow!',
        username='Airflow',
    )

    send_message_to_mattermost


mattermost()

Notifier

Can be used with on_*_callbacks to notify about Task/DAG status

from airflow.decorators import dag

from airflow_providers_mattermost.notifiers import MattermostNotifier
from airflow_providers_mattermost.operators import MattermostOperator


@dag(
    dag_id='mattermost_dag',
    on_success_callback=MattermostNotifier(
        conn_id='mattermost',
        channel='off-topic',
        message='Dag ID: {{ dag.dag_id }} , Run ID: {{ run_id }} has completed',
        username='Airflow',
    ),
    on_failure_callback=MattermostNotifier(
        conn_id='mattermost',
        channel='off-topic',
        message='Dag ID: {{ dag.dag_id }} , Run ID: {{ run_id }} has failed',
        username='Airflow',
    ),
)
def mattermost():
    send_message_to_mattermost = MattermostOperator(
        task_id='send_message_to_mattermost',
        conn_id='mattermost',
        channel='off-topic',
        message='Hello from {{ dag.dag_id }} in Airflow!',
        username='Airflow',
    )

    send_message_to_mattermost


mattermost()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

airflow_providers_mattermost-0.2.0.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

airflow_providers_mattermost-0.2.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file airflow_providers_mattermost-0.2.0.tar.gz.

File metadata

  • Download URL: airflow_providers_mattermost-0.2.0.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.20.0.post1 CPython/3.10.12 Linux/6.5.0-1025-azure

File hashes

Hashes for airflow_providers_mattermost-0.2.0.tar.gz
Algorithm Hash digest
SHA256 679f22466da597552a0b6dc09111edacf104d4fab82d0b2ab755dd00b4218afb
MD5 d209cd3a2f1e330e878fadb2ce338ca9
BLAKE2b-256 c5a652fa79f33ed414e3f6c0dd7f97377123ae4bb7f452d1ff4a761002b136b8

See more details on using hashes here.

File details

Details for the file airflow_providers_mattermost-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for airflow_providers_mattermost-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bbfca4f15e5a47156786a89c5021c1d77d5a2e3d3e36bdafae9c87ef7b617cec
MD5 ca868cbcd891421ab481c69da1391c02
BLAKE2b-256 65ddba0bd07d78e4e4a4e0d2f8873bceb5ae1c127325217f703c874457600eab

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page