airflow.sensors.http_sensor

Module Contents

class airflow.sensors.http_sensor.HttpSensor(endpoint, http_conn_id='http_default', method='GET', request_params=None, headers=None, response_check=None, extra_options=None, *args, **kwargs)[source]

Bases:airflow.sensors.base_sensor_operator.BaseSensorOperator

Executes a HTTP get statement and returns False on failure:

404 not found or response_check function returned False

Parameters
  • http_conn_id (str) – The connection to run the sensor against

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

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

  • request_params (a dictionary of string key/value pairs) – The parameters to be added to the GET url

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

  • response_check (A lambda or defined function.) – A check against the ‘requests’ response object. Returns True for ‘pass’ and False otherwise.

  • extra_options (A dictionary of options, where key is string and value depends on the option that's being modified.) – Extra options for the ‘requests’ library, see the ‘requests’ documentation (options to modify timeout, ssl, etc.)

template_fields = ['endpoint', 'request_params'][source]
poke(self, context)[source]