File: //snap/google-cloud-cli/396/help/man/man1/gcloud_composer_environments_storage_dags_export.1
.TH "GCLOUD_COMPOSER_ENVIRONMENTS_STORAGE_DAGS_EXPORT" 1
.SH "NAME"
.HP
gcloud composer environments storage dags export \- export DAGs from an environment into local storage or Cloud Storage
.SH "SYNOPSIS"
.HP
\f5gcloud composer environments storage dags export\fR \fB\-\-destination\fR=\fIDESTINATION\fR (\fB\-\-environment\fR=\fIENVIRONMENT\fR\ :\ \fB\-\-location\fR=\fILOCATION\fR) [\fB\-\-source\fR=\fISOURCE\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
If the SOURCE is a directory, it and its contents are are exported recursively.
If no SOURCE is provided, the entire contents of the environment's DAGs
directory will be exported. Colliding files in the DESTINATION will be
overwritten. If a file exists in the DESTINATION but there is no corresponding
file to overwrite it, it is untouched.
.SH "EXAMPLES"
Suppose the environment \f5myenv\fR's Cloud Storage bucket has the following
structure:
.RS 2m
gs://the\-bucket
|
+\-\- dags
| |
| +\-\- file1.py
| +\-\- file2.py
| |
| +\-\- subdir1
| | |
| | +\-\- file3.py
| | +\-\- file4.py
.RE
And the local directory '/foo' has the following structure:
.RS 2m
/foo
|
+\-\- file1.py
+\-\- fileX.py
| |
| +\-\- subdir1
| | |
| | +\-\- file3.py
| | +\-\- fileY.py
.RE
The following command:
.RS 2m
gcloud composer environments storage dags export myenv \-\-destination=/foo
.RE
would result in the following structure in the local '/foo' directory:
.RS 2m
/foo
|
+\-\- file1.py
+\-\- file2.py
+\-\- fileX.py
| |
| +\-\- subdir1
| | |
| | +\-\- file3.py
| | +\-\- file4.py
| | +\-\- fileY.py
.RE
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
.RS 2m
gcloud composer environments storage dags export myenv \-\-source=subdir1/file3.py \-\-destination=/foo
.RE
the resulting local directory structure would be the following:
.RS 2m
/foo
|
+\-\- file1.py
+\-\- file3.py
+\-\- fileX.py
| |
| +\-\- subdir1
| | |
| | +\-\- file3.py
| | +\-\- fileY.py
.RE
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'.
.SH "REQUIRED FLAGS"
.RS 2m
.TP 2m
\fB\-\-destination\fR=\fIDESTINATION\fR
The path to an existing local directory or a Cloud Storage bucket/directory into
which to export files.
.TP 2m
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 \f5project\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5\-\-environment\fR on the command line with a fully
specified name;
.IP "\(em" 2m
provide the argument \f5\-\-project\fR on the command line;
.IP "\(em" 2m
set the property \f5core/project\fR.
.RE
.sp
This must be specified.
.RS 2m
.TP 2m
\fB\-\-environment\fR=\fIENVIRONMENT\fR
ID of the environment or fully qualified identifier for the environment.
To set the \f5environment\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5\-\-environment\fR on the command line.
.RE
.sp
This flag argument must be specified if any of the other arguments in this group
are specified.
.TP 2m
\fB\-\-location\fR=\fILOCATION\fR
Region where Composer environment runs or in which to create the environment.
To set the \f5location\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5\-\-environment\fR on the command line with a fully
specified name;
.IP "\(bu" 2m
provide the argument \f5\-\-location\fR on the command line;
.IP "\(bu" 2m
set the property \f5composer/location\fR.
.RE
.sp
.RE
.RE
.sp
.SH "OPTIONAL FLAGS"
.RS 2m
.TP 2m
\fB\-\-source\fR=\fISOURCE\fR
An optional relative path to a file or directory to be exported from the dags/
subdirectory in the environment's Cloud Storage bucket.
.RE
.sp
.SH "GCLOUD WIDE FLAGS"
These flags are available to all commands: \-\-access\-token\-file, \-\-account,
\-\-billing\-project, \-\-configuration, \-\-flags\-file, \-\-flatten,
\-\-format, \-\-help, \-\-impersonate\-service\-account, \-\-log\-http,
\-\-project, \-\-quiet, \-\-trace\-token, \-\-user\-output\-enabled,
\-\-verbosity.
Run \fB$ gcloud help\fR for details.
.SH "NOTES"
These variants are also available:
.RS 2m
$ gcloud alpha composer environments storage dags export
.RE
.RS 2m
$ gcloud beta composer environments storage dags export
.RE