Search Folders
Search for folders that match specific filter criteria. search()
provides an eventually consistent view of the folders a user has access to which meet the specified filter criteria. This will only return folders on which the caller has the permission resourcemanager.folders.get
.
External Documentation
To learn more, visit the GCP documentation.
Basic Parameters
Parameter | Description |
---|---|
Query | Optional. Search criteria used to select the folders to return. If no search criteria is specified then all accessible folders will be returned. Query expressions can be used to restrict results based upon displayName, state and parent, where the operators = (: ) NOT , AND and OR can be used along with the suffix wildcard symbol * . The displayName field in a query expression should use escaped quotes for values that include whitespace to prevent unexpected behavior. | Field | Description | |-------------------------|----------------------------------------| | displayName | Filters by displayName. | | parent | Filters by parent (for example: folders/123). | | state, lifecycleState | Filters by state. | Some example queries are: * Query displayName=Test* returns Folder resources whose display name starts with "Test". * Query state=ACTIVE returns Folder resources with state set to ACTIVE . * Query parent=folders/123 returns Folder resources that have folders/123 as a parent resource. * Query parent=folders/123 AND state=ACTIVE returns active Folder resources that have folders/123 as a parent resource. * Query displayName=\"Test String\" returns Folder resources with display names that include both "Test" and "String". |
Return All Pages | Automatically fetch all resources, page by page. |
Advanced Parameters
Parameter | Description |
---|---|
Page Size | Optional. The maximum number of folders to return in the response. The server can return fewer folders than requested. If unspecified, server picks an appropriate default. |
Example Output
{
"folders": [
{
"createTime": "Output only. Timestamp when the folder was created.",
"deleteTime": "Output only. Timestamp when the folder was requested to be deleted.",
"displayName": "The folder's display name. A folder's display name must be unique amongst its siblings. For example, no two folders with the same parent can share the same display name. The display name must start and end with a letter or digit, may contain letters, digits, spaces, hyphens and underscores and can be no longer than 30 characters. This is captured by the regular expression: `[\\p{L}\\p{N}]([\\p{L}\\p{N}_- ]{0,28}[\\p{L}\\p{N}])?`.",
"etag": "Output only. A checksum computed by the server based on the current value of the folder resource. This may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.",
"name": "Output only. The resource name of the folder. Its format is `folders/{folder_id}`, for example: \"folders/1234\".",
"parent": "Required. The folder's parent's resource name. Updates to the folder's parent must be performed using MoveFolder.",
"state": "Output only. The lifecycle state of the folder. Updates to the state must be performed using DeleteFolder and UndeleteFolder.",
"updateTime": "Output only. Timestamp when the folder was last modified."
}
],
"nextPageToken": "A pagination token returned from a previous call to `SearchFolders` that indicates from where searching should continue."
}
Workflow Library Example
Search Folders with Gcp and Send Results Via Email
Preview this Workflow on desktop