在 Google Cloud Storage 中设置元数据(从 BigQuery 导出)

Posted

技术标签:

【中文标题】在 Google Cloud Storage 中设置元数据(从 BigQuery 导出)【英文标题】:Setting Metadata in Google Cloud Storage (Export from BigQuery) 【发布时间】:2014-12-05 15:39:55 【问题描述】:

我正在尝试更新从 BigQuery 导出的几个 CSV/JSON 文件的元数据(以编程方式,来自 Python)。导出数据的应用程序与修改文件的应用程序相同(因此使用相同的服务器证书)。导出一切顺利,直到我尝试使用 objects.patch() 方法来设置我想要的元数据。问题是我不断收到以下错误:

apiclient.errors.HttpError: <HttpError 403 when requesting https://www.googleapis.com/storage/v1/b/<bucket>/<file>?alt=json returned "Forbidden">

显然,这与存储桶或文件权限有关,但我无法绕过它。如果在写入文件和更新文件元数据时使用相同的证书,我无法更新它怎么办?使用相同的证书创建存储桶。

【问题讨论】:

你能用gsutil acl get检查对象上的ACL吗? 【参考方案1】:

如果这是您使用的确切 URL,则说明是 URL 问题:您缺少存储桶名称和对象名称之间的 /o/

【讨论】:

以上是关于在 Google Cloud Storage 中设置元数据(从 BigQuery 导出)的主要内容,如果未能解决你的问题,请参考以下文章

Spring + google cloud:没有可用的“com.google.cloud.storage.Storage”类型的合格bean

google cloud storage products

ReferenceError:导入@google-cloud/storage 时分配的左侧无效

错误:模块“google.cloud.bigquery_storage”没有属性“BigQueryReadClient”

使用 Cloud Functions for Firebase 和 @google-cloud/storage 删除图像时出现问题

google cloud storage托管静态页面