blob: eeb97797d7478bff518671853da6078c675e820f [file] [log] [blame]
:py:mod:`airflow.operators.trigger_dagrun`
==========================================
.. py:module:: airflow.operators.trigger_dagrun
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.operators.trigger_dagrun.TriggerDagRunLink
airflow.operators.trigger_dagrun.TriggerDagRunOperator
Attributes
~~~~~~~~~~
.. autoapisummary::
airflow.operators.trigger_dagrun.XCOM_EXECUTION_DATE_ISO
airflow.operators.trigger_dagrun.XCOM_RUN_ID
.. py:data:: XCOM_EXECUTION_DATE_ISO
:annotation: = trigger_execution_date_iso
.. py:data:: XCOM_RUN_ID
:annotation: = trigger_run_id
.. py:class:: TriggerDagRunLink
Bases: :py:obj:`airflow.models.BaseOperatorLink`
Operator link for TriggerDagRunOperator. It allows users to access
DAG triggered by task using TriggerDagRunOperator.
.. py:attribute:: name
:annotation: = Triggered DAG
.. py:method:: get_link(self, operator, dttm)
Link to external system.
:param operator: airflow operator
:param dttm: datetime
:return: link to external system
.. py:class:: TriggerDagRunOperator(*, trigger_dag_id: str, trigger_run_id: Optional[str] = None, conf: Optional[Dict] = None, execution_date: Optional[Union[str, datetime.datetime]] = None, reset_dag_run: bool = False, wait_for_completion: bool = False, poke_interval: int = 60, allowed_states: Optional[List] = None, failed_states: Optional[List] = None, **kwargs)
Bases: :py:obj:`airflow.models.BaseOperator`
Triggers a DAG run for a specified ``dag_id``
:param trigger_dag_id: The dag_id to trigger (templated).
:type trigger_dag_id: str
:param trigger_run_id: The run ID to use for the triggered DAG run (templated).
If not provided, a run ID will be automatically generated.
:type trigger_run_id: str
:param conf: Configuration for the DAG run.
:type conf: dict
:param execution_date: Execution date for the dag (templated).
:type execution_date: str or datetime.datetime
:param reset_dag_run: Whether or not clear existing dag run if already exists.
This is useful when backfill or rerun an existing dag run.
When reset_dag_run=False and dag run exists, DagRunAlreadyExists will be raised.
When reset_dag_run=True and dag run exists, existing dag run will be cleared to rerun.
:type reset_dag_run: bool
:param wait_for_completion: Whether or not wait for dag run completion. (default: False)
:type wait_for_completion: bool
:param poke_interval: Poke interval to check dag run status when wait_for_completion=True.
(default: 60)
:type poke_interval: int
:param allowed_states: List of allowed states, default is ``['success']``.
:type allowed_states: list
:param failed_states: List of failed or dis-allowed states, default is ``None``.
:type failed_states: list
.. py:attribute:: template_fields
:annotation: = ['trigger_dag_id', 'trigger_run_id', 'execution_date', 'conf']
.. py:attribute:: template_fields_renderers
.. py:attribute:: ui_color
:annotation: = #ffefeb
.. py:method:: operator_extra_links(self)
:property:
Return operator extra links
.. py:method:: execute(self, context: Dict)
This is the main method to derive when creating an operator.
Context is the same dictionary used as when rendering jinja templates.
Refer to get_template_context for more context.