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
| 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. |
| 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 | |
dropContextGroups | 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: "{{ bucket }}"
description: Required parameter for the objects resource.
- name: acl
description: |
Access controls on the object.
value:
- bucket: "{{ bucket }}"
domain: "{{ domain }}"
email: "{{ email }}"
entity: "{{ entity }}"
entityId: "{{ entityId }}"
etag: "{{ etag }}"
generation: "{{ generation }}"
id: "{{ id }}"
kind: "{{ kind }}"
object: "{{ object }}"
projectTeam:
projectNumber: "{{ projectNumber }}"
team: "{{ team }}"
role: "{{ role }}"
selfLink: "{{ selfLink }}"
- name: bucket
value: "{{ bucket }}"
description: |
The name of the bucket containing this object.
- name: cacheControl
value: "{{ cacheControl }}"
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: {{ componentCount }}
description: |
Number of underlying components that make up this object. Components are accumulated by compose operations.
- name: contentDisposition
value: "{{ contentDisposition }}"
description: |
Content-Disposition of the object data.
- name: contentEncoding
value: "{{ contentEncoding }}"
description: |
Content-Encoding of the object data.
- name: contentLanguage
value: "{{ contentLanguage }}"
description: |
Content-Language of the object data.
- name: contentType
value: "{{ contentType }}"
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: "{{ crc32c }}"
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: "{{ customTime }}"
description: |
A timestamp in RFC 3339 format specified by the user for an object.
- name: customerEncryption
description: |
Metadata of customer-supplied encryption key, if the object is encrypted by such a key.
value:
encryptionAlgorithm: "{{ encryptionAlgorithm }}"
keySha256: "{{ keySha256 }}"
- name: etag
value: "{{ etag }}"
description: |
HTTP 1.1 Entity tag for the object.
- name: eventBasedHold
value: {{ eventBasedHold }}
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: "{{ generation }}"
description: |
The content generation of this object. Used for object versioning.
- name: id
value: "{{ id }}"
description: |
The ID of the object, including the bucket name, object name, and generation number.
- name: kind
value: "{{ kind }}"
description: |
The kind of item this is. For objects, this is always storage#object.
default: storage#object
- name: kmsKeyName
value: "{{ kmsKeyName }}"
description: |
Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.
- name: md5Hash
value: "{{ md5Hash }}"
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: "{{ mediaLink }}"
description: |
Media download link.
- name: metadata
value: "{{ metadata }}"
description: |
User-provided metadata, in key/value pairs.
- name: contexts
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.
value:
custom: "{{ custom }}"
- name: restoreToken
value: "{{ restoreToken }}"
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: "{{ metageneration }}"
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: "{{ name }}"
description: |
The name of the object. Required if not specified by URL parameter.
- name: owner
description: |
The owner of the object. This will always be the uploader of the object.
value:
entity: "{{ entity }}"
entityId: "{{ entityId }}"
- name: retentionExpirationTime
value: "{{ retentionExpirationTime }}"
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
description: |
A collection of object level retention parameters.
value:
retainUntilTime: "{{ retainUntilTime }}"
mode: "{{ mode }}"
- name: selfLink
value: "{{ selfLink }}"
description: |
The link to this object.
- name: size
value: "{{ size }}"
description: |
Content-Length of the data in bytes.
- name: storageClass
value: "{{ storageClass }}"
description: |
Storage class of the object.
- name: temporaryHold
value: {{ temporaryHold }}
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: "{{ timeCreated }}"
description: |
The creation time of the object in RFC 3339 format.
- name: timeDeleted
value: "{{ timeDeleted }}"
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: "{{ timeFinalized }}"
description: |
The time when the object was finalized.
- name: softDeleteTime
value: "{{ softDeleteTime }}"
description: |
The time at which the object became soft-deleted in RFC 3339 format.
- name: hardDeleteTime
value: "{{ hardDeleteTime }}"
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: "{{ timeStorageClassUpdated }}"
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: "{{ updated }}"
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: "{{ contentEncoding }}"
- name: ifGenerationMatch
value: "{{ ifGenerationMatch }}"
- name: ifGenerationNotMatch
value: "{{ ifGenerationNotMatch }}"
- name: ifMetagenerationMatch
value: "{{ ifMetagenerationMatch }}"
- name: ifMetagenerationNotMatch
value: "{{ ifMetagenerationNotMatch }}"
- name: kmsKeyName
value: "{{ kmsKeyName }}"
- name: name
value: "{{ name }}"
- name: predefinedAcl
value: "{{ predefinedAcl }}"
- name: projection
value: "{{ projection }}"
- name: userProject
value: "{{ userProject }}"
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
- 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 }}',
@dropContextGroups='{{ dropContextGroups }}',
@ifGenerationMatch='{{ ifGenerationMatch }}',
@ifMetagenerationMatch='{{ ifMetagenerationMatch }}',
@kmsKeyName='{{ kmsKeyName }}',
@userProject='{{ userProject }}'
@@json=
'{
"destination": "{{ destination }}",
"kind": "{{ kind }}",
"sourceObjects": "{{ sourceObjects }}",
"deleteSourceObjects": {{ deleteSourceObjects }}
}'
;
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 }}',
@dropContextGroups='{{ dropContextGroups }}',
@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 }}'
;
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 }}"
}'
;