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
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
679f22466da597552a0b6dc09111edacf104d4fab82d0b2ab755dd00b4218afb
|
|
| MD5 |
d209cd3a2f1e330e878fadb2ce338ca9
|
|
| BLAKE2b-256 |
c5a652fa79f33ed414e3f6c0dd7f97377123ae4bb7f452d1ff4a761002b136b8
|
File details
Details for the file airflow_providers_mattermost-0.2.0-py3-none-any.whl.
File metadata
- Download URL: airflow_providers_mattermost-0.2.0-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.20.0.post1 CPython/3.10.12 Linux/6.5.0-1025-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbfca4f15e5a47156786a89c5021c1d77d5a2e3d3e36bdafae9c87ef7b617cec
|
|
| MD5 |
ca868cbcd891421ab481c69da1391c02
|
|
| BLAKE2b-256 |
65ddba0bd07d78e4e4a4e0d2f8873bceb5ae1c127325217f703c874457600eab
|