πΒ κ³΅λΆ λ΄μ©
Google sheet μ°λ μ€μ΅
1
2
3
4
5
6
| create table imsolem1226.spreadsheet_copy_testing(
col1 int,
col2 int,
col3 int,
col4 int
);
|
- ν
μ΄λΈμ μ μ₯λ λ°μ΄ν° νμΈ
Airflow API
1
2
| [api]
auth_backend = airflow.api.aut.backend.basic_auth
|
1
2
3
| # AIRFLOW__ : override airflow.cfg
# API__AUTH_BACKENDS : [Api] μΉμ
λ°μ 'AUTH_BACKENDS' ν€ κ°μ μ€μ
AIRFLOW__API__AUTH_BACKENDS: 'airflow.api.auth.backend.basic_auth', 'airflow.api.auth.backend.session'
|
- commandλ‘ μ€μ κ° νμΈ
1
| docker exec -it {airflow schedular container name} aiflow config get-value api auth_backend
|
1
| curl -X GET --user "{name}:{password}" http://{localhost or address ip}:8081/health
|
/config
κΈ°λ³Έ μ€μ : APIλ‘ μ κ·Ό λΆκ°
μ€μ κ° : default:False
, True
, non-sensitive-only
1
2
3
4
5
| #airflow.cfg
[webserver]
expose_config = True
#docker-composer.yaml
AIRFLOW__WEBSERVER__EXPOSE_CONFIG: 'true'
|
νμ±ν λ DAG μ°ΎκΈ°
1
2
3
4
5
6
7
8
9
10
11
12
13
| import requests
from requests.auth import HTTPBasicAuth
import json
url = "http://localhost:8080/api/v1/dags"
dags = requests.get(url, auth=HTTPBasicAuth("airflow", "airflow"))
json_dags = json.loads(dags.text) #dags.json()
for dag in json_dags["dags"]:
if not dag["is_paused"]:
print(dag)
|
πΒ CHECK
(μ΄λ ΅κ±°λ μλ‘κ² μκ² λ κ² λ± λ€μ νμΈν κ²λ€)
β λλ μ