semvec/pypi-packages huggingface dataset:
zenduty-airflow-operator 0.1.2
This Airflow plugin creates a Zenduty Alert when it is run.
License: MIT License

# Airflow Plugin - Zenduty

This plugin creates a Zenduty Alert when plugin is run.

## Operators

### ZendutyIncidentOperator

This operator composes the logic for this plugin. It generates an Incident on Zenduty by sending an Alert to Zenduty.
It accepts the following parameters:

- `api_key`: API Key generated by Zenduty (_Required_).
- `integration_id`: The Integration_id generated by the API Integration (_Required_).
- `title`: Title of the incident that is to be created.
- `summary`: Summary for the incident to be created.

## Requirements

This plugin requires the `zenduty-api` python package.

## Example Failure Callback Usage

```
from airflow.models import DAG, Variable
from airflow.operators.bash_operator import BashOperator
from zenduty_airflow_operator import ZendutyIncidentOperator

my_test_dag = DAG('example')

op = BashOperator(
    dag=my_test_dag,
    task_id='my_task',
    provide_context=True,
    python_callable=my_python_job,
    on_failure_callback=zenduty_incident
)
    
def zenduty_incident():

    operator = ZendutyIncidentOperator(
        api_key=Variable.get("api_key"),
        integration_id=Variable.get("integration_id"),
        title="Test Title",
        summary="Test Summary"
    )

    return operator.execute()
```