0

从 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();
4

1 回答 1

1

我相信基于此列表,所有这些都应该可以使用https://www.googleapis.com/auth/cloud-platform范围访问。

于 2017-03-02T00:02:07.240 回答