英文:
Can Google Cloud Dataflow be run without an external IP address in Go?
问题
根据文档,可以在不使用公共 IP 的情况下运行 Dataflow。但是文档中只提供了 Java 和 Python 的信息,我找不到在 Go 中实现的方法 :-(。
英文:
According to the documentation it's possible to run Dataflow without using public IP. But it only have information for Java and Python. I'm not able to find a way to do it in Go :-(.
答案1
得分: 1
Go语言目前尚未在Dataflow上得到官方支持(因此缺乏文档),但是Go SDK中存在相同的标志,并且应该以完全相同的方式工作。
英文:
Go is not yet officially supported on Dataflow (hence the lack of documentation), but the same flags exist in the Go SDK and should work exactly the same way.
答案2
得分: 0
解决方案:
IpConfiguration: "WORKER_IP_PRIVATE"
上下文如下:
response := dataflowService.Projects.Locations.Templates.Create(PROJECT_ID, location, &dataflow.CreateJobFromTemplateRequest{
Environment: &dataflow.RuntimeEnvironment{
AdditionalExperiments: []string{},
AdditionalUserLabels: map[string]string{},
BypassTempDirValidation: false,
EnableStreamingEngine: false,
IpConfiguration: "WORKER_IP_PRIVATE",
KmsKeyName: "",
MachineType: "",
MaxWorkers: 0,
Network: "",
NumWorkers: 0,
ServiceAccountEmail: "",
Subnetwork: "https://www.googleapis.com/compute/v1/projects/" + HOST_PROJECT_ID + "/regions/europe-north1/subnetworks/" + SUBNETWORK + "",
TempLocation: "",
WorkerRegion: "",
WorkerZone: "",
Zone: "",
ForceSendFields: []string{},
NullFields: []string{},
},
英文:
Solution:
IpConfiguration: "WORKER_IP_PRIVATE"
Like this for context:
response := dataflowService.Projects.Locations.Templates.Create(PROJECT_ID, location, &dataflow.CreateJobFromTemplateRequest{
Environment: &dataflow.RuntimeEnvironment{
AdditionalExperiments: []string{},
AdditionalUserLabels: map[string]string{},
BypassTempDirValidation: false,
EnableStreamingEngine: false,
IpConfiguration: "WORKER_IP_PRIVATE",
KmsKeyName: "",
MachineType: "",
MaxWorkers: 0,
Network: "",
NumWorkers: 0,
ServiceAccountEmail: "",
Subnetwork: "https://www.googleapis.com/compute/v1/projects/" + HOST_PROJECT_ID + "/regions/europe-north1/subnetworks/" + SUBNETWORK + "",
TempLocation: "",
WorkerRegion: "",
WorkerZone: "",
Zone: "",
ForceSendFields: []string{},
NullFields: []string{},
},
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论