http.triggers.http

Module Contents

Classes

HttpTrigger

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

class http.triggers.http.HttpTrigger(endpoint, http_conn_id='http_default', method='GET', data=None, headers=None, extra_options=None, poll_interval=5.0)

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 (dict) – 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 (A dictionary of options, where key is string and value depends on the option that's being modified.) – Additional kwargs to pass when creating a request. For example, run(json=obj) is passed as aiohttp.ClientSession().get(json=obj)

  • extra_options – Extra options for the ‘requests’ library, see the ‘requests’ documentation (options to modify timeout, ssl, etc.)

  • poll_interval (float) – Time to sleep using asyncio

serialize(self)

Serializes HttpTrigger arguments and classpath.

async run(self)

Makes a series of asynchronous http calls via a Databrick 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.