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/current/help/man/man1/gcloud_beta_asset_query.1
.TH "GCLOUD_BETA_ASSET_QUERY" 1



.SH "NAME"
.HP
gcloud beta asset query \- query the Cloud assets



.SH "SYNOPSIS"
.HP
\f5gcloud beta asset query\fR (\fB\-\-folder\fR=\fIFOLDER_ID\fR\ |\ \fB\-\-organization\fR=\fIORGANIZATION_ID\fR\ |\ \fB\-\-project\fR=\fIPROJECT_ID\fR) (\fB\-\-job\-reference\fR=\fIJOB_REFERENCE\fR\ |\ \fB\-\-statement\fR=\fISTATEMENT\fR) [\fB\-\-page\-size\fR=\fIPAGE_SIZE\fR] [\fB\-\-page\-token\fR=\fIPAGE_TOKEN\fR] [\fB\-\-timeout\fR=\fITIMEOUT\fR] [\fB\-\-snapshot\-time\fR=\fISNAPSHOT_TIME\fR\ |\ [\fB\-\-start\-time\fR=\fISTART_TIME\fR\ :\ \fB\-\-end\-time\fR=\fIEND_TIME\fR]] [\fB\-\-write\-disposition\fR=\fIWRITE_DISPOSITION\fR\ [\fB\-\-bigquery\-table\fR=\fIBIGQUERY_TABLE\fR\ :\ \fB\-\-bigquery\-dataset\fR=\fIBIGQUERY_DATASET\fR]] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

\fB(BETA)\fR Issue an analytical query on Cloud assets using a BigQuery Standard
SQL compatible statement.



.SH "EXAMPLES"

To count the number of compute instances, run:

.RS 2m
$ gcloud beta asset query \-\-project='test\-project' \e
    \-\-statement='SELECT * FROM compute_googleapis_com_Instance'
.RE

To see the query result of the previous job, pass the job\-reference from the
previous response:

.RS 2m
$ gcloud beta asset query \-\-project='test\-project' \e
    \-\-job\-reference=<job\-reference\-from>
.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 query or job reference of the query request.

Exactly one of these must be specified:


.RS 2m
.TP 2m
\fB\-\-job\-reference\fR=\fIJOB_REFERENCE\fR

Reference to the query job, which is from the previous call.

.TP 2m
\fB\-\-statement\fR=\fISTATEMENT\fR

A BigQuery Standard SQL compatible statement. If the query execution finishes
within timeout and there is no pagination, the full query results will be
returned. Otherwise, pass job_reference from previous call as
\f5\-\-job\-reference\fR to obtain the full results.


.RE
.RE
.sp

.SH "OPTIONAL FLAGS"

.RS 2m
.TP 2m
\fB\-\-page\-size\fR=\fIPAGE_SIZE\fR

The maximum number of rows to return in the results. One page is also limited to
10 MB.

.TP 2m
\fB\-\-page\-token\fR=\fIPAGE_TOKEN\fR

A page token received from previous call.

.TP 2m
\fB\-\-timeout\fR=\fITIMEOUT\fR

Maximum amount of time that the client will wait for the query to complete.

.TP 2m

Specifies what time period or point in time to query asset metadata at.

At most one of these can be specified:


.RS 2m
.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.

.TP 2m

Specifies what time period or point in time to query asset metadata at.


.RS 2m
.TP 2m
\fB\-\-start\-time\fR=\fISTART_TIME\fR

Start time of the time window (inclusive) for the asset history. Must be after
the current time minus 35 days. See $ gcloud topic datetimes for information on
time formats.

This flag argument must be specified if any of the other arguments in this group
are specified.

.TP 2m
\fB\-\-end\-time\fR=\fIEND_TIME\fR

End time of the time window (exclusive) for the asset history. Defaults to
current time if not specified. See $ gcloud topic datetimes for information on
time formats.

.RE
.RE
.sp
.TP 2m

The BigQuery destination for query system.


.RS 2m
.TP 2m
\fB\-\-write\-disposition\fR=\fIWRITE_DISPOSITION\fR

Specifies the action that occurs if the destination table or partition already
exists. \fIWRITE_DISPOSITION\fR must be one of:

.RS 2m
.TP 2m
\fBwrite\-append\fR
If the table or partition already exists, BigQuery appends the data to the table
or the latest partition.
.TP 2m
\fBwrite\-empty\fR
If the table already exists and contains data, an error is returned.
.TP 2m
\fBwrite\-truncate\fR
If the table or partition already exists, BigQuery overwrites the entire table
or all the partition's data.
.RE
.sp


.TP 2m

Table resource \- The bigquery\-table for the export. 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 "\(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\-\-project\fR on the command line;
.IP "\(bu" 2m
set the property \f5core/project\fR.
.RE
.sp


.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 "\(em" 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 "\(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\-\-bigquery\-dataset\fR on the command line.
.RE
.sp


.RE
.RE
.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"

This command is currently in beta and might change without notice. These
variants are also available:

.RS 2m
$ gcloud asset query
.RE

.RS 2m
$ gcloud alpha asset query
.RE