Metadata-Version: 2.1
Name: zenduty-airflow-operator
Version: 0.1.2
Summary: This Airflow plugin creates a Zenduty Alert when it is run.
Home-page: https://github.com/Zenduty/zenduty_airflow_plugin
Author: Nikhil Prem
Author-email: nikhil@zenduty.com
License: MIT License
Project-URL: Bug Tracker, https://github.com/Zenduty/zenduty_airflow_plugin/issues
Platform: UNKNOWN
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: zenduty-api

# 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()
```

