Hitting the Airflow API running on Astronomer cloud

Hi,

We currently have airflow DAGs running on an Astronomer cloud instance, and we’re trying to develop external functions that would eventually trigger these DAGs.

Referencing the documentation for this → Make Requests to the Airflow REST API | Astronomer Documentation

Making a call to the API would mean sending an HTTP request to:
https://[AIRFLOW-DOMAIN]/api/v1/[method to call]
[AIRFLOW-DOMAIN]: Use https://[your-base-domain]/[deployment-release-name]

i.e. https://gcpXXXY.us-east4.astronomer.io/gravitational-flux-XXXX/api/v1/pools

Not sure if it was necessary, but also set an environment variable AIRFLOW__API__AUTH_BACKEND = airflow.api.auth.backend.default

The issue is, instead of getting 200 or 401 or 403 responses, we’d always get some HTML like below when testing out API calls via the Postman app. What am I missing? Thanks in advance!

<!DOCTYPE html>
<html>
<head>
<meta name=“robots” content=“noindex”>
<!-- Environment variables injected from NGINX —>
.
.
.
<meta http-equiv=“X-UA-Compatible” content=“IE=edge” />
<meta charset=“utf-8”>
<title>Astronomer
.
.
</head>
<body>
<div id=“root”>
<script src="/assets/runtime.82af4b31.js">
<script src="/assets/2.36213ffe.js">
<script src="/assets/index.b05feb43.js">
</body>
</html>

Hey @paolo.suarez ! Thanks for reaching out. Since you’re an existing Astronomer customer, I’d go ahead and reach out to Astronomer Support.

We can help you on this there and port back learnings here so the rest of the community can see :slightly_smiling_face:

Hey @paola ,

Thanks for the response! The issue has been resolved on our end. It was a facepalm :man_facepalming: sort of miss on my part, and I’ll post a reply on what we did to address this (might be of help to others in the community).

Resolution:

So this was actually a miss on the URL. The URL we tried to use for the API call was something like:

https://gcpXXXY.us-east4.astronomer.io/gravitational-flux-XXXX/api/v1/pools

When in fact, the instance where our DAGS were deployed looked like:
https://deployments.gcpXXXY.us-east4.astronomer.io/gravitational-flux-XXXX/airflow/

Thus, making an API call to - https://deployments.gcpXXXY.us-east4.astronomer.io/gravitational-flux-XXXX/airflow/api/v1/pools - worked perfectly fine!

@paolo.suarez - I’m glad to hear this was resolved on your end! Apologies if our documentation there wasn’t clear - we actually just pushed up some improvements to that doc that should help. Let us know if you hit any other issues.

FYI It looks like you’re running on Astronomer Nebula, which is an earlier edition of our Cloud service. For documentation specific to that product, go to: nebula.astronomer.io. The password is: nebula. That documentation site also has a Log In button (which is not currently on our homepage) as well as a link to the status page for Nebula specifically.

Hope that’s helpful :slightly_smiling_face: If you’re interested in our newer products, don’t hesitate to reach out as well.

1 Like