HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/396/help/man/man1/gcloud_asset_export.1
.TH "GCLOUD_ASSET_EXPORT" 1



.SH "NAME"
.HP
gcloud asset export \- export the cloud assets to Google Cloud Storage/BigQuery



.SH "SYNOPSIS"
.HP
\f5gcloud asset export\fR (\fB\-\-folder\fR=\fIFOLDER_ID\fR\ |\ \fB\-\-organization\fR=\fIORGANIZATION_ID\fR\ |\ \fB\-\-project\fR=\fIPROJECT_ID\fR) (\fB\-\-output\-path\fR=\fIOUTPUT_PATH\fR\ |\ \fB\-\-output\-path\-prefix\fR=\fIOUTPUT_PATH_PREFIX\fR\ |\ [(\fB\-\-bigquery\-table\fR=\fIBIGQUERY_TABLE\fR\ :\ \fB\-\-bigquery\-dataset\fR=\fIBIGQUERY_DATASET\fR)\ :\ \fB\-\-output\-bigquery\-force\fR\ \fB\-\-partition\-key\fR=\fIPARTITION_KEY\fR\ \fB\-\-per\-asset\-type\fR]) [\fB\-\-asset\-types\fR=[\fIASSET_TYPES\fR,...]] [\fB\-\-content\-type\fR=\fICONTENT_TYPE\fR] [\fB\-\-relationship\-types\fR=[\fIRELATIONSHIP_TYPES\fR,...]] [\fB\-\-snapshot\-time\fR=\fISNAPSHOT_TIME\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

Export the cloud assets to Google Cloud Storage or BigQuery. Use gcloud asset
operations describe to get the latest status of the operation. Note that to
export a project different from the project you want to bill, you can use
\-\-billing\-project or authenticate with a service account. See
https://cloud.google.com/resource\-manager/docs/cloud\-asset\-inventory/gcloud\-asset
for examples of using a service account.



.SH "EXAMPLES"

To export a snapshot of assets of type 'compute.googleapis.com/Disk' in project
\'test\-project' at '2019\-03\-05T00:00:00Z' to 'gs://bucket\-name/object\-name'
and only export the asset metadata, run:

.RS 2m
$ gcloud asset export \-\-project='test\-project' \e
    \-\-asset\-types='compute.googleapis.com/Disk' \e
    \-\-snapshot\-time='2019\-03\-05T00:00:00Z' \e
    \-\-output\-path='gs://bucket\-name/object\-name' \e
    \-\-content\-type='resource'
.RE

To export a snapshot of assets of type 'compute.googleapis.com/Disk' in project
\'test\-project' at '2019\-03\-05T00:00:00Z' to
\'projects/projectId/datasets/datasetId/tables/table_name', overwrite the table
if existed, run:

.RS 2m
$ gcloud asset export \-\-project='test\-project' \e
    \-\-asset\-types='compute.googleapis.com/Disk' \e
    \-\-snapshot\-time='2019\-03\-05T00:00:00Z' \e
    \-\-bigquery\-table='projects/projectId/datasets/datasetId/tables/t\e
able_name' \-\-output\-bigquery\-force \-\-content\-type='resource'
.RE



.SH "REQUIRED FLAGS"

.RS 2m
.TP 2m

Exactly one of these must be specified:


.RS 2m
.TP 2m
\fB\-\-folder\fR=\fIFOLDER_ID\fR

The ID of the folder which is the root asset.

.TP 2m
\fB\-\-organization\fR=\fIORGANIZATION_ID\fR

The ID of the organization which is the root asset.

.TP 2m
\fB\-\-project\fR=\fIPROJECT_ID\fR

The project which is the root asset.

The Google Cloud project ID to use for this invocation. If omitted, then the
current project is assumed; the current project can be listed using \f5gcloud
config list \-\-format='text(core.project)'\fR and can be set using \f5gcloud
config set project PROJECTID\fR.

\f5\-\-project\fR and its fallback \f5core/project\fR property play two roles in
the invocation. It specifies the project of the resource to operate on. It also
specifies the project for API enablement check, quota, and billing. To specify a
different project for quota and billing, use \f5\-\-billing\-project\fR or
\f5billing/quota_project\fR property.

.RE
.sp
.TP 2m

The destination path for exporting assets.

Exactly one of these must be specified:


.RS 2m
.TP 2m
\fB\-\-output\-path\fR=\fIOUTPUT_PATH\fR

Google Cloud Storage URI where the results will go. URI must start with "gs://".
For example, "gs://bucket_name/object_name"

.TP 2m
\fB\-\-output\-path\-prefix\fR=\fIOUTPUT_PATH_PREFIX\fR

Google Cloud Storage URI where the results will go. URI must start with "gs://".
For example, "gs://bucket_name/object_name_prefix", in which case each exported
object uri is in format: "gs://bucket_name/object_name_prefix/<asset
type>/<shard number>" and it only contains assets for that type.

.TP 2m

The BigQuery destination for exporting assets.


.RS 2m
.TP 2m
\fB\-\-output\-bigquery\-force\fR

If the destination table already exists and this flag is specified, the table
will be overwritten by the contents of assets snapshot. If the flag is not
specified and the destination table already exists, the export call returns an
error.

.TP 2m
\fB\-\-partition\-key\fR=\fIPARTITION_KEY\fR

If specified. the snapshot results will be written to partitioned table(s) with
two additional timestamp columns, readTime and requestTime, one of which will be
the partition key. \fIPARTITION_KEY\fR must be one of: \fBread\-time\fR,
\fBrequest\-time\fR.

.TP 2m
\fB\-\-per\-asset\-type\fR

If the flag is specified, the snapshot results will be written to one or more
tables, each of which contains results of one asset type.

.TP 2m

Table resource \- The bigquery\-table export to. 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\-\-bigquery\-table\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\-\-bigquery\-table\fR=\fIBIGQUERY_TABLE\fR

ID of the table or fully qualified identifier for the table.

To set the \f5table\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5\-\-bigquery\-table\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\-\-bigquery\-dataset\fR=\fIBIGQUERY_DATASET\fR

The id of the BigQuery dataset.

To set the \f5bigquery\-dataset\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5\-\-bigquery\-table\fR on the command line with a fully
specified name;
.IP "\(bu" 2m
provide the argument \f5\-\-bigquery\-dataset\fR on the command line.
.RE
.sp


.RE
.RE
.RE
.RE
.sp

.SH "OPTIONAL FLAGS"

.RS 2m
.TP 2m
\fB\-\-asset\-types\fR=[\fIASSET_TYPES\fR,...]

A list of asset types (i.e., "compute.googleapis.com/Disk") to take a snapshot.
If specified and non\-empty, only assets matching the specified types will be
returned. See
http://cloud.google.com/asset\-inventory/docs/supported\-asset\-types for
supported asset types.

.TP 2m
\fB\-\-content\-type\fR=\fICONTENT_TYPE\fR

Asset content type. If specified, only content matching the specified type will
be returned. Otherwise, no content but the asset name will be returned.
Specifying \f5resource\fR will export resource metadata, specifying
\f5iam\-policy\fR will export the IAM policy for each child asset, specifying
\f5org\-policy\fR will export the Org Policy set on child assets, specifying
\f5access\-policy\fR will export the Access Policy set on child assets,
specifying \f5os\-inventory\fR will export the OS inventory of VM instances, and
specifying \f5relationship\fR will export relationships of the assets.
\fICONTENT_TYPE\fR must be one of: \fBresource\fR, \fBiam\-policy\fR,
\fBorg\-policy\fR, \fBaccess\-policy\fR, \fBos\-inventory\fR,
\fBrelationship\fR.

.TP 2m
\fB\-\-relationship\-types\fR=[\fIRELATIONSHIP_TYPES\fR,...]

A list of relationship types (i.e., "INSTANCE_TO_INSTANCEGROUP") to take a
snapshot. This argument will only be honoured if content_type=RELATIONSHIP. If
specified and non\-empty, only relationships matching the specified types will
be returned. See
http://cloud.google.com/asset\-inventory/docs/supported\-asset\-types for
supported relationship types.

.TP 2m
\fB\-\-snapshot\-time\fR=\fISNAPSHOT_TIME\fR

Timestamp to take a snapshot on assets. This can only be a current or past time.
If not specified, the current time will be used. Due to delays in resource data
collection and indexing, there is a volatile window during which running the
same query at different times may return different results. See $ gcloud topic
datetimes for information on time formats.


.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 asset export
.RE

.RS 2m
$ gcloud beta asset export
.RE