是不是要创建一个新版本而不是删除它?这是命令: cmd-that-streams |gsutil cp -v-gs://my-bucket/$ {FILE} ResumableUploadAbortException:403 [email protected]没有对我的存储桶/文件的storage.objects.delete访问权限 我已经仔细检查了存储桶上是否启用了版本控制 >gsutil版本控制获取gs://my-bucketgs://my-bucket:已启用 解决方案如果要按照以下方式执行 gsutl cp 命令,则需要 storage.objects.delete 权限 I'm using a service account to upload a file to Google Cloud Storage bucket that has versioning. I want to keep the service account privileges minimal, it only ever needs to upload files so I don't want to give it permission to delete files, but the upload fails (only after streaming everything!) saying it requires delete permission.Shouldn't it be creating a new version instead of deleting?Here's the command:cmd-that-streams | gsutil cp -v - gs://my-bucket/${FILE}ResumableUploadAbortException: 403 [email protected] does not have storage.objects.delete access to my-bucket/fileI've double checked that versioning is enabled on the bucket> gsutil versioning get gs://my-bucketgs://my-bucket: Enabled 解决方案 The permission storage.objects.delete is required if you are executing the gsutl cp command as per cloud storage gsutil commands.Command: cpRequired permissions:storage.objects.list* (for the destination bucket)storage.objects.get (for the source objects)storage.objects.create (for the destination bucket)storage.objects.delete** (for the destination bucket)**This permission is only required if you don't use the -n flag and you insert an object that has the same name as an object that alreadyexists in the bucket.Google docs suggests to use -n (do not overwrite an existing file) so storage.objects.delete won't be required. But your use case uses versioning and you will be needing to overwrite, thus you will need to add storage.objects.delete on your permissions.I tested this with a bucket versioning is enabled and only has 1 version. Service account that have roles Storage Object Creator and Storage Object Viewer.See screenshot for the commands and output: 这篇关于为什么gsutil cp在版本化存储桶上需要storage.objects.delete?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-01 22:01