test-curl.py 824 Bytes
Newer Older
김진영's avatar
김진영 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from datetime import datetime, timedelta
from textwrap import dedent
import pendulum
from airflow.operators.bash import BashOperator
from airflow import DAG
from airflow.models import Variable

# set timezone
local_tz = pendulum.timezone("Asia/Seoul")

# set dag
with DAG(
    'test-curl',
    default_args={
        'depends_on_past': False,
        'email': 'kim-jy@lotte.net',
    },
    description='dag for gasan batch jobs',
    schedule_interval='*/1 * * * *',
    start_date=datetime(2022, 6, 20, tzinfo=local_tz),
    tags=['test'],
    catchup=False,
) as dag:
    # (Task1) 헬스체크
    health_check = BashOperator(
        task_id='health_check',
        bash_command="curl -X GET -v 10.102.138.238:8001/api/v1/core/health \'-H accept: application/json\'",
    )

    # 작업 순서 정의
    health_check