Skip to main content

List Folders

Lists the folders that are direct descendants of supplied parent resource. list() provides a strongly consistent view of the folders underneath the specified parent resource. list() returns folders sorted based upon the (ascending) lexical ordering of their display_name. The caller must have resourcemanager.folders.list permission on the identified parent.

External Documentation

To learn more, visit the GCP documentation.

Basic Parameters

ParameterDescription
ParentRequired. The name of the parent resource whose folders are being listed. Only children of this parent resource are listed; descendants are not listed. If the parent is a folder, use the value folders/{folder_id}. If the parent is an organization, use the value organizations/{org_id}. Access to this method is controlled by checking the resourcemanager.folders.list permission on the parent.
Return All PagesAutomatically fetch all resources, page by page.

Advanced Parameters

ParameterDescription
Page SizeOptional. 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.
Show DeletedOptional. Controls whether folders in the DELETE_REQUESTED state should be returned. Defaults to false.

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 `ListFolders` that indicates from where listing should continue."
}

Workflow Library Example

List Folders with Gcp and Send Results Via Email

Workflow LibraryPreview this Workflow on desktop