gcloud_alpha_composer_environments_storage_dags_export (1)
NAME
- gcloud alpha composer environments storage dags export - export DAGs from an environment into local storage or Cloud Storage
SYNOPSIS
-
gcloud alpha composer environments storage dags export --destination=DESTINATION (--environment=ENVIRONMENT : --location=LOCATION) [--source=SOURCE] [GCLOUD_WIDE_FLAG ...]
DESCRIPTION
(ALPHA) If the SOURCE is a directory, it and its contents are are exported
REQUIRED FLAGS
-
- --destination=DESTINATION
-
The path to an existing local directory or a Cloud Storage bucket/directory into
which to export files.
-
Environment resource - The environment from whose Cloud Storage bucket to
export DAGs. The arguments in this group can be used to specify the attributes
of this resource. (NOTE) Some attributes are not given arguments in this group
but can be set in other ways. To set the [project] attribute: provide the
argument [--environment] on the command line with a fully specified name;
provide the argument [--project] on the command line; set the property
[core/project]. This must be specified.
-
- --environment=ENVIRONMENT
-
ID of the environment or fully qualified identifier for the environment. This
flag must be specified if any of the other arguments in this group are
specified.
- --location=LOCATION
-
Compute Engine region in which to create the environment.
-
OPTIONAL FLAGS
-
- --source=SOURCE
-
An optional relative path to a file or directory to be exported from the dags/
subdirectory in the environment's Cloud Storage bucket.
GCLOUD WIDE FLAGS
These flags are available to all commands: --account, --configuration, --flags-file, --flatten, --format, --help, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity. Run $ gcloud help for details.
EXAMPLES
Suppose the environment myenv's Cloud Storage bucket has the following structure:
- gs://the-bucket | +-- dags | | | +-- file1.py | +-- file2.py | | | +-- subdir1 | | | | | +-- file3.py | | +-- file4.py
And the local directory '/foo' has the following structure:
- /foo | +-- file1.py +-- fileX.py | | | +-- subdir1 | | | | | +-- file3.py | | +-- fileY.py
The following command:
- gcloud alpha composer environments storage dags export myenv --destination /foo
would result in the following structure in the local '/foo' directory:
- /foo | +-- file1.py +-- file2.py +-- fileX.py | | | +-- subdir1 | | | | | +-- file3.py | | +-- file4.py | | +-- fileY.py
The local files '/foo/file1.py' and '/foo/subdir1/file3.py' will be overwritten with the contents of the corresponding files in the Cloud Storage bucket.
If instead we had run
- gcloud alpha composer environments storage dags export myenv --source subdir1/file3.py --destination /foo
the resulting local directory structure would be the following:
- /foo | +-- file1.py +-- file3.py +-- fileX.py | | | +-- subdir1 | | | | | +-- file3.py | | +-- fileY.py
No local files would be overwritten since 'gs://the-bucket/dags/subdir1/file3.py' was written to '/foo/file3.py' instead of 'foo/subdir1/file3.py'.
NOTES
This command is currently in ALPHA and may change without notice. If this command fails with API permission errors despite specifying the right project, you will have to apply for early access and have your projects registered on the API whitelist to use it. To do so, contact Support at cloud.google.com/support These variants are also available:
- $ gcloud composer environments storage dags export $ gcloud beta composer environments storage dags export