What is the best JSON API method to check if an object with the given name exists in a Google storage bucket?
Google Cloud Storage is the object storage service offered by Google Cloud.
Cloud Storage is a service for storing your objects in Google Cloud. An object is an immutable piece of data consisting of a file of any format. You store objects in containers called buckets.
You can use storage.objects.get and check for a 404 response. Alternatively, if you want to create an object only if doesn't already exist, you can set the ifGenerationMatch parameter to 0. If the object already exists, a precondition failure will be returned.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With