This is an automated email from the ASF dual-hosted git repository.
kamilbregula pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/master by this push:
new 011c07a Add migration guide for CLI commands (#10078)
011c07a is described below
commit 011c07a9bf415879e94b1271d4cc832c0a45b138
Author: Ephraim Anierobi <[email protected]>
AuthorDate: Sun Aug 2 09:46:12 2020 +0100
Add migration guide for CLI commands (#10078)
---
UPDATING.md | 77 ++++++++++++++++++++++++++++++++++++++++---------------------
1 file changed, 51 insertions(+), 26 deletions(-)
diff --git a/UPDATING.md b/UPDATING.md
index 823b2d7..6e25cc7 100644
--- a/UPDATING.md
+++ b/UPDATING.md
@@ -136,61 +136,86 @@ with third party services to the ``airflow.providers``
package.
All changes made are backward compatible, but if you use the old import paths
you will
see a deprecation warning. The old import paths can be abandoned in the future.
-### CLI changes
+### CLI changes in Airflow 2.0
The Airflow CLI has been organized so that related commands are grouped
together as subcommands,
which means that if you use these commands in your scripts, you have to make
changes to them.
This section describes the changes that have been made, and what you need to
do to update your script.
-#### Simplification of CLI commands
+The ability to manipulate users from the command line has been changed.
``airflow create_user``, ``airflow delete_user``
+ and ``airflow list_users`` has been grouped to a single command `airflow
users` with optional flags `create`, `list` and `delete`.
-The ability to manipulate users from the command line has been changed.
'airflow create_user' and 'airflow delete_user' and 'airflow list_users' has
been grouped to a single command `airflow users` with optional flags
`--create`, `--list` and `--delete`.
+The `airflow list_dags` command is now `airflow dags list`, `airflow pause` is
`airflow dags pause`, etc.
-Example Usage:
+In Airflow 1.10 and 2.0 there is an `airflow config` command but there is a
difference in behavior. In Airflow 1.10,
+it prints all config options while in Airflow 2.0, it's a command group.
`airflow config` is now `airflow config list`.
+You can check other options by running the command `airflow config --help`
+
+For a complete list of updated CLI commands, see
https://airflow.apache.org/cli.html.
+
+You can learn about the commands by running ``airflow --help``. For example to
get help about the ``celery`` group command,
+you have to run the help command: ``airflow celery --help``.
+
+| Old command | New command | Group
|
+|-----------------------------|------------------------------------|--------------------|
+| ``airflow worker`` | ``airflow celery worker`` |
``celery`` |
+| ``airflow flower`` | ``airflow celery flower`` |
``celery`` |
+| ``airflow trigger_dag`` | ``airflow dags trigger`` |
``dags`` |
+| ``airflow delete_dag`` | ``airflow dags delete`` |
``dags`` |
+| ``airflow show_dag`` | ``airflow dags show`` |
``dags`` |
+| ``airflow list_dag`` | ``airflow dags list`` |
``dags`` |
+| ``airflow dag_status`` | ``airflow dags status`` |
``dags`` |
+| ``airflow backfill`` | ``airflow dags backfill`` |
``dags`` |
+| ``airflow list_dag_runs`` | ``airflow dags list_runs`` |
``dags`` |
+| ``airflow pause`` | ``airflow dags pause`` |
``dags`` |
+| ``airflow unpause`` | ``airflow dags unpause`` |
``dags`` |
+| ``airflow test`` | ``airflow tasks test`` |
``tasks`` |
+| ``airflow clear`` | ``airflow tasks clear`` |
``tasks`` |
+| ``airflow list_tasks`` | ``airflow tasks list`` |
``tasks`` |
+| ``airflow task_failed_deps``| ``airflow tasks failed_deps`` |
``tasks`` |
+| ``airflow task_state`` | ``airflow tasks state`` |
``tasks`` |
+| ``airflow run`` | ``airflow tasks run`` |
``tasks`` |
+| ``airflow render`` | ``airflow tasks render`` |
``tasks`` |
+| ``airflow initdb`` | ``airflow db init`` |
``db`` |
+| ``airflow resetdb`` | ``airflow db reset`` |
``db`` |
+| ``airflow upgradedb`` | ``airflow db upgrade`` |
``db`` |
+| ``airflow checkdb`` | ``airflow db check`` |
``db`` |
+| ``airflow shell`` | ``airflow db shell`` |
``db`` |
+| ``airflow pool`` | ``airflow pools`` |
``pools`` |
+| ``airflow create_user`` | ``airflow users create`` |
``users`` |
+| ``airflow delete_user`` | ``airflow users delete`` |
``users`` |
+| ``airflow list_users`` | ``airflow users list`` |
``users`` |
+
+
+Example Usage for the ``users`` group:
To create a new user:
```bash
-airflow users --create --username jondoe --lastname doe --firstname jon
--email [email protected] --role Viewer --password test
+airflow users create --username jondoe --lastname doe --firstname jon --email
[email protected] --role Viewer --password test
```
To list users:
```bash
-airflow users --list
+airflow users list
```
To delete a user:
```bash
-airflow users --delete --username jondoe
+airflow users delete --username jondoe
```
To add a user to a role:
```bash
-airflow users --add-role --username jondoe --role Public
+airflow users add-role --username jondoe --role Public
```
To remove a user from a role:
```bash
-airflow users --remove-role --username jondoe --role Public
+airflow users remove-role --username jondoe --role Public
```
-#### CLI reorganization
-
-The Airflow CLI has been organized so that related commands are grouped
-together as subcommands. The `airflow list_dags` command is now `airflow
-dags list`, `airflow pause` is `airflow dags pause`, `airflow config` is
`airflow config list`, etc.
-For a complete list of updated CLI commands, see
https://airflow.apache.org/cli.html.
-
-#### Grouped to improve UX of CLI
-
-Some commands have been grouped to improve UX of CLI. New commands are
available according to the following table:
-
-| Old command | New command |
-|---------------------------|------------------------------------|
-| ``airflow worker`` | ``airflow celery worker`` |
-| ``airflow flower`` | ``airflow celery flower`` |
-
-#### Cli use exactly single character for short option style change
+#### Use exactly single character for short option style change in CLI
For Airflow short option, use exactly one single character, New commands are
available according to the following table: