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_asset_search-all-resources.1
.TH "GCLOUD_ASSET_SEARCH\-ALL\-RESOURCES" 1



.SH "NAME"
.HP
gcloud asset search\-all\-resources \- searches all Cloud resources within the specified accessible scope, such as a project, folder or organization



.SH "SYNOPSIS"
.HP
\f5gcloud asset search\-all\-resources\fR [\fB\-\-asset\-types\fR=[\fIASSET_TYPES\fR,...]] [\fB\-\-order\-by\fR=\fIORDER_BY\fR] [\fB\-\-query\fR=\fIQUERY\fR] [\fB\-\-read\-mask\fR=\fIREAD_MASK\fR] [\fB\-\-scope\fR=\fISCOPE\fR] [\fB\-\-filter\fR=\fIEXPRESSION\fR] [\fB\-\-limit\fR=\fILIMIT\fR] [\fB\-\-page\-size\fR=\fIPAGE_SIZE\fR] [\fB\-\-sort\-by\fR=[\fIFIELD\fR,...]] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

Searches all Cloud resources within the specified scope, such as a project,
folder or organization. The caller must be granted the
\f5\fIcloudasset.assets.searchAllResources\fR\fR permission on the desired
scope.



.SH "EXAMPLES"

To search all Cloud resources whose full resource name contains \f5\fIxyz\fR\fR
as a prefix of any word, within \f5\fIorganizations/123456\fR\fR, ensure the
caller has been granted the \f5\fIcloudasset.assets.searchAllResources\fR\fR
permission on the organization and run:

.RS 2m
$ gcloud asset search\-all\-resources \-\-scope='organizations/123456' \e
    \-\-query='name:xyz*'
.RE



.SH "FLAGS"

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

