1

i'm working for the first time with google storage with no experience on it

I have a question that does google storage have an feature that if storage got a new uploaded file, storage will send a notification to client that have subscribed Or rise an event that can be watched from another place.

My solution is list all object from bucket and save it to a temp file. After that, I list object again every minute then if a new file had been uploaded, it would not be in a temp file so i can know it. But i think this way is not such good if the thing above exists.

Many thanks.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
  • very similar question asked here and perfectly answered https://stackoverflow.com/questions/43074834/how-do-i-get-notified-when-an-object-is-uploaded-to-my-gcs-bucket – syed irfan Jul 05 '19 at 11:16

1 Answers1

2
  • Object Change Notification can be used to notify an application when an object is updated or added to a bucket.
  • Alternatively, you can use Cloud Pub/Sub Notifications for Cloud Storage, which are actually the recommended way to track changes to objects in your Cloud Storage buckets because they're faster, more flexible, easier to set up, and more cost-effective.
  • Ultimately, if you only want to trigger a lightweight, stand-alone function in response to events and don't want to manage a Cloud Pub/Sub topic, use Cloud Functions with Storage Triggers which can respond to change notifications emerging from Google Cloud Storage. These notifications can be configured to trigger in response to various events inside a bucket—object creation, deletion, archiving and metadata updates.
LundinCast
  • 9,412
  • 4
  • 36
  • 48