Working with Apache Airflow™ interfaces
To work with Managed Service for Apache Airflow™, you can use the web interface or the Apache Airflow™ API.
To open a web interface or send an API request, users need the managed-airflow.user role or higher. The API checks the role via the IAM token used for authentication.
Apache Airflow™ interfaces are accessible via the internet, so the role check is required for added security. Even if an attacker has the link to the web interface and the admin
user's password to get authenticated with, they will not have the required role 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 VM.
-
Set up a NAT gateway to connect to the VM.
-
Get an IAM token for a subject with the
managed-airflow.user
role or higher. The process of getting a token depends on the subject type: -
Make an API request, for example, 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. For an example of the response, refer to 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. For more information about authentication with the API, see the Apache Airflow™ documentation