【问题标题】:Service account credential for Dataflow pipline optionsDataflow 管道选项的服务帐号凭据
【发布时间】: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


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2015-04-29
      • 2019-04-10
      • 1970-01-01
      • 1970-01-01
      • 2016-03-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-18
      相关资源
      最近更新 更多