1

I believe there can be a log for this, which stores all the dags and their respective data.
I need to have a list of dags with their schedule time, the expected code can be in any format, python or shell command.

Thanks.

Aniket Ghole
  • 192
  • 1
  • 11
  • You can run this command from cloud shell to list the dags `gcloud composer environments storage dags list --environment=ENVIRONMENT --location=LOCATION`. Let me know if it’s helpful or not? – Prajna Rai T Jul 21 '22 at 12:25
  • It did not help, it gives the files present in dag folder but the requirement is to get the list of dags with their scheduled time. – Aniket Ghole Jul 21 '22 at 12:46
  • Can you clarify more on your use case? Where do you want to store the output results when using Python code? – Prajna Rai T Jul 22 '22 at 07:19
  • My use case is to find the schedule time for all dags and if not, then current state of dags, I am trying the "gcloud composer environments run my_environment --location us-central1 dags state" command however unable to get the output, can you help with that command? – Aniket Ghole Jul 22 '22 at 09:28
  • It would be okay if you just print the output with python code – Aniket Ghole Jul 22 '22 at 09:57
  • Hi @AniketGhole, If you find my answer helpful, please consider to accept & upvote it as per [Stack Overflow guidelines](https://stackoverflow.com/help/someone-answers), helping more Stack contributors with their researches. If not, let me know so that I can improve the answer – Prajna Rai T Jul 28 '22 at 10:33

1 Answers1

1

To manually check the status of dags. You can follow these ways:

  1. To get the status of Dags from GCP you can use gcloud composer environments run command.

    Example:

    gcloud composer environments run environment_name --location 'location_name' dags state -- dag_id -- execution_date
    
  2. To get the status of Dags from Airflow CLI you can use dag state or dag list-runs command.

  3. You can get the current status of the dags from the Airflow UI:

    You can go to Browse -> Task Instances and apply “state” filter to get the status of the DAGS, you can also include filters like DAG ID.

Prajna Rai T
  • 1,666
  • 3
  • 15