英文:
Cloud Function to trigger a Dataflow job in Go
问题
我有一个使用Python SDK编写的Dataflow作业。但是我想使用Go编写的Cloud Functions来触发这个Dataflow作业。我找到了一个类似的线程,其中的函数是用Python编写的Trigger Dataflow with Python。
我的流程如下:
- 使用PubSub通知来触发Cloud Functions。
- 使用Go编写的Cloud Functions来启动一个使用Python编写的DataFlow作业。
我可以将Dataflow SDK作为模板。有没有关于如何从Go触发Python Dataflow模板的指导?或者有没有更好的方法?
非常感谢!
英文:
I have a Dataflow job written using the Python SDK. But I want to trigger this Dataflow Job using Cloud Functions which should written in Go. I found a thread similar to this which has the function written in Python Trigger Dataflow with Python
My flow would be like below:
- PubSub Notification to trigger Cloud Functions
- Cloud Functions written in Go to start a DataFlow Job written in Python
I can make the Dataflow SDK as a template. Any pointers on how I can trigger the Python Dataflow templates from Go? Or is there a better way for it?
Many thanks!
答案1
得分: 3
检查 "google.golang.org/api/dataflow/v1b3" 包
我没有测试的方法,但我认为代码看起来像这样
ctx := context.Background()
dataflowService, _ := dataflow.NewService(ctx)
jobService := dataflow.NewProjectsJobsService(dataflowService)
jobService.Get("project", "job id").Do()
英文:
check "google.golang.org/api/dataflow/v1b3" package
I don't have a way to test it, but I think it looks like a code like this
ctx := context.Background()
dataflowService, _ := dataflow.NewService(ctx)
jobService := dataflow.NewProjectsJobsService(dataflowService)
jobService.Get("project ", "job id").Do()
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论