folders
Creates, updates, deletes, gets or lists a folders
resource.
Overview
Name | folders |
Type | Resource |
Id | google.storage.folders |
Fields
Name | Datatype | Description |
---|---|---|
id | string | The ID of the folder, including the bucket name, folder name. |
name | string | The name of the folder. Required if not specified by URL parameter. |
bucket | string | The name of the bucket containing this folder. |
createTime | string | The creation time of the folder in RFC 3339 format. |
kind | string | The kind of item this is. For folders, this is always storage#folder. |
metageneration | string | The version of the metadata for this folder. Used for preconditions and for detecting changes in metadata. |
pendingRenameInfo | object | Only present if the folder is part of an ongoing rename folder operation. Contains information which can be used to query the operation status. |
selfLink | string | The link to this folder. |
updateTime | string | The modification time of the folder metadata in RFC 3339 format. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | bucket, folder | Returns metadata for the specified folder. Only applicable to buckets with hierarchical namespace enabled. |
list | SELECT | bucket | Retrieves a list of folders matching the criteria. Only applicable to buckets with hierarchical namespace enabled. |
insert | INSERT | bucket | Creates a new folder. Only applicable to buckets with hierarchical namespace enabled. |
delete | DELETE | bucket, folder | Permanently deletes a folder. Only applicable to buckets with hierarchical namespace enabled. |
rename | EXEC | bucket, destinationFolder, sourceFolder | Renames 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.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.storage.folders (
bucket,
bucket,
metageneration,
name,
pendingRenameInfo
)
SELECT
'{{ bucket }}',
'{{ bucket }}',
'{{ metageneration }}',
'{{ name }}',
'{{ pendingRenameInfo }}'
;
- name: your_resource_model_name
props:
- name: bucket
value: string
- name: id
value: string
- name: kind
value: string
- name: metageneration
value: string
- name: name
value: string
- name: selfLink
value: string
- name: createTime
value: string
- name: updateTime
value: string
- name: pendingRenameInfo
value:
- name: operationId
value: string
DELETE
example
Deletes the specified folders
resource.
/*+ delete */
DELETE FROM google.storage.folders
WHERE bucket = '{{ bucket }}'
AND folder = '{{ folder }}';