storage namespace Stay organized with collections Save and categorize content based on your preferences.
Functions
| Function | Description |
|---|---|
| onObjectArchived(handler) | Event handler sent only when a bucket has enabled object versioning. This event indicates that the live version of an object has become an archived version, either because it was archived or because it was overwritten by the upload of an object of the same name. |
| onObjectArchived(bucket, handler) | Event handler sent only when a bucket has enabled object versioning. This event indicates that the live version of an object has become an archived version, either because it was archived or because it was overwritten by the upload of an object of the same name. |
| onObjectArchived(opts, handler) | Event handler sent only when a bucket has enabled object versioning. This event indicates that the live version of an object has become an archived version, either because it was archived or because it was overwritten by the upload of an object of the same name. |
| onObjectDeleted(handler) | Event handler which fires every time a Google Cloud Storage deletion occurs.Sent when an object has been permanently deleted. This includes objects that are overwritten or are deleted as part of the bucket's lifecycle configuration. For buckets with object versioning enabled, this is not sent when an object is archived, even if archival occurs via thestorage.objects.delete method. |
| onObjectDeleted(bucket, handler) | Event handler which fires every time a Google Cloud Storage deletion occurs.Sent when an object has been permanently deleted. This includes objects that are overwritten or are deleted as part of the bucket's lifecycle configuration. For buckets with object versioning enabled, this is not sent when an object is archived, even if archival occurs via thestorage.objects.delete method. |
| onObjectDeleted(opts, handler) | Event handler which fires every time a Google Cloud Storage deletion occurs.Sent when an object has been permanently deleted. This includes objects that are overwritten or are deleted as part of the bucket's lifecycle configuration. For buckets with object versioning enabled, this is not sent when an object is archived, even if archival occurs via thestorage.objects.delete method. |
| onObjectFinalized(handler) | Event handler which fires every time a Google Cloud Storage object creation occurs.Sent when a new object (or a new generation of an existing object) is successfully created in the bucket. This includes copying or rewriting an existing object. A failed upload does not trigger this event. |
| onObjectFinalized(bucket, handler) | Event handler which fires every time a Google Cloud Storage object creation occurs.Sent when a new object (or a new generation of an existing object) is successfully created in the bucket. This includes copying or rewriting an existing object. A failed upload does not trigger this event. |
| onObjectFinalized(opts, handler) | Event handler which fires every time a Google Cloud Storage object creation occurs.Sent when a new object (or a new generation of an existing object) is successfully created in the bucket. This includes copying or rewriting an existing object. A failed upload does not trigger this event. |
| onObjectMetadataUpdated(handler) | Event handler which fires every time the metadata of an existing object changes. |
| onObjectMetadataUpdated(bucket, handler) | Event handler which fires every time the metadata of an existing object changes. |
| onObjectMetadataUpdated(opts, handler) | Event handler which fires every time the metadata of an existing object changes. |
Interfaces
| Interface | Description |
|---|---|
| CustomerEncryption | Metadata of customer-supplied encryption key, if the object is encrypted by such a key. |
| StorageEvent | A CloudEvent that contains StorageObjectData |
| StorageObjectData | An object within Google Cloud Storage. Ref: https://github.com/googleapis/google-cloudevents-nodejs/blob/main/cloud/storage/v1/StorageObjectData.ts |
| StorageOptions | StorageOptions extend EventHandlerOptions with a bucket name |
storage.onObjectArchived()
Event handler sent only when a bucket has enabled object versioning. This event indicates that the live version of an object has become an archived version, either because it was archived or because it was overwritten by the upload of an object of the same name.
Signature:
exportdeclarefunctiononObjectArchived(handler:(event:StorageEvent)=>any|Promise<any>):CloudFunction<StorageEvent>;Parameters
| Parameter | Type | Description |
|---|---|---|
| handler | (event:StorageEvent) => any | Promise<any> | Event handler which is run every time a Google Cloud Storage archival occurs. |
Returns:
storage.onObjectArchived()
Event handler sent only when a bucket has enabled object versioning. This event indicates that the live version of an object has become an archived version, either because it was archived or because it was overwritten by the upload of an object of the same name.
Signature:
exportdeclarefunctiononObjectArchived(bucket:string|Expression<string>,handler:(event:StorageEvent)=>any|Promise<any>):CloudFunction<StorageEvent>;Parameters
| Parameter | Type | Description |
|---|---|---|
| bucket | string |Expression<string> | The name of the bucket containing this object. |
| handler | (event:StorageEvent) => any | Promise<any> | Event handler which is run every time a Google Cloud Storage archival occurs. |
Returns:
storage.onObjectArchived()
Event handler sent only when a bucket has enabled object versioning. This event indicates that the live version of an object has become an archived version, either because it was archived or because it was overwritten by the upload of an object of the same name.
Signature:
exportdeclarefunctiononObjectArchived(opts:StorageOptions,handler:(event:StorageEvent)=>any|Promise<any>):CloudFunction<StorageEvent>;Parameters
| Parameter | Type | Description |
|---|---|---|
| opts | StorageOptions | Options that can be set on an individual event-handling function. |
| handler | (event:StorageEvent) => any | Promise<any> | Event handler which is run every time a Google Cloud Storage archival occurs. |
Returns:
storage.onObjectDeleted()
Event handler which fires every time a Google Cloud Storage deletion occurs.
Sent when an object has been permanently deleted. This includes objects that are overwritten or are deleted as part of the bucket's lifecycle configuration. For buckets with object versioning enabled, this is not sent when an object is archived, even if archival occurs via thestorage.objects.delete method.
Signature:
exportdeclarefunctiononObjectDeleted(handler:(event:StorageEvent)=>any|Promise<any>):CloudFunction<StorageEvent>;Parameters
| Parameter | Type | Description |
|---|---|---|
| handler | (event:StorageEvent) => any | Promise<any> | Event handler which is run every time a Google Cloud Storage object deletion occurs. |
Returns:
storage.onObjectDeleted()
Event handler which fires every time a Google Cloud Storage deletion occurs.
Sent when an object has been permanently deleted. This includes objects that are overwritten or are deleted as part of the bucket's lifecycle configuration. For buckets with object versioning enabled, this is not sent when an object is archived, even if archival occurs via thestorage.objects.delete method.
Signature:
exportdeclarefunctiononObjectDeleted(bucket:string|Expression<string>,handler:(event:StorageEvent)=>any|Promise<any>):CloudFunction<StorageEvent>;Parameters
| Parameter | Type | Description |
|---|---|---|
| bucket | string |Expression<string> | The name of the bucket containing this object. |
| handler | (event:StorageEvent) => any | Promise<any> | Event handler which is run every time a Google Cloud Storage object deletion occurs. |
Returns:
storage.onObjectDeleted()
Event handler which fires every time a Google Cloud Storage deletion occurs.
Sent when an object has been permanently deleted. This includes objects that are overwritten or are deleted as part of the bucket's lifecycle configuration. For buckets with object versioning enabled, this is not sent when an object is archived, even if archival occurs via thestorage.objects.delete method.
Signature:
exportdeclarefunctiononObjectDeleted(opts:StorageOptions,handler:(event:StorageEvent)=>any|Promise<any>):CloudFunction<StorageEvent>;Parameters
| Parameter | Type | Description |
|---|---|---|
| opts | StorageOptions | Options that can be set on an individual event-handling function. |
| handler | (event:StorageEvent) => any | Promise<any> | Event handler which is run every time a Google Cloud Storage object deletion occurs. |
Returns:
storage.onObjectFinalized()
Event handler which fires every time a Google Cloud Storage object creation occurs.
Sent when a new object (or a new generation of an existing object) is successfully created in the bucket. This includes copying or rewriting an existing object. A failed upload does not trigger this event.
Signature:
exportdeclarefunctiononObjectFinalized(handler:(event:StorageEvent)=>any|Promise<any>):CloudFunction<StorageEvent>;Parameters
| Parameter | Type | Description |
|---|---|---|
| handler | (event:StorageEvent) => any | Promise<any> | Event handler which is run every time a Google Cloud Storage object creation occurs. |
Returns:
storage.onObjectFinalized()
Event handler which fires every time a Google Cloud Storage object creation occurs.
Sent when a new object (or a new generation of an existing object) is successfully created in the bucket. This includes copying or rewriting an existing object. A failed upload does not trigger this event.
Signature:
exportdeclarefunctiononObjectFinalized(bucket:string|Expression<string>,handler:(event:StorageEvent)=>any|Promise<any>):CloudFunction<StorageEvent>;Parameters
| Parameter | Type | Description |
|---|---|---|
| bucket | string |Expression<string> | The name of the bucket containing this object. |
| handler | (event:StorageEvent) => any | Promise<any> | Event handler which is run every time a Google Cloud Storage object creation occurs. |
Returns:
storage.onObjectFinalized()
Event handler which fires every time a Google Cloud Storage object creation occurs.
Sent when a new object (or a new generation of an existing object) is successfully created in the bucket. This includes copying or rewriting an existing object. A failed upload does not trigger this event.
Signature:
exportdeclarefunctiononObjectFinalized(opts:StorageOptions,handler:(event:StorageEvent)=>any|Promise<any>):CloudFunction<StorageEvent>;Parameters
| Parameter | Type | Description |
|---|---|---|
| opts | StorageOptions | Options that can be set on an individual event-handling function. |
| handler | (event:StorageEvent) => any | Promise<any> | Event handler which is run every time a Google Cloud Storage object creation occurs. |
Returns:
storage.onObjectMetadataUpdated()
Event handler which fires every time the metadata of an existing object changes.
Signature:
exportdeclarefunctiononObjectMetadataUpdated(handler:(event:StorageEvent)=>any|Promise<any>):CloudFunction<StorageEvent>;Parameters
| Parameter | Type | Description |
|---|---|---|
| handler | (event:StorageEvent) => any | Promise<any> | Event handler which is run every time a Google Cloud Storage object metadata update occurs. |
Returns:
storage.onObjectMetadataUpdated()
Event handler which fires every time the metadata of an existing object changes.
Signature:
exportdeclarefunctiononObjectMetadataUpdated(bucket:string|Expression<string>,handler:(event:StorageEvent)=>any|Promise<any>):CloudFunction<StorageEvent>;Parameters
| Parameter | Type | Description |
|---|---|---|
| bucket | string |Expression<string> | The name of the bucket containing this object. |
| handler | (event:StorageEvent) => any | Promise<any> | Event handler which is run every time a Google Cloud Storage object metadata update occurs. |
Returns:
storage.onObjectMetadataUpdated()
Event handler which fires every time the metadata of an existing object changes.
Signature:
exportdeclarefunctiononObjectMetadataUpdated(opts:StorageOptions,handler:(event:StorageEvent)=>any|Promise<any>):CloudFunction<StorageEvent>;Parameters
| Parameter | Type | Description |
|---|---|---|
| opts | StorageOptions | Options that can be set on an individual event-handling function. |
| handler | (event:StorageEvent) => any | Promise<any> | Event handler which is run every time a Google Cloud Storage object metadata update occurs. |
Returns:
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-02-09 UTC.