jaketf opened a new issue, #23337:
URL: https://github.com/apache/airflow/issues/23337

   ### Description
   
   add a global `/suspend` and `/resume` endpoint to the REST API (and 
corresponding CLI command) that would do the following for the entire airflow 
deployment:
   
   `/suspend`
   - pause all currently unpaused DAGs (keeping track of what was previously 
unpaused in the metadata db)
   - Set `AIRFLOW__SCHEDULER__USE_JOB_SCHEDULE=False` (if not already false) to 
prevent scheduler from scheduling more tasks
   - (should handle duplicate suspend calls by `409: Airflow is already 
suspended`)
   
   `/resume`
   - unpause all DAGs from a previous `/suspend` call
   - set `AIRFLOW__SCHEDULER__USE_JOB_SCHEDULE` to whatever it was _before_ the 
last `/suspend` call
   - (should handle resuming an airflow that is not in the suspended state with 
`409: Cannot resume an airflow that is not in suspended state`)
   
   ### Use case/motivation
   
   This could be really helpful for people wanting to pause everything:
   - before running and upgrade to a newer airflow version
   - because this is a dev enviornment and we don't need anything to run 
outside of working hours to reduce resource consumption
   - "archiving an airflow" call suspend then tear down all the airflow 
components, could be restored by bringing up the components and then calling 
resume.
   
   ### Related issues
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to