A list of asset types that this request searches for. If empty, it will search
all the searchable asset types
(https://cloud.google.com/asset\-inventory/docs/supported\-asset\-types).

Regular expressions are also supported. For example:

.RS 2m
.IP "\(em" 2m
\f5\fIcompute.googleapis.com.*\fR\fR snapshots resources whose asset type starts
with \f5\fIcompute.googleapis.com\fR\fR.
.IP "\(em" 2m
\f5\fI.*Instance\fR\fR snapshots resources whose asset type ends with
\f5\fIInstance\fR\fR.
.IP "\(em" 2m
\f5\fI.*Instance.*\fR\fR snapshots resources whose asset type contains
\f5\fIInstance\fR\fR.
.RE
.sp

See RE2 (https://github.com/google/re2/wiki/Syntax) for all supported regular
expression syntax. If the regular expression does not match any supported asset
type, an \f5\fIINVALID_ARGUMENT\fR\fR error will be returned.

.TP 2m
\fB\-\-order\-by\fR=\fIORDER_BY\fR

A comma\-separated list of fields specifying the sorting order of the results.
The default order is ascending. Add \f5\fI DESC\fR\fR after the field name to
indicate descending order. Redundant space characters are ignored. Example:
\f5\fIlocation DESC, name\fR\fR. Only singular primitive fields in the response
are sortable:

.RS 2m
.IP "\(em" 2m
\f5name\fR
.IP "\(em" 2m
\f5assetType\fR
.IP "\(em" 2m
\f5project\fR
.IP "\(em" 2m
\f5displayName\fR
.IP "\(em" 2m
\f5description\fR
.IP "\(em" 2m
\f5location\fR
.IP "\(em" 2m
\f5createTime\fR
.IP "\(em" 2m
\f5updateTime\fR
.IP "\(em" 2m
\f5state\fR
.IP "\(em" 2m
\f5parentFullResourceName\fR
.IP "\(em" 2m
\f5parentAssetType\fR
.RE
.sp

All the other fields such as repeated fields (e.g., \f5networkTags\fR,
\f5kmsKeys\fR), map fields (e.g., \f5labels\fR) and struct fields (e.g.,
\f5additionalAttributes\fR) are not supported.

Both \f5\-\-order\-by\fR and \f5\-\-sort\-by\fR flags can be used to sort the
output, with the following differences:

.RS 2m
.IP "\(em" 2m
The \f5\-\-order\-by\fR flag performs server\-side sorting (better performance),
while the \f5\-\-sort\-by\fR flag performs client\-side sorting.
.IP "\(em" 2m
The \f5\-\-sort\-by\fR flag supports all the fields in the output, while the
\f5\-\-order\-by\fR flag only supports limited fields as shown above.
.RE
.sp

.TP 2m
\fB\-\-query\fR=\fIQUERY\fR

The query statement. See how to construct a query
(https://cloud.google.com/asset\-inventory/docs/searching\-resources#how_to_construct_a_query)
for more details. If not specified or empty, it will search all the resources
within the specified \f5scope\fR.

Examples:

.RS 2m
.IP "\(em" 2m
\f5name:Important\fR to find Cloud resources whose name contains
\f5\fIImportant\fR\fR as a word.
.IP "\(em" 2m
\f5name=Important\fR to find the Cloud resource whose name is exactly
\f5\fIImportant\fR\fR.
.IP "\(em" 2m
\f5displayName:Impor*\fR to find Cloud resources whose display name contains
\f5\fIImpor\fR\fR as a prefix of any word.
.IP "\(em" 2m
\f5location:us\-west*\fR to find Cloud resources whose location contains both
\f5\fIus\fR\fR and \f5\fIwest\fR\fR as prefixes.
.IP "\(em" 2m
\f5labels:prod\fR to find Cloud resources whose labels contain \f5\fIprod\fR\fR
as a key or value.
.IP "\(em" 2m
\f5labels.env:prod\fR to find Cloud resources that have a label \f5\fIenv\fR\fR
and its value is \f5\fIprod\fR\fR.
.IP "\(em" 2m
\f5labels.env:*\fR to find Cloud resources that have a label \f5\fIenv\fR\fR.
.IP "\(em" 2m
\f5tagKeys:env\fR to find Cloud resources that are directly attached to tags
where the `TagKey.namespacedName`
(https://cloud.google.com/resource\-manager/reference/rest/v3/tagKeys#resource:\-tagkey)
contains \f5env\fR.
.IP "\(em" 2m
\f5tagValues:prod*\fR to find Cloud resources that are directly attached to tags
where the `TagValue.namespacedName`
(https://cloud.google.com/resource\-manager/reference/rest/v3/tagValues#resource:\-tagvalue)
contains a word prefixed by \f5prod\fR.
.IP "\(em" 2m
\f5tagValueIds=tagValues/123\fR to find Cloud resources that are directly
attached to tags where the `TagValue.name`
(https://cloud.google.com/resource\-manager/reference/rest/v3/tagValues#resource:\-tagvalue)
is exactly \f5tagValues/123\fR.
.IP "\(em" 2m
\f5effectiveTagKeys:env\fR to find Cloud resources that are directly attached to
or inherited tags where the `TagKey.namespacedName`
(https://cloud.google.com/resource\-manager/reference/rest/v3/tagKeys#resource:\-tagkey)
contains \f5env\fR.
.IP "\(em" 2m
\f5effectiveTagValues:prod*\fR to find Cloud resources that are directly
attached to or inherited tags where the `TagValue.namespacedName`
(https://cloud.google.com/resource\-manager/reference/rest/v3/tagValues#resource:\-tagvalue)
contains a word prefixed by \f5prod\fR.
.IP "\(em" 2m
\f5effectiveTagValueIds=tagValues/123\fR to find Cloud resources that are
directly attached to or inherited tags where the `TagValue.name`
(https://cloud.google.com/resource\-manager/reference/rest/v3/tagValues#resource:\-tagvalue)
is exactly \f5tagValues/123\fR.
.IP "\(em" 2m
\f5kmsKey:key\fR to find Cloud resources encrypted with a customer\-managed
encryption key whose name contains \f5\fIkey\fR\fR as a word. This field is
deprecated. Please use the \f5kmsKeys\fR field to retrieve KMS key information.
.IP "\(em" 2m
\f5kmsKeys:key\fR to find Cloud resources encrypted with customer\-managed
encryption keys whose name contains the word \f5\fIkey\fR\fR.
.IP "\(em" 2m
\f5relationships:instance\-group\-1\fR to find Cloud resources that have
relationships with \f5\fIinstance\-group\-1\fR\fR in the related resource name.
.IP "\(em" 2m
\f5relationships:INSTANCE_TO_INSTANCEGROUP\fR to find Compute instances that
have relationships of type \f5\fIINSTANCE_TO_INSTANCEGROUP\fR\fR.
.IP "\(em" 2m
\f5relationships.INSTANCE_TO_INSTANCEGROUP:instance\-group\-1\fR to find Compute
instances that have relationships with \f5\fIinstance\-group\-1\fR\fR in the
Compute instance group resource name, for relationship type
\f5\fIINSTANCE_TO_INSTANCEGROUP\fR\fR.
.IP "\(em" 2m
\f5sccSecurityMarks.key=value\fR to find Cloud resources that are attached with
security marks whose key is \f5\fIkey\fR\fR and value is \f5\fIvalue\fR\fR.
.IP "\(em" 2m
\f5sccSecurityMarks.key:*\fR to find Cloud resources that are attached with
security marks whose key is \f5\fIkey\fR\fR.
.IP "\(em" 2m
\f5state:ACTIVE\fR to find Cloud resources whose state contains
\f5\fIACTIVE\fR\fR as a word.
.IP "\(em" 2m
\f5NOT state:ACTIVE\fR to find Cloud resources whose state doesn't contain
\f5\fIACTIVE\fR\fR as a word.
.IP "\(em" 2m
\f5createTime<1609459200\fR or \f5createTime<2021\-01\-01\fR or
\f5createTime<"2021\-01\-01T00:00:00"\fR to find Cloud resources that were
created before \f5\fI2021\-01\-01 00:00:00 UTC\fR\fR. 1609459200 is the epoch
timestamp of \f5\fI2021\-01\-01 00:00:00 UTC\fR\fR in seconds.
.IP "\(em" 2m
\f5updateTime>1609459200\fR or \f5updateTime>2021\-01\-01\fR or
\f5updateTime>"2021\-01\-01T00:00:00"\fR to find Cloud resources that were
updated after \f5\fI2021\-01\-01 00:00:00 UTC\fR\fR. 1609459200 is the epoch
timestamp of \f5\fI2021\-01\-01 00:00:00 UTC\fR\fR in seconds.
.IP "\(em" 2m
\f5Important\fR to find Cloud resources that contain \f5\fIImportant\fR\fR as a
word in any of the searchable fields.
.IP "\(em" 2m
\f5Impor*\fR to find Cloud resources that contain \f5\fIImpor\fR\fR as a prefix
of any word in any of the searchable fields.
.IP "\(em" 2m
\f5Important location:(us\-west1 OR global)\fR to find Cloud resources that
contain \f5\fIImportant\fR\fR as a word in any of the searchable fields and are
also located in the \f5\fIus\-west1\fR\fR region or the \f5\fIglobal\fR\fR
location.
.RE
.sp

.TP 2m
\fB\-\-read\-mask\fR=\fIREAD_MASK\fR

A comma\-separated list of fields specifying which fields to be returned in the
results. Only \f5"*"\fR or combination of top level fields can be specified.
Examples: \f5"*"\fR, \f5"name,location"\fR, \f5"name,versionedResources"\fR.

The read_mask paths must be valid field paths listed but not limited to the
following (both snake_case and camelCase are supported):
.RS 2m
.IP "\(em" 2m
\f5name\fR
.IP "\(em" 2m
\f5asset_type\fR or \f5assetType\fR
.IP "\(em" 2m
\f5project\fR
.IP "\(em" 2m
\f5display_name\fR or \f5displayName\fR
.IP "\(em" 2m
\f5description\fR
.IP "\(em" 2m
\f5location\fR
.IP "\(em" 2m
\f5labels\fR
.IP "\(em" 2m
\f5tags\fR
.IP "\(em" 2m
\f5effective_tags\fR or \f5effectiveTags\fR
.IP "\(em" 2m
\f5network_tags\fR or \f5networkTags\fR
.IP "\(em" 2m
\f5kms_keys\fR or \f5kmsKeys\fR
.IP "\(em" 2m
\f5create_time\fR or \f5createTime\fR
.IP "\(em" 2m
\f5update_time\fR or \f5updateTime\fR
.IP "\(em" 2m
\f5state\fR
.IP "\(em" 2m
\f5additional_attributes\fR or \f5additionalAttributes\fR
.IP "\(em" 2m
\f5versioned_resources\fR or \f5versionedResources\fR
.RE
.sp

If read_mask is not specified, all fields except versionedResources will be
returned.

If only \f5"*"\fR is specified, all fields including versionedResources will be
returned.

.TP 2m
\fB\-\-scope\fR=\fISCOPE\fR

A scope can be a project, a folder, or an organization. The search is limited to
the Cloud resources within this scope. The caller must be granted the
\f5\fIcloudasset.assets.searchAllResources\fR\fR permission on the desired
scope. If not specified, the configured project property
(https://cloud.google.com//sdk/docs/configurations#setting_configuration_properties)
will be used. To find the configured project, run: \f5gcloud config get
project\fR. To change the setting, run: \f5gcloud config set project
PROJECT_ID\fR.

The allowed values are:

.RS 2m
.IP "\(em" 2m
\f5projects/{PROJECT_ID}\fR (e.g., \f5\fIprojects/foo\-bar\fR\fR)
.IP "\(em" 2m
\f5projects/{PROJECT_NUMBER}\fR (e.g., \f5\fIprojects/12345678\fR\fR)
.IP "\(em" 2m
\f5folders/{FOLDER_NUMBER}\fR (e.g., \f5\fIfolders/1234567\fR\fR)
.IP "\(em" 2m
\f5organizations/{ORGANIZATION_NUMBER}\fR (e.g.
\f5\fIorganizations/123456\fR\fR)
.RE
.sp


.RE
.sp

.SH "LIST COMMAND FLAGS"

.RS 2m
.TP 2m
\fB\-\-filter\fR=\fIEXPRESSION\fR

Apply a Boolean filter \fIEXPRESSION\fR to each resource item to be listed. If
the expression evaluates \f5True\fR, then that item is listed. For more details
and examples of filter expressions, run $ gcloud topic filters. This flag
interacts with other flags that are applied in this order: \fB\-\-flatten\fR,
\fB\-\-sort\-by\fR, \fB\-\-filter\fR, \fB\-\-limit\fR.

.TP 2m
\fB\-\-limit\fR=\fILIMIT\fR

Maximum number of resources to list. The default is \fBunlimited\fR. This flag
interacts with other flags that are applied in this order: \fB\-\-flatten\fR,
\fB\-\-sort\-by\fR, \fB\-\-filter\fR, \fB\-\-limit\fR.

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

Some services group resource list output into pages. This flag specifies the
maximum number of resources per page. The default is determined by the service
if it supports paging, otherwise it is \fBunlimited\fR (no paging). Paging may
be applied before or after \fB\-\-filter\fR and \fB\-\-limit\fR depending on the
service.

.TP 2m
\fB\-\-sort\-by\fR=[\fIFIELD\fR,...]

Comma\-separated list of resource field key names to sort by. The default order
is ascending. Prefix a field with ``~'' for descending order on that field. This
flag interacts with other flags that are applied in this order:
\fB\-\-flatten\fR, \fB\-\-sort\-by\fR, \fB\-\-filter\fR, \fB\-\-limit\fR.


.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 variant is also available:

.RS 2m
$ gcloud beta asset search\-all\-resources
.RE