我想使用 PYTHON 执行 Google 数据流模板。实际上,我一直在使用Dataflow REST API或Cloud Functions集成执行数据流模板。这是我在 Postman 中执行的 Dataflow 模板:
网址: https://dataflow.googleapis.com/v1b3/projects/{{my-project-id}}/templates:launch?gcsPath=gs://{{my-cloud-storage-bucket}}/temp/cloud-dataprep-template
{
"jobName": "test-datfalow-job",
"parameters": {
"inputLocations" : "{\"location1\":\"gs://{{my-cloud-storage-bucket}}/my-folder/**/*\"}",
"outputLocations": "{\"location1\":\"gs://{{my-cloud-storage-bucket}}/my-output/output.csv\"}"
},
"environment": {
"tempLocation": "gs://{{my-cloud-storage-bucket}}/tmp",
"zone": "us-central1-f"
}
}
Run Code Online (Sandbox Code Playgroud)
我不知道是否有机会使用 google-api-python-client 或者我必须使用 python 的 requests.post 和 Google Cloud Authentication 执行此 HTTP POST