Skip to content

Commit

Permalink
Updated doc with connection on CLI (#175)
Browse files Browse the repository at this point in the history
Co-authored-by: sc <[email protected]>
  • Loading branch information
satish-chinthanippu and sc250072 authored Mar 20, 2024
1 parent bd0a6d4 commit 4481e74
Showing 1 changed file with 48 additions and 3 deletions.
51 changes: 48 additions & 3 deletions modules/ROOT/pages/airflow.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This tutorial demonstrates how to use airflow with Teradata Vantage. Airflow wil

== Prerequisites

* Ubuntu 22.x
* Ubuntu 22.x
* Access to a Teradata Vantage instance.
+
include::ROOT:partial$vantage_clearscape_analytics.adoc[]
Expand Down Expand Up @@ -62,7 +62,13 @@ airflow standalone
----
2. Access the Airflow UI. Visit https://localhost:8080 in the browser and log in with the admin account details shown in the terminal.

== Define a Teradata connection in Airflow UI

Teradata Connections may be defined in Airflow in the following ways:

1. Using Airflow Web UI
2. Using Environment Variable

== Define a Teradata connection in Airflow Web UI

1. Open the Admin -> Connections section of the UI. Click the Create link to create a new connection.
+
Expand All @@ -78,7 +84,46 @@ image::{dir}/airflow-newconnection.png[Airflow New Connection, width=75%]
* Password (required): Specify the password to connect.
* Click on Test and Save.

== Define a Teradata connection in Environment Variable
Airflow connections may be defined in environment variables in either of one below formats.

1. JSON format
2. URI format

+
NOTE: The naming convention is AIRFLOW_CONN_{CONN_ID}, all uppercase (note the single underscores surrounding CONN).
So if your connection id is teradata_conn_id then the variable name should be AIRFLOW_CONN_TERADATA_CONN_ID
+


== JSON format example


[source, bash]
----
export AIRFLOW_CONN_TERADATA_CONN_ID='{
"conn_type": "teradata",
"login": "teradata_user",
"password": "my-password",
"host": "my-host",
"schema": "my-schema",
"extra": {
"tmode": "TERA",
"sslmode": "verify-ca"
}
}'
----

== URI format example


[source, bash]
----
export AIRFLOW_CONN_TERADATA_CONN_ID='teradata://teradata_user:my-password@my-host/my-schema?tmode=TERA&sslmode=verify-ca'
----

Refer https://airflow.apache.org/docs/apache-airflow-providers-teradata/stable/connections/teradata.html[Teradata Hook] for detailed information on Teradata Connection in Airflow.

== Define a DAG in Airflow

Expand Down Expand Up @@ -135,7 +180,7 @@ with DAG(

== Summary

This tutorial demonstrated how to use Airflow and the Airflow Teradata provider with a Teradata Vantage instance. The example DAG provided creates `my_users` table in the Teradata Vantage instance defined in Connection UI.
This tutorial demonstrated how to use Airflow and the Airflow Teradata provider with a Teradata Vantage instance. The example DAG provided creates `my_users` table in the Teradata Vantage instance defined in Connection UI.

== Further reading
* link:https://airflow.apache.org/docs/apache-airflow/stable/start.html[airflow documentation]
Expand Down

0 comments on commit 4481e74

Please sign in to comment.