Skip to main content

folders

Creates, updates, deletes, gets or lists a folders resource.

Overview

Namefolders
TypeResource
Idgoogle.storage.folders

Fields

NameDatatypeDescription
idstringThe ID of the folder, including the bucket name, folder name.
namestringThe name of the folder. Required if not specified by URL parameter.
bucketstringThe name of the bucket containing this folder.
createTimestringThe creation time of the folder in RFC 3339 format.
kindstringThe kind of item this is. For folders, this is always storage#folder.
metagenerationstringThe version of the metadata for this folder. Used for preconditions and for detecting changes in metadata.
pendingRenameInfoobjectOnly present if the folder is part of an ongoing rename folder operation. Contains information which can be used to query the operation status.
selfLinkstringThe link to this folder.
updateTimestringThe modification time of the folder metadata in RFC 3339 format.

Methods

NameAccessible byRequired ParamsDescription
getSELECTbucket, folderReturns metadata for the specified folder. Only applicable to buckets with hierarchical namespace enabled.
listSELECTbucketRetrieves a list of folders matching the criteria. Only applicable to buckets with hierarchical namespace enabled.
insertINSERTbucketCreates a new folder. Only applicable to buckets with hierarchical namespace enabled.
deleteDELETEbucket, folderPermanently deletes a folder. Only applicable to buckets with hierarchical namespace enabled.
renameEXECbucket, destinationFolder, sourceFolderRenames a source folder to a destination folder. Only applicable to buckets with hierarchical namespace enabled.

SELECT examples

Retrieves a list of folders matching the criteria. Only applicable to buckets with hierarchical namespace enabled.

SELECT
id,
name,
bucket,
createTime,
kind,
metageneration,
pendingRenameInfo,
selfLink,
updateTime
FROM google.storage.folders
WHERE bucket = '{{ bucket }}';

INSERT example

Use the following StackQL query and manifest file to create a new folders resource.

/*+ create */
INSERT INTO google.storage.folders (
bucket,
bucket,
metageneration,
name,
pendingRenameInfo
)
SELECT
'{{ bucket }}',
'{{ bucket }}',
'{{ metageneration }}',
'{{ name }}',
'{{ pendingRenameInfo }}'
;

DELETE example

Deletes the specified folders resource.

/*+ delete */
DELETE FROM google.storage.folders
WHERE bucket = '{{ bucket }}'
AND folder = '{{ folder }}';