CREATE TABLE my_schema.spreadsheet_copy_testing (
col1 int,
col2 int,
col3 int,
col4 int
);
airflow dags test Gsheet_to_Redshift 2023-12-12
SELECT * FROM my_schema.spreadsheet_copy_testing;
auth_backend = airflow.api.auth.backend.basic_auth
AIRFLOW__API__AUTH_BACKENDS: ‘airflow.api.auth.backend.basic_auth,airflow.api.auth.backend.session’
[참고]
airflow UI나 api에 대한 접근은 VPN을 이용하여 액세스하는 방법이 좋다.
api전용 UID생성하는 것이 좋다.
curl -X GET --user "user_name" http://localhost:8080/health
1111cur -X POST --user "airflow:airflow" -H 'Content-Type: application/json' -d '{"execution_date":"2023-05-24T00:00:00Z"}'"http://localhost:8080/api/vi/dags/{dag_id}/dagRuns"
curl -X GET --user "airflow:airflow" http://localhost:8080/api/v1/dags
curl -X GET --user "airflow:airflow" http://localhost:8080/api/v1/variables
curl -X GET --user "airflow:airflow" http://localhost:8080/api/v1/config
import requests
from requests.auth import HTTPBasicAuth
url = "http://localhost:8080/api/vi/dags"
dags = requests.get(url, auth=HTTPBasicAuth("airflow","airflow"))
print(dags.text) # dags.json()
: web UI에 보이는 것들만 다음 명령을 통해서 볼 수 있다.
airflow variables export variables.json
airflow variables import variables.json
airflow connections export connections.json
airflow connections import connections.json