Skip to main content

Apache Airflow Mattermost provider

Project description

Apache Airflow Mattermost Provider

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!'
    )

    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',
    ),
    on_failure_callback=MattermostNotifier(
        conn_id='mattermost',
        channel='off-topic',
        message='Dag ID: {{ dag.dag_id }} , Run ID: {{ run_id }} has failed',
    ),
)
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!'
    )

    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.1.0.tar.gz (12.1 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.1.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for airflow_providers_mattermost-0.1.0.tar.gz
Algorithm Hash digest
SHA256 728ecca450819297e01b3c7243ab9e0d08d7719131165a20e6448ecae9495327
MD5 d16bc36d77f8602d4d19493e11b56de0
BLAKE2b-256 354367bac3bb43fcc223da2b853d8a1f41886f310ec3eefd2b331ea0b2819485

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for airflow_providers_mattermost-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 476e4782bc0d77c77268d7e3972ec2f0ff02acd8a1e9079f60fb4cdb509cf7f5
MD5 66b7d4653221f7e2ed7a2348e3b19ad8
BLAKE2b-256 b507007cf12d76b3b335b0b6a58103acc24f2e76f83458a82b72940238bdb0e6

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