storage: delete folder without iterator #10025
Labels
api: storage
Issues related to the Cloud Storage API.
type: question
Request for information or clarification. Not an issue.
Is your feature request related to a problem? Please describe.
Currently I am using a "transformations" bucket that contains modified versions of an original image stored in an "uploads" bucket. I store these transformed images in folders like so:
/{originalSHA256Hash}/{nameOfTransformations}.{extension}
. But if a user wants to delete their original upload, I now have to query the bucket with a prefix and delete each object individually.Describe the solution you'd like
I'd like to be able to delete an entire folder with one request. A possible implementation could be something like this:
Describe alternatives you've considered
Delete all objects inside a folder using goroutines. This introduces a bunch of network traffic that could be prevented.
Using lifecycle object management rules with a prefix to achieve this. Does the job, but your service needs to have permission to create these rules and might not delete the folder immediately.
You can just call the existing endpoint of the Google API via any HTTP Client to achieve the desired end result.
Additional context
The Google API already supports this feature through the web interface.
The text was updated successfully, but these errors were encountered: