Skip to content

Commit

Permalink
New DAG
Browse files Browse the repository at this point in the history
  • Loading branch information
romanoa77 committed Apr 12, 2024
1 parent 7c1e13d commit 5c9ac12
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions dags_airflow_ale_httpsensor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import airflow.utils.dates
from airflow import DAG
from airflow.operator.dummy import DummyOperator
from airflow.providers.http.sensors.http import HttpSensor

dag = DAG(
dag_id="httpsens_exmp",
start_date=airflow.utils.dates.days_ago(3),
schedule_interval=None,
description="A demonstration DAG using HttpSensor.",

)

def check_response_itm(response):
js = response.json()
print("The json var is a ",type(js))

return True




checkNItems = HttpSensor(task_id="check",
http_conn_id="fakeAPIPlaceh",
endpoint="users",
response_check=lambda response: check_response_itm(response),
poke_interval=10,
timeout=100,

)

create_metrics = DummyOperator(task_id="create_metrics", dag=dag)

checkNItems>>create_metrics



0 comments on commit 5c9ac12

Please sign in to comment.