- NAME
- 
- gcloud beta asset search-all-resources - searches all Cloud resources within the specified accessible scope, such as a project, folder or organization
 
- SYNOPSIS
- 
- 
gcloud beta asset search-all-resources[--asset-types=[ASSET_TYPES,โฆ]] [--order-by=ORDER_BY] [--query=QUERY] [--scope=SCOPE] [--filter=EXPRESSION] [--limit=LIMIT] [--page-size=PAGE_SIZE] [--sort-by=[FIELD,โฆ]] [GCLOUD_WIDE_FLAG โฆ]
 
- 
- DESCRIPTION
- 
(BETA)Searches all Cloud resources within the specified scope, such as a project, folder or organization. The caller must be granted thecloudasset.assets.searchAllResources
- EXAMPLES
- 
To search all Cloud resources whose full resource name contains
xyzorganizations/123456cloudasset.assets.searchAllResourcesgcloud beta asset search-all-resources --scope='organizations/123456' --query='name:xyz*'
- FLAGS
- 
- --asset-types=[- ASSET_TYPES,โฆ]
- 
A list of asset types that this request searches for. If empty, it will search
all the searchable
asset types.
Regular expressions are also supported. For example: - 
compute.googleapis.com.*compute.googleapis.com
- 
.*InstanceInstance
- 
.*Instance.*Instance
 See RE2 for all supported regular expression syntax. If the regular expression does not match any supported asset type, an INVALID_ARGUMENT
- 
- --order-by=- ORDER_BY
- 
A comma-separated list of fields specifying the sorting order of the results.
The default order is ascending. Add DESClocation DESC, name- 
name
- 
assetType
- 
project
- 
displayName
- 
description
- 
location
- 
createTime
- 
updateTime
- 
state
- 
parentFullResourceName
- 
parentAssetType
 All the other fields such as repeated fields (e.g., networkTags,kmsKeys), map fields (e.g.,labels) and struct fields (e.g.,additionalAttributes) are not supported.Both --order-byand--sort-byflags can be used to sort the output, with the following differences:- 
The --order-byflag performs server-side sorting (better performance), while the--sort-byflag performs client-side sorting.
- 
The --sort-byflag supports all the fields in the output, while the--order-byflag only supports limited fields as shown above.
 
- 
- --query=- QUERY
- 
The query statement. See how
to construct a query for more details. If not specified or empty, it will
search all the resources within the specified scope.Examples: - 
name:Importantto find Cloud resources whose name containsImportant
- 
name=Importantto find the Cloud resource whose name is exactlyImportant
- 
displayName:Impor*to find Cloud resources whose display name containsImpor
- 
location:us-west*to find Cloud resources whose location contains bothuswest
- 
labels:prodto find Cloud resources whose labels containprod
- 
labels.env:prodto find Cloud resources that have a labelenvprod
- 
labels.env:*to find Cloud resources that have a labelenv
- 
tagKeys:envto find Cloud resources that are directly attached to tags where the `TagKey.namespacedName` containsenv.
- 
tagValues:prod*to find Cloud resources that are directly attached to tags where the `TagValue.namespacedName` contains a word prefixed byprod.
- 
tagValueIds=tagValues/123to find Cloud resources that are directly attached to tags where the `TagValue.name` is exactlytagValues/123.
- 
effectiveTagKeys:envto find Cloud resources that are directly attached to or inherited tags where the `TagKey.namespacedName` containsenv.
- 
effectiveTagValues:prod*to find Cloud resources that are directly attached to or inherited tags where the `TagValue.namespacedName` contains a word prefixed byprod.
- 
effectiveTagValueIds=tagValues/123to find Cloud resources that are directly attached to or inherited tags where the `TagValue.name` is exactlytagValues/123.
- 
kmsKey:keyto find Cloud resources encrypted with a customer-managed encryption key whose name containskeykmsKeysfield to retrieve KMS key information.
- 
kmsKeys:keyto find Cloud resources encrypted with customer-managed encryption keys whose name contains the wordkey
- 
relationships:instance-group-1to find Cloud resources that have relationships withinstance-group-1
- 
relationships:INSTANCE_TO_INSTANCEGROUPto find Compute instances that have relationships of typeINSTANCE_TO_INSTANCEGROUP
- 
relationships.INSTANCE_TO_INSTANCEGROUP:instance-group-1to find Compute instances that have relationships withinstance-group-1INSTANCE_TO_INSTANCEGROUP
- 
sccSecurityMarks.key=valueto find Cloud resources that are attached with security marks whose key iskeyvalue
- 
sccSecurityMarks.key:*to find Cloud resources that are attached with security marks whose key iskey
- 
state:ACTIVEto find Cloud resources whose state containsACTIVE
- 
NOT state:ACTIVEto find Cloud resources whose state doesn't containACTIVE
- 
createTime<1609459200orcreateTime<2021-01-01orcreateTime<"2021-01-01T00:00:00"to find Cloud resources that were created before2021-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC
- 
updateTime>1609459200orupdateTime>2021-01-01orupdateTime>"2021-01-01T00:00:00"to find Cloud resources that were updated after2021-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC
- 
Importantto find Cloud resources that containImportant
- 
Impor*to find Cloud resources that containImpor
- 
Important location:(us-west1 OR global)to find Cloud resources that containImportantus-west1global
 
- 
- --scope=- SCOPE
- 
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
cloudasset.assets.searchAllResourcesgcloud config get project. To change the setting, run:gcloud config set project PROJECT_ID.The allowed values are: - 
projects/{PROJECT_ID}(e.g.,projects/foo-bar
- 
projects/{PROJECT_NUMBER}(e.g.,projects/12345678
- 
folders/{FOLDER_NUMBER}(e.g.,folders/1234567
- 
organizations/{ORGANIZATION_NUMBER}(e.g.organizations/123456
 
- 
 
- LIST COMMAND FLAGS
- 
- --filter=- EXPRESSION
- 
Apply a Boolean filter EXPRESSIONto each resource item to be listed. If the expression evaluatesTrue, 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:--flatten,--sort-by,--filter,--limit.
- --limit=- LIMIT
- 
Maximum number of resources to list. The default is unlimited. This flag interacts with other flags that are applied in this order:--flatten,--sort-by,--filter,--limit.
- --page-size=- PAGE_SIZE
- 
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 unlimited(no paging). Paging may be applied before or after--filterand--limitdepending on the service.
- --sort-by=[- FIELD,โฆ]
- 
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:
--flatten,--sort-by,--filter,--limit.
 
- 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 $ gcloud helpfor details.
- NOTES
- 
This command is currently in beta and might change without notice. This variant
is also available:
gcloud asset search-all-resources
      gcloud beta asset search-all-resources
  
  
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-05-07 UTC.