- HTTP request
- Path parameters
- Query parameters
- Request body
- Response body
- Authorization Scopes
- ResourceSearchResult
- VersionedResource
- AttachedResource
- RelatedResources
- RelatedResource
- Try it!
Searches all Google Cloud resources within the specified scope, such as a project, folder, or organization. The caller must be granted the cloudasset.assets.searchAllResources
permission on the desired scope, otherwise the request will be rejected.
HTTP request
GET https://cloudasset.googleapis.com/v1/{scope=*/*}:searchAllResources
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
scope |
Required. A scope can be a project, a folder, or an organization. The search is limited to the resources within the The allowed values are:
Authorization requires the following IAM permission on the specified resource
|
Query parameters
Parameters | |
---|---|
query |
Optional. The query statement. See how to construct a query for more information. If not specified or empty, it will search all the resources within the specified Examples:
|
assetTypes[] |
Optional. 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:
See RE2 for all supported regular expression syntax. If the regular expression does not match any supported asset type, an INVALID_ARGUMENT error will be returned. |
pageSize |
Optional. The page size for search result pagination. Page size is capped at 500 even if a larger value is given. If set to zero, server will pick an appropriate default. Returned results may be fewer than requested. When this happens, there could be more results as long as |
pageToken |
Optional. If present, then retrieve the next batch of results from the preceding call to this method. |
orderBy |
Optional. A comma-separated list of fields specifying the sorting order of the results. The default order is ascending. Add " DESC" after the field name to indicate descending order. Redundant space characters are ignored. Example: "location DESC, name". Only singular primitive fields in the response are sortable:
All the other fields such as repeated fields (e.g., |
readMask |
Optional. A comma-separated list of fields specifying which fields to be returned in ResourceSearchResult. Only '*' or combination of top level fields can be specified. Field names of both snake_case and camelCase are supported. Examples: The readMask paths must be valid field paths listed but not limited to (both snake_case and camelCase are supported):
If readMask is not specified, all fields except versionedResources will be returned. If only '*' is specified, all fields including versionedResources will be returned. Any invalid field path will trigger INVALID_ARGUMENT error. This is a comma-separated list of fully qualified names of fields. Example: |
Request body
The request body must be empty.
Response body
If successful, the response body contains data with the following structure:
Search all resources response.
JSON representation |
---|
{
"results": [
{
object ( |
Fields | |
---|---|
results[] |
A list of Resources that match the search query. It contains the resource standard metadata information. |
nextPageToken |
If there are more results than those appearing in this response, then |
Authorization Scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
ResourceSearchResult
A result of Resource Search, containing information of a cloud resource. Next ID: 31
JSON representation |
---|
{ "name": string, "assetType": string, "project": string, "folders": [ string ], "organization": string, "displayName": string, "description": string, "location": string, "labels": { string: string, ... }, "networkTags": [ string ], "kmsKey": string, "kmsKeys": [ string ], "createTime": string, "updateTime": string, "state": string, "additionalAttributes": { object }, "parentFullResourceName": string, "versionedResources": [ { object ( |
Fields | |
---|---|
name |
The full resource name of this resource. Example: To search against the
|
assetType |
The type of this resource. Example: To search against the
|
project |
The project that this resource belongs to, in the form of projects/{PROJECT_NUMBER}. This field is available when the resource belongs to a project. To search against
|
folders[] |
The folder(s) that this resource belongs to, in the form of folders/{FOLDER_NUMBER}. This field is available when the resource belongs to one or more folders. To search against
|
organization |
The organization that this resource belongs to, in the form of organizations/{ORGANIZATION_NUMBER}. This field is available when the resource belongs to an organization. To search against
|
displayName |
The display name of this resource. This field is available only when the resource's Protobuf contains it. To search against the
|
description |
One or more paragraphs of text description of this resource. Maximum length could be up to 1M bytes. This field is available only when the resource's Protobuf contains it. To search against the
|
location |
Location can be To search against the
|
labels |
Labels associated with this resource. See Labelling and grouping Google Cloud resources for more information. This field is available only when the resource's Protobuf contains it. To search against the
An object containing a list of |
networkTags[] |
Network tags associated with this resource. Like labels, network tags are a type of annotations used to group Google Cloud resources. See Labelling Google Cloud resources for more information. This field is available only when the resource's Protobuf contains it. To search against the
|
kmsKey |
The Cloud KMS CryptoKey name or CryptoKeyVersion name. This field only presents for the purpose of backward compatibility. Please use the To search against the
|
kmsKeys[] |
The Cloud KMS CryptoKey names or CryptoKeyVersion names. This field is available only when the resource's Protobuf contains it. To search against the
|
createTime |
The create timestamp of this resource, at which the resource was created. The granularity is in seconds. Timestamp.nanos will always be 0. This field is available only when the resource's Protobuf contains it. To search against
A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
updateTime |
The last update timestamp of this resource, at which the resource was last modified or deleted. The granularity is in seconds. Timestamp.nanos will always be 0. This field is available only when the resource's Protobuf contains it. To search against
A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
state |
The state of this resource. Different resources types have different state definitions that are mapped from various fields of different resource types. This field is available only when the resource's Protobuf contains it. Example: If the resource is an instance provided by Compute Engine, its state will include PROVISIONING, STAGING, RUNNING, STOPPING, SUSPENDING, SUSPENDED, REPAIRING, and TERMINATED. See To search against the
|
additionalAttributes |
The additional searchable attributes of this resource. The attributes may vary from one resource type to another. Examples: You can search values of these fields through free text search. However, you should not consume the field programically as the field names and values may change as the Google Cloud service updates to a new incompatible API version. To search against the
|
parentFullResourceName |
The full resource name of this resource's parent, if it has one. To search against the
|
versionedResources[] |
Versioned resource representations of this resource. This is repeated because there could be multiple versions of resource representations during version migration. This |
attachedResources[] |
Attached resources of this resource. For example, an OSConfig Inventory is an attached resource of a Compute Instance. This field is repeated because a resource could have multiple attached resources. This |
relationships |
A map of related resources of this resource, keyed by the relationship type. A relationship type is in the format of {SourceType}_{ACTION}_{DestType}. Example: An object containing a list of |
tagKeys[] |
TagKey namespaced names, in the format of {ORG_ID}/{TAG_KEY_SHORT_NAME}. To search against the
|
tagValues[] |
TagValue namespaced names, in the format of {ORG_ID}/{TAG_KEY_SHORT_NAME}/{TAG_VALUE_SHORT_NAME}. To search against the
|
tagValueIds[] |
TagValue IDs, in the format of tagValues/{TAG_VALUE_ID}. To search against the
|
parentAssetType |
The type of this resource's immediate parent, if there is one. To search against the
|
VersionedResource
Resource representation as defined by the corresponding service providing the resource for a given API version.
JSON representation |
---|
{ "version": string, "resource": { object } } |
Fields | |
---|---|
version |
API version of the resource. Example: If the resource is an instance provided by Compute Engine v1 API as defined in |
resource |
JSON representation of the resource as defined by the corresponding service providing this resource. Example: If the resource is an instance provided by Compute Engine, this field will contain the JSON representation of the instance as defined by Compute Engine: You can find the resource definition for each supported resource type in this table: |
AttachedResource
Attached resource representation, which is defined by the corresponding service provider. It represents an attached resource's payload.
JSON representation |
---|
{
"assetType": string,
"versionedResources": [
{
object ( |
Fields | |
---|---|
assetType |
The type of this attached resource. Example: You can find the supported attached asset types of each resource in this table: |
versionedResources[] |
Versioned resource representations of this attached resource. This is repeated because there could be multiple versions of the attached resource representations during version migration. |
RelatedResources
The related resources of the primary resource.
JSON representation |
---|
{
"relatedResources": [
{
object ( |
Fields | |
---|---|
relatedResources[] |
The detailed related resources of the primary resource. |
RelatedResource
The detailed related resource.
JSON representation |
---|
{ "assetType": string, "fullResourceName": string } |
Fields | |
---|---|
assetType |
The type of the asset. Example: |
fullResourceName |
The full resource name of the related resource. Example: |