Dataflow API 不会在 GCP 中激活

Dataflow API will not activate in GCP

我正在尝试在我的项目中使用数据流 API。在云仪表板中,我使用规定的 link 启用了所有 API:https://console.cloud.google.com/flows/enableapi?apiid=dataflow,compute_component,logging,storage_component,storage_api,bigquery,pubsub,datastore&redirect=https:%2F%2Fcloud.google.com%2Fdataflow%2Fgetting-started&showconfirmation=true&_ga=1.200330088.756201991.1447156694

但是,当我在 eclipse 中 运行 我的数据流作业时,我得到 运行 时间错误:

原因:java.lang.RuntimeException:无法创建工作流作业:Project 尚未启用 API。请使用 Google Developers Console 为您的项目激活 'dataflow' API。 在 com.google.cloud.dataflow.sdk.runners.DataflowPipelineRunner.run(DataflowPipelineRunner.java:572) 在 com.google.cloud.dataflow.sdk.runners.DataflowPipelineRunner.run(DataflowPipelineRunner.java:190) 在 com.google.cloud.dataflow.sdk.Pipeline.run(Pipeline.java:180) 在 com.ri.gateway.storedata.CloudConnectPipeline.main(CloudConnectPipeline.java:146)

原因:com.google.api.client.googleapis.json.GoogleJsonResponseException:403 禁止访问 { "code" : 403, "errors":[{ "domain" : "global", "message" : "Project has not enabled the API. Please use Google Developers Console to activate the 'dataflow' API for your project.", "reason" : "forbidden" } ], "message" : "Project has not enabled the API. Please use Google Developers Console to activate the 'dataflow' API for your project.", "status" : "PERMISSION_DENIED" }

我不确定为什么会发生这种情况 - 因为 API 似乎通过 gcp 仪表板处于活动状态?

请仔细检查您是否针对同一个 Google Cloud Platform 项目 提交 Cloud Dataflow 作业,您启用了 Cloud APIs在。这与您从中启动作业的 Eclipse 项目不同。

如果 Google 开发人员控制台显示 Cloud Dataflow API 已启用,很可能是 Eclipse 中的 --project 管道选项设置不正确。请注意项目id、项目名称、项目编号的区别。请使用项目 ID,而不是其他 GCP 项目标识符。

最后,我们偶尔会看到通过您上面发布的 link 启用 API 没有生效。几乎总是,在解决问题后不久重试。