buckets
Creates, updates, deletes, gets or lists a buckets
resource.
Overview
Name | buckets |
Type | Resource |
Id | google.storage.buckets |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
id | string | The ID of the bucket. For buckets, the id and name properties are the same. |
name | string | The name of the bucket. |
acl | array | Access controls on the bucket. |
autoclass | object | The bucket's Autoclass configuration. |
billing | object | The bucket's billing configuration. |
cors | array | The bucket's Cross-Origin Resource Sharing (CORS) configuration. |
customPlacementConfig | object | The bucket's custom placement configuration for Custom Dual Regions. |
defaultEventBasedHold | boolean | The default value for event-based hold on newly created objects in this bucket. Event-based hold is a way to retain objects indefinitely until an event occurs, signified by the hold's release. After being released, such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false. Objects under event-based hold cannot be deleted, overwritten or archived until the hold is removed. |
defaultObjectAcl | array | Default access controls to apply to new objects when no ACL is provided. |
encryption | object | Encryption configuration for a bucket. |
etag | string | HTTP 1.1 Entity tag for the bucket. |
generation | string (int64) | The generation of this bucket. |
hardDeleteTime | string (date-time) | The hard delete time of the bucket in RFC 3339 format. |
hierarchicalNamespace | object | The bucket's hierarchical namespace configuration. |
iamConfiguration | object | The bucket's IAM configuration. |
ipFilter | object | The bucket's IP filter configuration. Specifies the network sources that are allowed to access the operations on the bucket, as well as its underlying objects. Only enforced when the mode is set to 'Enabled'. |
kind | string | The kind of item this is. For buckets, this is always storage#bucket. (default: storage#bucket) |
labels | object | User-provided labels, in key/value pairs. |
lifecycle | object | The bucket's lifecycle configuration. See Lifecycle Management for more information. |
location | string | The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US. See the Developer's Guide for the authoritative list. |
locationType | string | The type of the bucket location. |
logging | object | The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs. |
metageneration | string (int64) | The metadata generation of this bucket. |
objectRetention | object | The bucket's object retention config. |
owner | object | The owner of the bucket. This is always the project team's owner group. |
projectNumber | string (uint64) | The project number of the project the bucket belongs to. |
retentionPolicy | object | The bucket's retention policy. The retention policy enforces a minimum retention time for all objects contained in the bucket, based on their creation time. Any attempt to overwrite or delete objects younger than the retention period will result in a PERMISSION_DENIED error. An unlocked retention policy can be modified or removed from the bucket via a storage.buckets.update operation. A locked retention policy cannot be removed or shortened in duration for the lifetime of the bucket. Attempting to remove or decrease period of a locked retention policy will result in a PERMISSION_DENIED error. |
rpo | string | The Recovery Point Objective (RPO) of this bucket. Set to ASYNC_TURBO to turn on Turbo Replication on a bucket. |
satisfiesPZI | boolean | Reserved for future use. |
satisfiesPZS | boolean | Reserved for future use. |
selfLink | string | The URI of this bucket. |
softDeletePolicy | object | The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. |
softDeleteTime | string (date-time) | The soft delete time of the bucket in RFC 3339 format. |
storageClass | string | The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, ARCHIVE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see Storage Classes. |
timeCreated | string (date-time) | The creation time of the bucket in RFC 3339 format. |
updated | string (date-time) | The modification time of the bucket in RFC 3339 format. |
versioning | object | The bucket's versioning configuration. |
website | object | The bucket's website configuration, controlling how the service behaves when accessing bucket contents as a web site. See the Static Website Examples for more information. |
Successful response
Name | Datatype | Description |
---|---|---|
id | string | The ID of the bucket. For buckets, the id and name properties are the same. |
name | string | The name of the bucket. |
acl | array | Access controls on the bucket. |
autoclass | object | The bucket's Autoclass configuration. |
billing | object | The bucket's billing configuration. |
cors | array | The bucket's Cross-Origin Resource Sharing (CORS) configuration. |
customPlacementConfig | object | The bucket's custom placement configuration for Custom Dual Regions. |
defaultEventBasedHold | boolean | The default value for event-based hold on newly created objects in this bucket. Event-based hold is a way to retain objects indefinitely until an event occurs, signified by the hold's release. After being released, such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false. Objects under event-based hold cannot be deleted, overwritten or archived until the hold is removed. |
defaultObjectAcl | array | Default access controls to apply to new objects when no ACL is provided. |
encryption | object | Encryption configuration for a bucket. |
etag | string | HTTP 1.1 Entity tag for the bucket. |
generation | string (int64) | The generation of this bucket. |
hardDeleteTime | string (date-time) | The hard delete time of the bucket in RFC 3339 format. |
hierarchicalNamespace | object | The bucket's hierarchical namespace configuration. |
iamConfiguration | object | The bucket's IAM configuration. |
ipFilter | object | The bucket's IP filter configuration. Specifies the network sources that are allowed to access the operations on the bucket, as well as its underlying objects. Only enforced when the mode is set to 'Enabled'. |
kind | string | The kind of item this is. For buckets, this is always storage#bucket. (default: storage#bucket) |
labels | object | User-provided labels, in key/value pairs. |
lifecycle | object | The bucket's lifecycle configuration. See Lifecycle Management for more information. |
location | string | The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US. See the Developer's Guide for the authoritative list. |
locationType | string | The type of the bucket location. |
logging | object | The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs. |
metageneration | string (int64) | The metadata generation of this bucket. |
objectRetention | object | The bucket's object retention config. |
owner | object | The owner of the bucket. This is always the project team's owner group. |
projectNumber | string (uint64) | The project number of the project the bucket belongs to. |
retentionPolicy | object | The bucket's retention policy. The retention policy enforces a minimum retention time for all objects contained in the bucket, based on their creation time. Any attempt to overwrite or delete objects younger than the retention period will result in a PERMISSION_DENIED error. An unlocked retention policy can be modified or removed from the bucket via a storage.buckets.update operation. A locked retention policy cannot be removed or shortened in duration for the lifetime of the bucket. Attempting to remove or decrease period of a locked retention policy will result in a PERMISSION_DENIED error. |
rpo | string | The Recovery Point Objective (RPO) of this bucket. Set to ASYNC_TURBO to turn on Turbo Replication on a bucket. |
satisfiesPZI | boolean | Reserved for future use. |
satisfiesPZS | boolean | Reserved for future use. |
selfLink | string | The URI of this bucket. |
softDeletePolicy | object | The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted. |
softDeleteTime | string (date-time) | The soft delete time of the bucket in RFC 3339 format. |
storageClass | string | The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, ARCHIVE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see Storage Classes. |
timeCreated | string (date-time) | The creation time of the bucket in RFC 3339 format. |
updated | string (date-time) | The modification time of the bucket in RFC 3339 format. |
versioning | object | The bucket's versioning configuration. |
website | object | The bucket's website configuration, controlling how the service behaves when accessing bucket contents as a web site. See the Static Website Examples for more information. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | bucket | generation , softDeleted , ifMetagenerationMatch , ifMetagenerationNotMatch , projection , userProject | Returns metadata for the specified bucket. |
list | select | project | maxResults , pageToken , prefix , softDeleted , projection , userProject | Retrieves a list of buckets for a given project. |
insert | insert | project | predefinedAcl , predefinedDefaultObjectAcl , projection , userProject , enableObjectRetention | Creates a new bucket. |
patch | update | bucket | ifMetagenerationMatch , ifMetagenerationNotMatch , predefinedAcl , predefinedDefaultObjectAcl , projection , userProject | Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate. |
update | replace | bucket | ifMetagenerationMatch , ifMetagenerationNotMatch , predefinedAcl , predefinedDefaultObjectAcl , projection , userProject | Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate. |
delete | delete | bucket | ifMetagenerationMatch , ifMetagenerationNotMatch , userProject | Deletes an empty bucket. Deletions are permanent unless soft delete is enabled on the bucket. |
restore | exec | bucket , generation | projection , userProject | Restores a soft-deleted bucket. |
relocate | exec | bucket | Initiates a long-running Relocate Bucket operation on the specified bucket. | |
lock_retention_policy | exec | bucket , ifMetagenerationMatch | userProject | Locks retention policy on a bucket. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
bucket | string | |
generation | string (int64) | |
ifMetagenerationMatch | string (int64) | |
project | string | |
enableObjectRetention | boolean | |
generation | string (int64) | |
ifMetagenerationMatch | string (int64) | |
ifMetagenerationNotMatch | string (int64) | |
maxResults | integer (uint32) | |
pageToken | string | |
predefinedAcl | string | |
predefinedDefaultObjectAcl | string | |
prefix | string | |
projection | string | |
softDeleted | boolean | |
userProject | string |
SELECT
examples
- get
- list
Returns metadata for the specified bucket.
SELECT
id,
name,
acl,
autoclass,
billing,
cors,
customPlacementConfig,
defaultEventBasedHold,
defaultObjectAcl,
encryption,
etag,
generation,
hardDeleteTime,
hierarchicalNamespace,
iamConfiguration,
ipFilter,
kind,
labels,
lifecycle,
location,
locationType,
logging,
metageneration,
objectRetention,
owner,
projectNumber,
retentionPolicy,
rpo,
satisfiesPZI,
satisfiesPZS,
selfLink,
softDeletePolicy,
softDeleteTime,
storageClass,
timeCreated,
updated,
versioning,
website
FROM google.storage.buckets
WHERE bucket = '{{ bucket }}' -- required
AND generation = '{{ generation }}'
AND softDeleted = '{{ softDeleted }}'
AND ifMetagenerationMatch = '{{ ifMetagenerationMatch }}'
AND ifMetagenerationNotMatch = '{{ ifMetagenerationNotMatch }}'
AND projection = '{{ projection }}'
AND userProject = '{{ userProject }}';
Retrieves a list of buckets for a given project.
SELECT
id,
name,
acl,
autoclass,
billing,
cors,
customPlacementConfig,
defaultEventBasedHold,
defaultObjectAcl,
encryption,
etag,
generation,
hardDeleteTime,
hierarchicalNamespace,
iamConfiguration,
ipFilter,
kind,
labels,
lifecycle,
location,
locationType,
logging,
metageneration,
objectRetention,
owner,
projectNumber,
retentionPolicy,
rpo,
satisfiesPZI,
satisfiesPZS,
selfLink,
softDeletePolicy,
softDeleteTime,
storageClass,
timeCreated,
updated,
versioning,
website
FROM google.storage.buckets
WHERE project = '{{ project }}' -- required
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
AND prefix = '{{ prefix }}'
AND softDeleted = '{{ softDeleted }}'
AND projection = '{{ projection }}'
AND userProject = '{{ userProject }}';
INSERT
examples
- insert
- Manifest
Creates a new bucket.
INSERT INTO google.storage.buckets (
data__acl,
data__billing,
data__cors,
data__customPlacementConfig,
data__defaultEventBasedHold,
data__defaultObjectAcl,
data__encryption,
data__etag,
data__hierarchicalNamespace,
data__iamConfiguration,
data__id,
data__ipFilter,
data__kind,
data__labels,
data__lifecycle,
data__autoclass,
data__location,
data__locationType,
data__logging,
data__generation,
data__metageneration,
data__name,
data__owner,
data__projectNumber,
data__retentionPolicy,
data__objectRetention,
data__rpo,
data__selfLink,
data__softDeletePolicy,
data__storageClass,
data__timeCreated,
data__updated,
data__softDeleteTime,
data__hardDeleteTime,
data__versioning,
data__website,
data__satisfiesPZS,
data__satisfiesPZI,
project,
predefinedAcl,
predefinedDefaultObjectAcl,
projection,
userProject,
enableObjectRetention
)
SELECT
'{{ acl }}',
'{{ billing }}',
'{{ cors }}',
'{{ customPlacementConfig }}',
{{ defaultEventBasedHold }},
'{{ defaultObjectAcl }}',
'{{ encryption }}',
'{{ etag }}',
'{{ hierarchicalNamespace }}',
'{{ iamConfiguration }}',
'{{ id }}',
'{{ ipFilter }}',
'{{ kind }}',
'{{ labels }}',
'{{ lifecycle }}',
'{{ autoclass }}',
'{{ location }}',
'{{ locationType }}',
'{{ logging }}',
'{{ generation }}',
'{{ metageneration }}',
'{{ name }}',
'{{ owner }}',
'{{ projectNumber }}',
'{{ retentionPolicy }}',
'{{ objectRetention }}',
'{{ rpo }}',
'{{ selfLink }}',
'{{ softDeletePolicy }}',
'{{ storageClass }}',
'{{ timeCreated }}',
'{{ updated }}',
'{{ softDeleteTime }}',
'{{ hardDeleteTime }}',
'{{ versioning }}',
'{{ website }}',
{{ satisfiesPZS }},
{{ satisfiesPZI }},
'{{ project }}',
'{{ predefinedAcl }}',
'{{ predefinedDefaultObjectAcl }}',
'{{ projection }}',
'{{ userProject }}',
'{{ enableObjectRetention }}'
RETURNING
id,
name,
acl,
autoclass,
billing,
cors,
customPlacementConfig,
defaultEventBasedHold,
defaultObjectAcl,
encryption,
etag,
generation,
hardDeleteTime,
hierarchicalNamespace,
iamConfiguration,
ipFilter,
kind,
labels,
lifecycle,
location,
locationType,
logging,
metageneration,
objectRetention,
owner,
projectNumber,
retentionPolicy,
rpo,
satisfiesPZI,
satisfiesPZS,
selfLink,
softDeletePolicy,
softDeleteTime,
storageClass,
timeCreated,
updated,
versioning,
website
;
# Description fields are for documentation purposes
- name: buckets
props:
- name: project
value: string
description: Required parameter for the buckets resource.
- name: acl
value: array
description: >
Access controls on the bucket.
- name: billing
value: object
description: >
The bucket's billing configuration.
- name: cors
value: array
description: >
The bucket's Cross-Origin Resource Sharing (CORS) configuration.
- name: customPlacementConfig
value: object
description: >
The bucket's custom placement configuration for Custom Dual Regions.
- name: defaultEventBasedHold
value: boolean
description: >
The default value for event-based hold on newly created objects in this bucket. Event-based hold is a way to retain objects indefinitely until an event occurs, signified by the hold's release. After being released, such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false. Objects under event-based hold cannot be deleted, overwritten or archived until the hold is removed.
- name: defaultObjectAcl
value: array
description: >
Default access controls to apply to new objects when no ACL is provided.
- name: encryption
value: object
description: >
Encryption configuration for a bucket.
- name: etag
value: string
description: >
HTTP 1.1 Entity tag for the bucket.
- name: hierarchicalNamespace
value: object
description: >
The bucket's hierarchical namespace configuration.
- name: iamConfiguration
value: object
description: >
The bucket's IAM configuration.
- name: id
value: string
description: >
The ID of the bucket. For buckets, the id and name properties are the same.
- name: ipFilter
value: object
description: >
The bucket's IP filter configuration. Specifies the network sources that are allowed to access the operations on the bucket, as well as its underlying objects. Only enforced when the mode is set to 'Enabled'.
- name: kind
value: string
description: >
The kind of item this is. For buckets, this is always storage#bucket.
default: storage#bucket
- name: labels
value: object
description: >
User-provided labels, in key/value pairs.
- name: lifecycle
value: object
description: >
The bucket's lifecycle configuration. See [Lifecycle Management](https://cloud.google.com/storage/docs/lifecycle) for more information.
- name: autoclass
value: object
description: >
The bucket's Autoclass configuration.
- name: location
value: string
description: >
The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US. See the [Developer's Guide](https://cloud.google.com/storage/docs/locations) for the authoritative list.
- name: locationType
value: string
description: >
The type of the bucket location.
- name: logging
value: object
description: >
The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs.
- name: generation
value: string
description: >
The generation of this bucket.
- name: metageneration
value: string
description: >
The metadata generation of this bucket.
- name: name
value: string
description: >
The name of the bucket.
- name: owner
value: object
description: >
The owner of the bucket. This is always the project team's owner group.
- name: projectNumber
value: string
description: >
The project number of the project the bucket belongs to.
- name: retentionPolicy
value: object
description: >
The bucket's retention policy. The retention policy enforces a minimum retention time for all objects contained in the bucket, based on their creation time. Any attempt to overwrite or delete objects younger than the retention period will result in a PERMISSION_DENIED error. An unlocked retention policy can be modified or removed from the bucket via a storage.buckets.update operation. A locked retention policy cannot be removed or shortened in duration for the lifetime of the bucket. Attempting to remove or decrease period of a locked retention policy will result in a PERMISSION_DENIED error.
- name: objectRetention
value: object
description: >
The bucket's object retention config.
- name: rpo
value: string
description: >
The Recovery Point Objective (RPO) of this bucket. Set to ASYNC_TURBO to turn on Turbo Replication on a bucket.
- name: selfLink
value: string
description: >
The URI of this bucket.
- name: softDeletePolicy
value: object
description: >
The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted.
- name: storageClass
value: string
description: >
The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, ARCHIVE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see [Storage Classes](https://cloud.google.com/storage/docs/storage-classes).
- name: timeCreated
value: string
description: >
The creation time of the bucket in RFC 3339 format.
- name: updated
value: string
description: >
The modification time of the bucket in RFC 3339 format.
- name: softDeleteTime
value: string
description: >
The soft delete time of the bucket in RFC 3339 format.
- name: hardDeleteTime
value: string
description: >
The hard delete time of the bucket in RFC 3339 format.
- name: versioning
value: object
description: >
The bucket's versioning configuration.
- name: website
value: object
description: >
The bucket's website configuration, controlling how the service behaves when accessing bucket contents as a web site. See the [Static Website Examples](https://cloud.google.com/storage/docs/static-website) for more information.
- name: satisfiesPZS
value: boolean
description: >
Reserved for future use.
- name: satisfiesPZI
value: boolean
description: >
Reserved for future use.
- name: predefinedAcl
value: string
- name: predefinedDefaultObjectAcl
value: string
- name: projection
value: string
- name: userProject
value: string
- name: enableObjectRetention
value: boolean
UPDATE
examples
- patch
Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.
UPDATE google.storage.buckets
SET
data__acl = '{{ acl }}',
data__billing = '{{ billing }}',
data__cors = '{{ cors }}',
data__customPlacementConfig = '{{ customPlacementConfig }}',
data__defaultEventBasedHold = {{ defaultEventBasedHold }},
data__defaultObjectAcl = '{{ defaultObjectAcl }}',
data__encryption = '{{ encryption }}',
data__etag = '{{ etag }}',
data__hierarchicalNamespace = '{{ hierarchicalNamespace }}',
data__iamConfiguration = '{{ iamConfiguration }}',
data__id = '{{ id }}',
data__ipFilter = '{{ ipFilter }}',
data__kind = '{{ kind }}',
data__labels = '{{ labels }}',
data__lifecycle = '{{ lifecycle }}',
data__autoclass = '{{ autoclass }}',
data__location = '{{ location }}',
data__locationType = '{{ locationType }}',
data__logging = '{{ logging }}',
data__generation = '{{ generation }}',
data__metageneration = '{{ metageneration }}',
data__name = '{{ name }}',
data__owner = '{{ owner }}',
data__projectNumber = '{{ projectNumber }}',
data__retentionPolicy = '{{ retentionPolicy }}',
data__objectRetention = '{{ objectRetention }}',
data__rpo = '{{ rpo }}',
data__selfLink = '{{ selfLink }}',
data__softDeletePolicy = '{{ softDeletePolicy }}',
data__storageClass = '{{ storageClass }}',
data__timeCreated = '{{ timeCreated }}',
data__updated = '{{ updated }}',
data__softDeleteTime = '{{ softDeleteTime }}',
data__hardDeleteTime = '{{ hardDeleteTime }}',
data__versioning = '{{ versioning }}',
data__website = '{{ website }}',
data__satisfiesPZS = {{ satisfiesPZS }},
data__satisfiesPZI = {{ satisfiesPZI }}
WHERE
bucket = '{{ bucket }}' --required
AND ifMetagenerationMatch = '{{ ifMetagenerationMatch}}'
AND ifMetagenerationNotMatch = '{{ ifMetagenerationNotMatch}}'
AND predefinedAcl = '{{ predefinedAcl}}'
AND predefinedDefaultObjectAcl = '{{ predefinedDefaultObjectAcl}}'
AND projection = '{{ projection}}'
AND userProject = '{{ userProject}}'
RETURNING
id,
name,
acl,
autoclass,
billing,
cors,
customPlacementConfig,
defaultEventBasedHold,
defaultObjectAcl,
encryption,
etag,
generation,
hardDeleteTime,
hierarchicalNamespace,
iamConfiguration,
ipFilter,
kind,
labels,
lifecycle,
location,
locationType,
logging,
metageneration,
objectRetention,
owner,
projectNumber,
retentionPolicy,
rpo,
satisfiesPZI,
satisfiesPZS,
selfLink,
softDeletePolicy,
softDeleteTime,
storageClass,
timeCreated,
updated,
versioning,
website;
REPLACE
examples
- update
Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.
REPLACE google.storage.buckets
SET
data__acl = '{{ acl }}',
data__billing = '{{ billing }}',
data__cors = '{{ cors }}',
data__customPlacementConfig = '{{ customPlacementConfig }}',
data__defaultEventBasedHold = {{ defaultEventBasedHold }},
data__defaultObjectAcl = '{{ defaultObjectAcl }}',
data__encryption = '{{ encryption }}',
data__etag = '{{ etag }}',
data__hierarchicalNamespace = '{{ hierarchicalNamespace }}',
data__iamConfiguration = '{{ iamConfiguration }}',
data__id = '{{ id }}',
data__ipFilter = '{{ ipFilter }}',
data__kind = '{{ kind }}',
data__labels = '{{ labels }}',
data__lifecycle = '{{ lifecycle }}',
data__autoclass = '{{ autoclass }}',
data__location = '{{ location }}',
data__locationType = '{{ locationType }}',
data__logging = '{{ logging }}',
data__generation = '{{ generation }}',
data__metageneration = '{{ metageneration }}',
data__name = '{{ name }}',
data__owner = '{{ owner }}',
data__projectNumber = '{{ projectNumber }}',
data__retentionPolicy = '{{ retentionPolicy }}',
data__objectRetention = '{{ objectRetention }}',
data__rpo = '{{ rpo }}',
data__selfLink = '{{ selfLink }}',
data__softDeletePolicy = '{{ softDeletePolicy }}',
data__storageClass = '{{ storageClass }}',
data__timeCreated = '{{ timeCreated }}',
data__updated = '{{ updated }}',
data__softDeleteTime = '{{ softDeleteTime }}',
data__hardDeleteTime = '{{ hardDeleteTime }}',
data__versioning = '{{ versioning }}',
data__website = '{{ website }}',
data__satisfiesPZS = {{ satisfiesPZS }},
data__satisfiesPZI = {{ satisfiesPZI }}
WHERE
bucket = '{{ bucket }}' --required
AND ifMetagenerationMatch = '{{ ifMetagenerationMatch}}'
AND ifMetagenerationNotMatch = '{{ ifMetagenerationNotMatch}}'
AND predefinedAcl = '{{ predefinedAcl}}'
AND predefinedDefaultObjectAcl = '{{ predefinedDefaultObjectAcl}}'
AND projection = '{{ projection}}'
AND userProject = '{{ userProject}}'
RETURNING
id,
name,
acl,
autoclass,
billing,
cors,
customPlacementConfig,
defaultEventBasedHold,
defaultObjectAcl,
encryption,
etag,
generation,
hardDeleteTime,
hierarchicalNamespace,
iamConfiguration,
ipFilter,
kind,
labels,
lifecycle,
location,
locationType,
logging,
metageneration,
objectRetention,
owner,
projectNumber,
retentionPolicy,
rpo,
satisfiesPZI,
satisfiesPZS,
selfLink,
softDeletePolicy,
softDeleteTime,
storageClass,
timeCreated,
updated,
versioning,
website;
DELETE
examples
- delete
Deletes an empty bucket. Deletions are permanent unless soft delete is enabled on the bucket.
DELETE FROM google.storage.buckets
WHERE bucket = '{{ bucket }}' --required
AND ifMetagenerationMatch = '{{ ifMetagenerationMatch }}'
AND ifMetagenerationNotMatch = '{{ ifMetagenerationNotMatch }}'
AND userProject = '{{ userProject }}';
Lifecycle Methods
- restore
- relocate
- lock_retention_policy
Restores a soft-deleted bucket.
EXEC google.storage.buckets.restore
@bucket='{{ bucket }}' --required,
@generation='{{ generation }}' --required,
@projection='{{ projection }}',
@userProject='{{ userProject }}';
Initiates a long-running Relocate Bucket operation on the specified bucket.
EXEC google.storage.buckets.relocate
@bucket='{{ bucket }}' --required
@@json=
'{
"destinationLocation": "{{ destinationLocation }}",
"destinationCustomPlacementConfig": "{{ destinationCustomPlacementConfig }}",
"validateOnly": {{ validateOnly }}
}';
Locks retention policy on a bucket.
EXEC google.storage.buckets.lock_retention_policy
@bucket='{{ bucket }}' --required,
@ifMetagenerationMatch='{{ ifMetagenerationMatch }}' --required,
@userProject='{{ userProject }}';