:py:mod:`astronomer.providers.core.triggers.external_task` ========================================================== .. py:module:: astronomer.providers.core.triggers.external_task Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: astronomer.providers.core.triggers.external_task.TaskStateTrigger astronomer.providers.core.triggers.external_task.DagStateTrigger astronomer.providers.core.triggers.external_task.ExternalDeploymentTaskTrigger .. py:class:: TaskStateTrigger(dag_id, task_id, states, execution_dates, poll_interval = 5.0) Bases: :py:obj:`airflow.triggers.base.BaseTrigger` Waits asynchronously for a task in a different DAG to complete for a specific logical date. :param dag_id: The dag_id that contains the task you want to wait for :param task_id: The task_id that contains the task you want to wait for. If ``None`` (default value) the sensor waits for the DAG :param states: allowed states, default is ``['success']`` :param execution_dates: :param poll_interval: The time interval in seconds to check the state. The default value is 5 sec. .. py:method:: serialize() Serializes TaskStateTrigger arguments and classpath. .. py:method:: run() :async: Checks periodically in the database to see if the task exists, and has hit one of the states yet, or not. .. py:method:: count_tasks(session) Count how many task instances in the database match our criteria. .. py:class:: DagStateTrigger(dag_id, states, execution_dates, poll_interval = 5.0) Bases: :py:obj:`airflow.triggers.base.BaseTrigger` Waits asynchronously for a task in a different DAG to complete for a specific logical date. :param dag_id: The dag_id that contains the task you want to wait for :param task_id: The task_id that contains the task you want to wait for. If ``None`` (default value) the sensor waits for the DAG :param states: allowed states, default is ``['success']`` :param execution_dates: The logical date at which DAG run. :param poll_interval: The time interval in seconds to check the state. The default value is 5.0 sec. .. py:method:: serialize() Serializes DagStateTrigger arguments and classpath. .. py:method:: run() :async: Checks periodically in the database to see if the dag run exists, and has hit one of the states yet, or not. .. py:method:: count_dags(session) Count how many dag runs in the database match our criteria. .. py:class:: ExternalDeploymentTaskTrigger(endpoint, http_conn_id = 'http_default', method = 'GET', data = None, headers = None, extra_options = None, poke_interval = 5.0) Bases: :py:obj:`astronomer.providers.http.triggers.http.HttpTrigger` ExternalDeploymentTaskTrigger Inherits from HttpTrigger and make Async http call to get the deployment state .. py:method:: serialize() Serializes ExternalDeploymentTaskTrigger arguments and classpath. .. py:method:: run() :async: Makes a series of asynchronous http calls via an http hook poll for state of the job run until it reaches a failure state or success state. It yields a Trigger if response state is successful.