Ashok KS
Ashok KS

Reputation: 691

Cloud Function to trigger a Dataflow job in Go

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:

  1. PubSub Notification to trigger Cloud Functions
  2. 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!

Upvotes: 1

Views: 194

Answers (1)

Source code
Source code

Reputation: 321

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()

Upvotes: 3

Related Questions