astronomer.providers.http.triggers.http

Module Contents

Classes

HttpTrigger

A trigger that fires when the request to a URL returns a non-404 status code

class astronomer.providers.http.triggers.http.HttpTrigger(endpoint, http_conn_id='http_default', method='GET', data=None, headers=None, extra_options=None, poke_interval=5.0)[source]

Bases: airflow.triggers.base.BaseTrigger

A trigger that fires when the request to a URL returns a non-404 status code

Parameters:
  • endpoint (str) – The relative part of the full url

  • http_conn_id (str) – The HTTP Connection ID to run the sensor against

  • method (str) – The HTTP request method to use

  • data (Optional[Union[Dict[str, Any], str]]) – payload to be uploaded or aiohttp parameters

  • headers (a dictionary of string key/value pairs) – The HTTP headers to be added to the GET request

  • extra_options (Optional[Dict[str, Any]]) – Additional kwargs to pass when creating a request. For example, run(json=obj) is passed as aiohttp.ClientSession().get(json=obj)

  • poke_interval (float) – Time to sleep using asyncio

serialize()[source]

Serializes HttpTrigger arguments and classpath.

async run()[source]

Makes a series of asynchronous http calls via an http hook. It yields a Trigger if response is a 200 and run_state is successful, will retry the call up to the retry limit if the error is ‘retryable’, otherwise it throws an exception.