我想使用PYTHON执行Google数据流模板。实际上,我一直在使用Dataflow REST API或Cloud Functions Integration执行Dataflow模板。这是我在Postman中执行的Dataflow模板:
URL:https://dataflow.googleapis.com/v1b3/projects/ {{my-project-id}} / templates:launch?gcsPath = gs:// {{my-cloud-storage-bucket}} / temp / cloud-dataprep-template < / p>
{
"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"
}
}
我不知道是否有机会使用google-api-python-client,或者我必须使用python的requests.post和Google Cloud Authentication执行此HTTP POST
答案 0 :(得分:3)
您可以使用launch中的模板Dataflow API Client Library for Python方法来做到这一点,就像这样:
npm ERR! code E404
npm ERR! 404 Not found :<package>
npm ERR! 404
npm ERR! 404 '<package>' is not in the npm registry.