Coverage for airflow.example_dags.example_http_operator : 100%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
|
""" ### Example HTTP operator and sensor """
datetime.min.time())
'owner': 'airflow', 'depends_on_past': False, 'start_date': seven_days_ago, 'email': ['airflow@airflow.com'], 'email_on_failure': False, 'email_on_retry': False, 'retries': 1, 'retry_delay': timedelta(minutes=5), }
# t1, t2 and t3 are examples of tasks created by instatiating operators task_id='post_op', endpoint='api/v1.0/nodes', data=json.dumps({"priority": 5}), headers={"Content-Type": "application/json"}, response_check=lambda response: True if len(response.json()) == 0 else False, dag=dag)
task_id='post_op_formenc', endpoint='nodes/url', data="name=Joe", headers={"Content-Type": "application/x-www-form-urlencoded"}, dag=dag)
task_id='get_op', method='GET', endpoint='api/v1.0/nodes', data={"param1": "value1", "param2": "value2"}, headers={}, dag=dag)
task_id='put_op', method='PUT', endpoint='api/v1.0/nodes', data=json.dumps({"priority": 5}), headers={"Content-Type": "application/json"}, dag=dag)
task_id='del_op', method='DELETE', endpoint='api/v1.0/nodes', data="some=data", headers={"Content-Type": "application/x-www-form-urlencoded"}, dag=dag)
task_id='http_sensor_check', conn_id='http_default', endpoint='api/v1.0/apps', params={}, headers={"Content-Type": "application/json"}, response_check=lambda response: True if "collation" in response.content else False, poke_interval=5, dag=dag)
|