Airflow API 를 통한 DAG list 확인
- airflow 버전 확인 명령어
$ airflow version
FutureWarning 가볍게 무시
- auth_backends 옵션 확인
$ airflow config get-value api auth_backends
airflow.api.auth.backend.session
- airflow.cfg 에서 auth_backends 옵션 수정
- airflow.api.auth.backend.session -> auth_backends = airflow.api.auth.backend.basic_auth
[api]
auth_backends = airflow.api.auth.backend.basic_auth
- openAPI script 내려받기
- 내려받은 script를 postman에 import
- 다운로드 받은 v1.yaml파일을 import
- import완료후 Airflow API script확인!
> Airflow rest API 호출
{{baseUrl}} : /api/v1
- GET version information 호출
- CURL
curl --location 'http://localhost:8080/api/v1/version'
-
- postman
- GET List DAGs 호출
- CURL
curl -X GET --user "admin:admin" "http://localhost:8080/api/v1/dags"
-
- postman
- Authorization을 포함하여 호출필요
- postman
> Airflow Docs(API)
API — Airflow Documentation
airflow.apache.org