Working with Apache Airflow™ interfaces
To work with Managed Service for Apache Airflow™, you can use the web interface or the Apache Airflow™ API.
Only users with the managed-airflow.user role or higher can open the web interface or send an API request. The API checks the role via the IAM token used for authentication.
Apache Airflow™ interfaces can be accessed from the internet, so the role check provides additional security. Even if an attacker has a link to the web interface and the admin
password to get authenticated with, they will not have the role required to access the interface.
Working with the web interface
-
In the management console
, open the cluster page. -
Go to the Managed Service for Apache Airflow™ web server page.
-
In the web interface that opens, enter the credentials:
- Username:
Admin
- Password:
Admin
user password that you set when creating a cluster
- Username:
For more information about how to use the web interface, see the Apache Airflow™ documentation
Using the Apache Airflow™ API
You can make Apache Airflow™ API
-
In the cloud network hosting the Managed Service for Apache Airflow™ cluster, create a Linux-based VM.
-
Set up a NAT gateway to connect to the VM.
-
Get an IAM token for a user account with the
managed-airflow.user
role or higher. The way you get a token depends on your account type: -
Make an API request, e.g., using cURL. In the authorization parameters, enter your username and password.
Request example:
curl \ --request GET \ 'https://c-<cluster_ID>.airflow.yandexcloud.net/api/v1/dags' \ --user 'admin:<admin_user_password>' \ --header 'Content-Type: application/json' \ --header 'X-Cloud-Authorization: Bearer <IAM_token>'
The request returns a list of DAG files. Check an example of the response in the Apache Airflow™ API documentation
.
Warning
To use basic authentication with the Apache Airflow™ API as in the example above, set the value of the api.auth_backends
: airflow.api.auth.backend.basic_auth
property in the Airflow configuration section when creating or updating the cluster. Learn more about the API authentication in the Apache Airflow™ documentation