objects
Creates, updates, deletes, gets or lists an objects
resource.
Overview
Name | objects |
Type | Resource |
Id | google.storage.objects |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
id | string | The ID of the object, including the bucket name, object name, and generation number. |
name | string | The name of the object. Required if not specified by URL parameter. |
acl | array | Access controls on the object. |
bucket | string | The name of the bucket containing this object. |
cacheControl | string | Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600. |
componentCount | integer (int32) | Number of underlying components that make up this object. Components are accumulated by compose operations. |
contentDisposition | string | Content-Disposition of the object data. |
contentEncoding | string | Content-Encoding of the object data. |
contentLanguage | string | Content-Language of the object data. |
contentType | string | Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream. |
contexts | object | User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the identification and the payload holds the associated value and additional metadata. |
crc32c | string | CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see Data Validation and Change Detection. |
customTime | string (date-time) | A timestamp in RFC 3339 format specified by the user for an object. |
customerEncryption | object | Metadata of customer-supplied encryption key, if the object is encrypted by such a key. |
etag | string | HTTP 1.1 Entity tag for the object. |
eventBasedHold | boolean | Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold's release (i.e. this value is set to false). After being released (set to false), 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 the 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. |
generation | string (int64) | The content generation of this object. Used for object versioning. |
hardDeleteTime | string (date-time) | This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket. |
kind | string | The kind of item this is. For objects, this is always storage#object. (default: storage#object) |
kmsKeyName | string | Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request. |
md5Hash | string | MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Data Validation and Change Detection. |
mediaLink | string | Media download link. |
metadata | object | User-provided metadata, in key/value pairs. |
metageneration | string (int64) | The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object. |
owner | object | The owner of the object. This will always be the uploader of the object. |
restoreToken | string | Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets. |
retention | object | A collection of object level retention parameters. |
retentionExpirationTime | string (date-time) | A server-determined value that specifies the earliest time that the object's retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold). |
selfLink | string | The link to this object. |
size | string (uint64) | Content-Length of the data in bytes. |
softDeleteTime | string (date-time) | The time at which the object became soft-deleted in RFC 3339 format. |
storageClass | string | Storage class of the object. |
temporaryHold | boolean | Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object. |
timeCreated | string (date-time) | The creation time of the object in RFC 3339 format. |
timeDeleted | string (date-time) | The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted. |
timeFinalized | string (date-time) | The time when the object was finalized. |
timeStorageClassUpdated | string (date-time) | The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated. |
updated | string (date-time) | The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration. |
Successful response
Name | Datatype | Description |
---|---|---|
id | string | The ID of the object, including the bucket name, object name, and generation number. |
name | string | The name of the object. Required if not specified by URL parameter. |
acl | array | Access controls on the object. |
bucket | string | The name of the bucket containing this object. |
cacheControl | string | Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600. |
componentCount | integer (int32) | Number of underlying components that make up this object. Components are accumulated by compose operations. |
contentDisposition | string | Content-Disposition of the object data. |
contentEncoding | string | Content-Encoding of the object data. |
contentLanguage | string | Content-Language of the object data. |
contentType | string | Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream. |
contexts | object | User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the identification and the payload holds the associated value and additional metadata. |
crc32c | string | CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see Data Validation and Change Detection. |
customTime | string (date-time) | A timestamp in RFC 3339 format specified by the user for an object. |
customerEncryption | object | Metadata of customer-supplied encryption key, if the object is encrypted by such a key. |
etag | string | HTTP 1.1 Entity tag for the object. |
eventBasedHold | boolean | Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold's release (i.e. this value is set to false). After being released (set to false), 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 the 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. |
generation | string (int64) | The content generation of this object. Used for object versioning. |
hardDeleteTime | string (date-time) | This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket. |
kind | string | The kind of item this is. For objects, this is always storage#object. (default: storage#object) |
kmsKeyName | string | Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request. |
md5Hash | string | MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Data Validation and Change Detection. |
mediaLink | string | Media download link. |
metadata | object | User-provided metadata, in key/value pairs. |
metageneration | string (int64) | The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object. |
owner | object | The owner of the object. This will always be the uploader of the object. |
restoreToken | string | Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets. |
retention | object | A collection of object level retention parameters. |
retentionExpirationTime | string (date-time) | A server-determined value that specifies the earliest time that the object's retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold). |
selfLink | string | The link to this object. |
size | string (uint64) | Content-Length of the data in bytes. |
softDeleteTime | string (date-time) | The time at which the object became soft-deleted in RFC 3339 format. |
storageClass | string | Storage class of the object. |
temporaryHold | boolean | Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object. |
timeCreated | string (date-time) | The creation time of the object in RFC 3339 format. |
timeDeleted | string (date-time) | The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted. |
timeFinalized | string (date-time) | The time when the object was finalized. |
timeStorageClassUpdated | string (date-time) | The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated. |
updated | string (date-time) | The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration. |
Methods
The following methods are available for this resource:
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 | |
destinationBucket | string | |
destinationObject | string | |
generation | string (int64) | |
object | string | |
sourceBucket | string | |
sourceObject | string | |
contentEncoding | string | |
copySourceAcl | boolean | |
delimiter | string | |
destinationKmsKeyName | string | |
destinationPredefinedAcl | string | |
endOffset | string | |
filter | string | |
generation | string (int64) | |
ifGenerationMatch | string (int64) | |
ifGenerationNotMatch | string (int64) | |
ifMetagenerationMatch | string (int64) | |
ifMetagenerationNotMatch | string (int64) | |
ifSourceGenerationMatch | string (int64) | |
ifSourceGenerationNotMatch | string (int64) | |
ifSourceMetagenerationMatch | string (int64) | |
ifSourceMetagenerationNotMatch | string (int64) | |
includeFoldersAsPrefixes | boolean | |
includeTrailingDelimiter | boolean | |
kmsKeyName | string | |
matchGlob | string | |
maxBytesRewrittenPerCall | string (int64) | |
maxResults | integer (uint32) | |
name | string | |
overrideUnlockedRetention | boolean | |
pageToken | string | |
predefinedAcl | string | |
prefix | string | |
projection | string | |
restoreToken | string | |
rewriteToken | string | |
softDeleted | boolean | |
sourceGeneration | string (int64) | |
startOffset | string | |
userProject | string | |
versions | boolean |
SELECT
examples
- get
- list
Retrieves an object or its metadata.
SELECT
id,
name,
acl,
bucket,
cacheControl,
componentCount,
contentDisposition,
contentEncoding,
contentLanguage,
contentType,
contexts,
crc32c,
customTime,
customerEncryption,
etag,
eventBasedHold,
generation,
hardDeleteTime,
kind,
kmsKeyName,
md5Hash,
mediaLink,
metadata,
metageneration,
owner,
restoreToken,
retention,
retentionExpirationTime,
selfLink,
size,
softDeleteTime,
storageClass,
temporaryHold,
timeCreated,
timeDeleted,
timeFinalized,
timeStorageClassUpdated,
updated
FROM google.storage.objects
WHERE bucket = '{{ bucket }}' -- required
AND object = '{{ object }}' -- required
AND generation = '{{ generation }}'
AND ifGenerationMatch = '{{ ifGenerationMatch }}'
AND ifGenerationNotMatch = '{{ ifGenerationNotMatch }}'
AND ifMetagenerationMatch = '{{ ifMetagenerationMatch }}'
AND ifMetagenerationNotMatch = '{{ ifMetagenerationNotMatch }}'
AND projection = '{{ projection }}'
AND userProject = '{{ userProject }}'
AND softDeleted = '{{ softDeleted }}'
AND restoreToken = '{{ restoreToken }}';
Retrieves a list of objects matching the criteria.
SELECT
id,
name,
acl,
bucket,
cacheControl,
componentCount,
contentDisposition,
contentEncoding,
contentLanguage,
contentType,
contexts,
crc32c,
customTime,
customerEncryption,
etag,
eventBasedHold,
generation,
hardDeleteTime,
kind,
kmsKeyName,
md5Hash,
mediaLink,
metadata,
metageneration,
owner,
restoreToken,
retention,
retentionExpirationTime,
selfLink,
size,
softDeleteTime,
storageClass,
temporaryHold,
timeCreated,
timeDeleted,
timeFinalized,
timeStorageClassUpdated,
updated
FROM google.storage.objects
WHERE bucket = '{{ bucket }}' -- required
AND delimiter = '{{ delimiter }}'
AND endOffset = '{{ endOffset }}'
AND includeTrailingDelimiter = '{{ includeTrailingDelimiter }}'
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
AND prefix = '{{ prefix }}'
AND projection = '{{ projection }}'
AND startOffset = '{{ startOffset }}'
AND userProject = '{{ userProject }}'
AND versions = '{{ versions }}'
AND matchGlob = '{{ matchGlob }}'
AND filter = '{{ filter }}'
AND softDeleted = '{{ softDeleted }}'
AND includeFoldersAsPrefixes = '{{ includeFoldersAsPrefixes }}';
INSERT
examples
- insert
- Manifest
Stores a new object and metadata.
INSERT INTO google.storage.objects (
data__acl,
data__bucket,
data__cacheControl,
data__componentCount,
data__contentDisposition,
data__contentEncoding,
data__contentLanguage,
data__contentType,
data__crc32c,
data__customTime,
data__customerEncryption,
data__etag,
data__eventBasedHold,
data__generation,
data__id,
data__kind,
data__kmsKeyName,
data__md5Hash,
data__mediaLink,
data__metadata,
data__contexts,
data__restoreToken,
data__metageneration,
data__name,
data__owner,
data__retentionExpirationTime,
data__retention,
data__selfLink,
data__size,
data__storageClass,
data__temporaryHold,
data__timeCreated,
data__timeDeleted,
data__timeFinalized,
data__softDeleteTime,
data__hardDeleteTime,
data__timeStorageClassUpdated,
data__updated,
bucket,
contentEncoding,
ifGenerationMatch,
ifGenerationNotMatch,
ifMetagenerationMatch,
ifMetagenerationNotMatch,
kmsKeyName,
name,
predefinedAcl,
projection,
userProject
)
SELECT
'{{ acl }}',
'{{ bucket }}',
'{{ cacheControl }}',
{{ componentCount }},
'{{ contentDisposition }}',
'{{ contentEncoding }}',
'{{ contentLanguage }}',
'{{ contentType }}',
'{{ crc32c }}',
'{{ customTime }}',
'{{ customerEncryption }}',
'{{ etag }}',
{{ eventBasedHold }},
'{{ generation }}',
'{{ id }}',
'{{ kind }}',
'{{ kmsKeyName }}',
'{{ md5Hash }}',
'{{ mediaLink }}',
'{{ metadata }}',
'{{ contexts }}',
'{{ restoreToken }}',
'{{ metageneration }}',
'{{ name }}',
'{{ owner }}',
'{{ retentionExpirationTime }}',
'{{ retention }}',
'{{ selfLink }}',
'{{ size }}',
'{{ storageClass }}',
{{ temporaryHold }},
'{{ timeCreated }}',
'{{ timeDeleted }}',
'{{ timeFinalized }}',
'{{ softDeleteTime }}',
'{{ hardDeleteTime }}',
'{{ timeStorageClassUpdated }}',
'{{ updated }}',
'{{ bucket }}',
'{{ contentEncoding }}',
'{{ ifGenerationMatch }}',
'{{ ifGenerationNotMatch }}',
'{{ ifMetagenerationMatch }}',
'{{ ifMetagenerationNotMatch }}',
'{{ kmsKeyName }}',
'{{ name }}',
'{{ predefinedAcl }}',
'{{ projection }}',
'{{ userProject }}'
RETURNING
id,
name,
acl,
bucket,
cacheControl,
componentCount,
contentDisposition,
contentEncoding,
contentLanguage,
contentType,
contexts,
crc32c,
customTime,
customerEncryption,
etag,
eventBasedHold,
generation,
hardDeleteTime,
kind,
kmsKeyName,
md5Hash,
mediaLink,
metadata,
metageneration,
owner,
restoreToken,
retention,
retentionExpirationTime,
selfLink,
size,
softDeleteTime,
storageClass,
temporaryHold,
timeCreated,
timeDeleted,
timeFinalized,
timeStorageClassUpdated,
updated
;
# Description fields are for documentation purposes
- name: objects
props:
- name: bucket
value: string
description: Required parameter for the objects resource.
- name: acl
value: array
description: >
Access controls on the object.
- name: bucket
value: string
description: >
The name of the bucket containing this object.
- name: cacheControl
value: string
description: >
Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.
- name: componentCount
value: integer
description: >
Number of underlying components that make up this object. Components are accumulated by compose operations.
- name: contentDisposition
value: string
description: >
Content-Disposition of the object data.
- name: contentEncoding
value: string
description: >
Content-Encoding of the object data.
- name: contentLanguage
value: string
description: >
Content-Language of the object data.
- name: contentType
value: string
description: >
Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.
- name: crc32c
value: string
description: >
CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
- name: customTime
value: string
description: >
A timestamp in RFC 3339 format specified by the user for an object.
- name: customerEncryption
value: object
description: >
Metadata of customer-supplied encryption key, if the object is encrypted by such a key.
- name: etag
value: string
description: >
HTTP 1.1 Entity tag for the object.
- name: eventBasedHold
value: boolean
description: >
Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold's release (i.e. this value is set to false). After being released (set to false), 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 the 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.
- name: generation
value: string
description: >
The content generation of this object. Used for object versioning.
- name: id
value: string
description: >
The ID of the object, including the bucket name, object name, and generation number.
- name: kind
value: string
description: >
The kind of item this is. For objects, this is always storage#object.
default: storage#object
- name: kmsKeyName
value: string
description: >
Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.
- name: md5Hash
value: string
description: >
MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
- name: mediaLink
value: string
description: >
Media download link.
- name: metadata
value: object
description: >
User-provided metadata, in key/value pairs.
- name: contexts
value: object
description: >
User-defined or system-defined object contexts. Each object context is a key-payload pair, where the key provides the identification and the payload holds the associated value and additional metadata.
- name: restoreToken
value: string
description: >
Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets.
- name: metageneration
value: string
description: >
The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.
- name: name
value: string
description: >
The name of the object. Required if not specified by URL parameter.
- name: owner
value: object
description: >
The owner of the object. This will always be the uploader of the object.
- name: retentionExpirationTime
value: string
description: >
A server-determined value that specifies the earliest time that the object's retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).
- name: retention
value: object
description: >
A collection of object level retention parameters.
- name: selfLink
value: string
description: >
The link to this object.
- name: size
value: string
description: >
Content-Length of the data in bytes.
- name: storageClass
value: string
description: >
Storage class of the object.
- name: temporaryHold
value: boolean
description: >
Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.
- name: timeCreated
value: string
description: >
The creation time of the object in RFC 3339 format.
- name: timeDeleted
value: string
description: >
The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.
- name: timeFinalized
value: string
description: >
The time when the object was finalized.
- name: softDeleteTime
value: string
description: >
The time at which the object became soft-deleted in RFC 3339 format.
- name: hardDeleteTime
value: string
description: >
This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.
- name: timeStorageClassUpdated
value: string
description: >
The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated.
- name: updated
value: string
description: >
The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.
- name: contentEncoding
value: string
- name: ifGenerationMatch
value: string (int64)
- name: ifGenerationNotMatch
value: string (int64)
- name: ifMetagenerationMatch
value: string (int64)
- name: ifMetagenerationNotMatch
value: string (int64)
- name: kmsKeyName
value: string
- name: name
value: string
- name: predefinedAcl
value: string
- name: projection
value: string
- name: userProject
value: string
UPDATE
examples
- patch
Patches an object's metadata.
UPDATE google.storage.objects
SET
data__acl = '{{ acl }}',
data__bucket = '{{ bucket }}',
data__cacheControl = '{{ cacheControl }}',
data__componentCount = {{ componentCount }},
data__contentDisposition = '{{ contentDisposition }}',
data__contentEncoding = '{{ contentEncoding }}',
data__contentLanguage = '{{ contentLanguage }}',
data__contentType = '{{ contentType }}',
data__crc32c = '{{ crc32c }}',
data__customTime = '{{ customTime }}',
data__customerEncryption = '{{ customerEncryption }}',
data__etag = '{{ etag }}',
data__eventBasedHold = {{ eventBasedHold }},
data__generation = '{{ generation }}',
data__id = '{{ id }}',
data__kind = '{{ kind }}',
data__kmsKeyName = '{{ kmsKeyName }}',
data__md5Hash = '{{ md5Hash }}',
data__mediaLink = '{{ mediaLink }}',
data__metadata = '{{ metadata }}',
data__contexts = '{{ contexts }}',
data__restoreToken = '{{ restoreToken }}',
data__metageneration = '{{ metageneration }}',
data__name = '{{ name }}',
data__owner = '{{ owner }}',
data__retentionExpirationTime = '{{ retentionExpirationTime }}',
data__retention = '{{ retention }}',
data__selfLink = '{{ selfLink }}',
data__size = '{{ size }}',
data__storageClass = '{{ storageClass }}',
data__temporaryHold = {{ temporaryHold }},
data__timeCreated = '{{ timeCreated }}',
data__timeDeleted = '{{ timeDeleted }}',
data__timeFinalized = '{{ timeFinalized }}',
data__softDeleteTime = '{{ softDeleteTime }}',
data__hardDeleteTime = '{{ hardDeleteTime }}',
data__timeStorageClassUpdated = '{{ timeStorageClassUpdated }}',
data__updated = '{{ updated }}'
WHERE
bucket = '{{ bucket }}' --required
AND object = '{{ object }}' --required
AND generation = '{{ generation}}'
AND ifGenerationMatch = '{{ ifGenerationMatch}}'
AND ifGenerationNotMatch = '{{ ifGenerationNotMatch}}'
AND ifMetagenerationMatch = '{{ ifMetagenerationMatch}}'
AND ifMetagenerationNotMatch = '{{ ifMetagenerationNotMatch}}'
AND overrideUnlockedRetention = {{ overrideUnlockedRetention}}
AND predefinedAcl = '{{ predefinedAcl}}'
AND projection = '{{ projection}}'
AND userProject = '{{ userProject}}'
RETURNING
id,
name,
acl,
bucket,
cacheControl,
componentCount,
contentDisposition,
contentEncoding,
contentLanguage,
contentType,
contexts,
crc32c,
customTime,
customerEncryption,
etag,
eventBasedHold,
generation,
hardDeleteTime,
kind,
kmsKeyName,
md5Hash,
mediaLink,
metadata,
metageneration,
owner,
restoreToken,
retention,
retentionExpirationTime,
selfLink,
size,
softDeleteTime,
storageClass,
temporaryHold,
timeCreated,
timeDeleted,
timeFinalized,
timeStorageClassUpdated,
updated;
REPLACE
examples
- update
Updates an object's metadata.
REPLACE google.storage.objects
SET
data__acl = '{{ acl }}',
data__bucket = '{{ bucket }}',
data__cacheControl = '{{ cacheControl }}',
data__componentCount = {{ componentCount }},
data__contentDisposition = '{{ contentDisposition }}',
data__contentEncoding = '{{ contentEncoding }}',
data__contentLanguage = '{{ contentLanguage }}',
data__contentType = '{{ contentType }}',
data__crc32c = '{{ crc32c }}',
data__customTime = '{{ customTime }}',
data__customerEncryption = '{{ customerEncryption }}',
data__etag = '{{ etag }}',
data__eventBasedHold = {{ eventBasedHold }},
data__generation = '{{ generation }}',
data__id = '{{ id }}',
data__kind = '{{ kind }}',
data__kmsKeyName = '{{ kmsKeyName }}',
data__md5Hash = '{{ md5Hash }}',
data__mediaLink = '{{ mediaLink }}',
data__metadata = '{{ metadata }}',
data__contexts = '{{ contexts }}',
data__restoreToken = '{{ restoreToken }}',
data__metageneration = '{{ metageneration }}',
data__name = '{{ name }}',
data__owner = '{{ owner }}',
data__retentionExpirationTime = '{{ retentionExpirationTime }}',
data__retention = '{{ retention }}',
data__selfLink = '{{ selfLink }}',
data__size = '{{ size }}',
data__storageClass = '{{ storageClass }}',
data__temporaryHold = {{ temporaryHold }},
data__timeCreated = '{{ timeCreated }}',
data__timeDeleted = '{{ timeDeleted }}',
data__timeFinalized = '{{ timeFinalized }}',
data__softDeleteTime = '{{ softDeleteTime }}',
data__hardDeleteTime = '{{ hardDeleteTime }}',
data__timeStorageClassUpdated = '{{ timeStorageClassUpdated }}',
data__updated = '{{ updated }}'
WHERE
bucket = '{{ bucket }}' --required
AND object = '{{ object }}' --required
AND generation = '{{ generation}}'
AND ifGenerationMatch = '{{ ifGenerationMatch}}'
AND ifGenerationNotMatch = '{{ ifGenerationNotMatch}}'
AND ifMetagenerationMatch = '{{ ifMetagenerationMatch}}'
AND ifMetagenerationNotMatch = '{{ ifMetagenerationNotMatch}}'
AND overrideUnlockedRetention = {{ overrideUnlockedRetention}}
AND predefinedAcl = '{{ predefinedAcl}}'
AND projection = '{{ projection}}'
AND userProject = '{{ userProject}}'
RETURNING
id,
name,
acl,
bucket,
cacheControl,
componentCount,
contentDisposition,
contentEncoding,
contentLanguage,
contentType,
contexts,
crc32c,
customTime,
customerEncryption,
etag,
eventBasedHold,
generation,
hardDeleteTime,
kind,
kmsKeyName,
md5Hash,
mediaLink,
metadata,
metageneration,
owner,
restoreToken,
retention,
retentionExpirationTime,
selfLink,
size,
softDeleteTime,
storageClass,
temporaryHold,
timeCreated,
timeDeleted,
timeFinalized,
timeStorageClassUpdated,
updated;
DELETE
examples
- delete
Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.
DELETE FROM google.storage.objects
WHERE bucket = '{{ bucket }}' --required
AND object = '{{ object }}' --required
AND generation = '{{ generation }}'
AND ifGenerationMatch = '{{ ifGenerationMatch }}'
AND ifGenerationNotMatch = '{{ ifGenerationNotMatch }}'
AND ifMetagenerationMatch = '{{ ifMetagenerationMatch }}'
AND ifMetagenerationNotMatch = '{{ ifMetagenerationNotMatch }}'
AND userProject = '{{ userProject }}';
Lifecycle Methods
- compose
- copy
- rewrite
- move
- watch_all
- restore
- bulk_restore
Concatenates a list of existing objects into a new object in the same bucket.
EXEC google.storage.objects.compose
@destinationBucket='{{ destinationBucket }}' --required,
@destinationObject='{{ destinationObject }}' --required,
@destinationPredefinedAcl='{{ destinationPredefinedAcl }}',
@ifGenerationMatch='{{ ifGenerationMatch }}',
@ifMetagenerationMatch='{{ ifMetagenerationMatch }}',
@kmsKeyName='{{ kmsKeyName }}',
@userProject='{{ userProject }}'
@@json=
'{
"destination": "{{ destination }}",
"kind": "{{ kind }}",
"sourceObjects": "{{ sourceObjects }}"
}';
Copies a source object to a destination object. Optionally overrides metadata.
EXEC google.storage.objects.copy
@sourceBucket='{{ sourceBucket }}' --required,
@sourceObject='{{ sourceObject }}' --required,
@destinationBucket='{{ destinationBucket }}' --required,
@destinationObject='{{ destinationObject }}' --required,
@destinationKmsKeyName='{{ destinationKmsKeyName }}',
@destinationPredefinedAcl='{{ destinationPredefinedAcl }}',
@ifGenerationMatch='{{ ifGenerationMatch }}',
@ifGenerationNotMatch='{{ ifGenerationNotMatch }}',
@ifMetagenerationMatch='{{ ifMetagenerationMatch }}',
@ifMetagenerationNotMatch='{{ ifMetagenerationNotMatch }}',
@ifSourceGenerationMatch='{{ ifSourceGenerationMatch }}',
@ifSourceGenerationNotMatch='{{ ifSourceGenerationNotMatch }}',
@ifSourceMetagenerationMatch='{{ ifSourceMetagenerationMatch }}',
@ifSourceMetagenerationNotMatch='{{ ifSourceMetagenerationNotMatch }}',
@projection='{{ projection }}',
@sourceGeneration='{{ sourceGeneration }}',
@userProject='{{ userProject }}'
@@json=
'{
"acl": "{{ acl }}",
"bucket": "{{ bucket }}",
"cacheControl": "{{ cacheControl }}",
"componentCount": {{ componentCount }},
"contentDisposition": "{{ contentDisposition }}",
"contentEncoding": "{{ contentEncoding }}",
"contentLanguage": "{{ contentLanguage }}",
"contentType": "{{ contentType }}",
"crc32c": "{{ crc32c }}",
"customTime": "{{ customTime }}",
"customerEncryption": "{{ customerEncryption }}",
"etag": "{{ etag }}",
"eventBasedHold": {{ eventBasedHold }},
"generation": "{{ generation }}",
"id": "{{ id }}",
"kind": "{{ kind }}",
"kmsKeyName": "{{ kmsKeyName }}",
"md5Hash": "{{ md5Hash }}",
"mediaLink": "{{ mediaLink }}",
"metadata": "{{ metadata }}",
"contexts": "{{ contexts }}",
"restoreToken": "{{ restoreToken }}",
"metageneration": "{{ metageneration }}",
"name": "{{ name }}",
"owner": "{{ owner }}",
"retentionExpirationTime": "{{ retentionExpirationTime }}",
"retention": "{{ retention }}",
"selfLink": "{{ selfLink }}",
"size": "{{ size }}",
"storageClass": "{{ storageClass }}",
"temporaryHold": {{ temporaryHold }},
"timeCreated": "{{ timeCreated }}",
"timeDeleted": "{{ timeDeleted }}",
"timeFinalized": "{{ timeFinalized }}",
"softDeleteTime": "{{ softDeleteTime }}",
"hardDeleteTime": "{{ hardDeleteTime }}",
"timeStorageClassUpdated": "{{ timeStorageClassUpdated }}",
"updated": "{{ updated }}"
}';
Rewrites a source object to a destination object. Optionally overrides metadata.
EXEC google.storage.objects.rewrite
@sourceBucket='{{ sourceBucket }}' --required,
@sourceObject='{{ sourceObject }}' --required,
@destinationBucket='{{ destinationBucket }}' --required,
@destinationObject='{{ destinationObject }}' --required,
@destinationKmsKeyName='{{ destinationKmsKeyName }}',
@destinationPredefinedAcl='{{ destinationPredefinedAcl }}',
@ifGenerationMatch='{{ ifGenerationMatch }}',
@ifGenerationNotMatch='{{ ifGenerationNotMatch }}',
@ifMetagenerationMatch='{{ ifMetagenerationMatch }}',
@ifMetagenerationNotMatch='{{ ifMetagenerationNotMatch }}',
@ifSourceGenerationMatch='{{ ifSourceGenerationMatch }}',
@ifSourceGenerationNotMatch='{{ ifSourceGenerationNotMatch }}',
@ifSourceMetagenerationMatch='{{ ifSourceMetagenerationMatch }}',
@ifSourceMetagenerationNotMatch='{{ ifSourceMetagenerationNotMatch }}',
@maxBytesRewrittenPerCall='{{ maxBytesRewrittenPerCall }}',
@projection='{{ projection }}',
@rewriteToken='{{ rewriteToken }}',
@sourceGeneration='{{ sourceGeneration }}',
@userProject='{{ userProject }}'
@@json=
'{
"acl": "{{ acl }}",
"bucket": "{{ bucket }}",
"cacheControl": "{{ cacheControl }}",
"componentCount": {{ componentCount }},
"contentDisposition": "{{ contentDisposition }}",
"contentEncoding": "{{ contentEncoding }}",
"contentLanguage": "{{ contentLanguage }}",
"contentType": "{{ contentType }}",
"crc32c": "{{ crc32c }}",
"customTime": "{{ customTime }}",
"customerEncryption": "{{ customerEncryption }}",
"etag": "{{ etag }}",
"eventBasedHold": {{ eventBasedHold }},
"generation": "{{ generation }}",
"id": "{{ id }}",
"kind": "{{ kind }}",
"kmsKeyName": "{{ kmsKeyName }}",
"md5Hash": "{{ md5Hash }}",
"mediaLink": "{{ mediaLink }}",
"metadata": "{{ metadata }}",
"contexts": "{{ contexts }}",
"restoreToken": "{{ restoreToken }}",
"metageneration": "{{ metageneration }}",
"name": "{{ name }}",
"owner": "{{ owner }}",
"retentionExpirationTime": "{{ retentionExpirationTime }}",
"retention": "{{ retention }}",
"selfLink": "{{ selfLink }}",
"size": "{{ size }}",
"storageClass": "{{ storageClass }}",
"temporaryHold": {{ temporaryHold }},
"timeCreated": "{{ timeCreated }}",
"timeDeleted": "{{ timeDeleted }}",
"timeFinalized": "{{ timeFinalized }}",
"softDeleteTime": "{{ softDeleteTime }}",
"hardDeleteTime": "{{ hardDeleteTime }}",
"timeStorageClassUpdated": "{{ timeStorageClassUpdated }}",
"updated": "{{ updated }}"
}';
Moves the source object to the destination object in the same bucket.
EXEC google.storage.objects.move
@bucket='{{ bucket }}' --required,
@sourceObject='{{ sourceObject }}' --required,
@destinationObject='{{ destinationObject }}' --required,
@ifSourceGenerationMatch='{{ ifSourceGenerationMatch }}',
@ifSourceGenerationNotMatch='{{ ifSourceGenerationNotMatch }}',
@ifSourceMetagenerationMatch='{{ ifSourceMetagenerationMatch }}',
@ifSourceMetagenerationNotMatch='{{ ifSourceMetagenerationNotMatch }}',
@ifGenerationMatch='{{ ifGenerationMatch }}',
@ifGenerationNotMatch='{{ ifGenerationNotMatch }}',
@ifMetagenerationMatch='{{ ifMetagenerationMatch }}',
@ifMetagenerationNotMatch='{{ ifMetagenerationNotMatch }}',
@projection='{{ projection }}',
@userProject='{{ userProject }}';
Watch for changes on all objects in a bucket.
EXEC google.storage.objects.watch_all
@bucket='{{ bucket }}' --required,
@delimiter='{{ delimiter }}',
@endOffset='{{ endOffset }}',
@includeTrailingDelimiter={{ includeTrailingDelimiter }},
@maxResults='{{ maxResults }}',
@pageToken='{{ pageToken }}',
@prefix='{{ prefix }}',
@projection='{{ projection }}',
@startOffset='{{ startOffset }}',
@userProject='{{ userProject }}',
@versions={{ versions }}
@@json=
'{
"address": "{{ address }}",
"expiration": "{{ expiration }}",
"id": "{{ id }}",
"kind": "{{ kind }}",
"params": "{{ params }}",
"payload": {{ payload }},
"resourceId": "{{ resourceId }}",
"resourceUri": "{{ resourceUri }}",
"token": "{{ token }}",
"type": "{{ type }}"
}';
Restores a soft-deleted object.
EXEC google.storage.objects.restore
@bucket='{{ bucket }}' --required,
@object='{{ object }}' --required,
@generation='{{ generation }}' --required,
@ifGenerationMatch='{{ ifGenerationMatch }}',
@ifGenerationNotMatch='{{ ifGenerationNotMatch }}',
@ifMetagenerationMatch='{{ ifMetagenerationMatch }}',
@ifMetagenerationNotMatch='{{ ifMetagenerationNotMatch }}',
@copySourceAcl={{ copySourceAcl }},
@projection='{{ projection }}',
@userProject='{{ userProject }}',
@restoreToken='{{ restoreToken }}';
Initiates a long-running bulk restore operation on the specified bucket.
EXEC google.storage.objects.bulk_restore
@bucket='{{ bucket }}' --required
@@json=
'{
"allowOverwrite": {{ allowOverwrite }},
"softDeletedAfterTime": "{{ softDeletedAfterTime }}",
"softDeletedBeforeTime": "{{ softDeletedBeforeTime }}",
"matchGlobs": "{{ matchGlobs }}",
"copySourceAcl": {{ copySourceAcl }},
"createdAfterTime": "{{ createdAfterTime }}",
"createdBeforeTime": "{{ createdBeforeTime }}"
}';