本文介绍了如何使用服务帐户与gsutil,用于上传到CS + BigQuery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 首先,我尝试上传数据到gsutil,通过使用我在Google API控制台中创建的服务帐户来上传数据到Google BigQuery使用 gsutil 访问云存储,因为这似乎是推荐的模式。一切工作正常与Gmail用户批准,但它不允许我使用服务帐户。 看来我可以使用Python API来获取访问令牌使用已签名的JWT凭据,但我更愿意使用像gsutil这样的命令行工具来支持可恢复上传等。 编辑:我想在cron中使用gsutil将文件上传到Cloud Storage,然后将它们导入到BigQuery中。 任何帮助或指示将不胜感激。 解决方案支持服务帐户的gsutil新版本(3.26)(以及许多其他功能和错误修复)。如果你已经安装了gsutil,你可以运行以下版本: gsutil update 简而言之,可以通过运行配置一个服务帐户: gsutil config -e 有关更多信息,请参阅gsutil help config有关使用config命令的详细信息。 Mike Schwartz,Google云端存储团队 Mike Swwartz,谷歌云存储团队Mike Schwartz,谷歌云存储团队 How do I upload data to Google BigQuery with gsutil, by using a Service Account I created in the Google APIs Console?First I'm trying to upload data to Cloud Storage using gsutil, as that seems to be the recommended model. Everything works fine with gmail user approval, but it does not allow me to use a service account.It seems I can use the Python API to get an access token using signed JWT credentials, but I would prefer using a command-line tool like gsutil with support for resumable uploads etc.EDIT: I would like to use gsutil in a cron to upload files to Cloud Storage every night and then import them to BigQuery.Any help or directions to go would be appreciated. 解决方案 Google Cloud Storage just released a new version (3.26) of gsutil that supports service accounts (as well as a number of other features and bug fixes). If you already have gsutil installed you can get this version by running:gsutil updateIn brief, you can configure a service account by running:gsutil config -eSee "gsutil help config" for more details about using the config command. See "gsutil help creds" for information about the different flavors of credentials (and different use cases) that gsutil supports.Mike Schwartz, Google Cloud Storage Team 这篇关于如何使用服务帐户与gsutil,用于上传到CS + BigQuery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-19 22:51