【发布时间】:2017-03-01 15:44:06
【问题描述】:
从 Dataflow 1.9 升级到 Beam 0.4.0。 GcpOptions 上设置服务帐户名称 (setServiceAccountName) 和密钥文件 (setServiceAccountKeyFile) 的方法不再可用。最接近的选择是setGcpCredential。
要手动创建 GoogleCredential,应该使用哪些合适的范围?我的管道需要访问 PubSub、Datastore 和 BigQuery,可能还有 Cloud Storage。
new GoogleCredential.Builder()
.setTransport(HTTP_TRANSPORT)
.setJsonFactory(JSON_FACTORY)
.setServiceAccountId(serviceAccount)
.setServiceAccountScopes(SCOPES) // what will be the scopes?
.setServiceAccountPrivateKeyFromP12File(p12file)
.build();
【问题讨论】:
标签: google-cloud-dataflow apache-beam