我想揭开序幕数据流工作,一旦我在云中删除一个文件storage.And我开始了云功能来触发它。但是我不知道如何启动与Python?有人可以帮助datadlow工作?
const kickOffDataflow = (input, output) => {
var jobName = CONFIG.DATAFLOW_JOB_NAME;
var templatePath = CONFIG.TEMPLETE_FILE_PATH;
var request = {
projectId: "test",
requestBody: {
jobName: jobName,
parameters: {
configFile: input,
outputFile: output,
mode: "cluster_test"
},
environment: {
zone: "europe-west1-b"
}
},
gcsPath: templatePath
}
console.log("Start to create " + jobName + " dataflow job");
return google.auth.getClient({
scopes: ['https://www.googleapis.com/auth/cloud-platform']
}).then(auth => {
request.auth = auth;
return dataflow.projects.templates.launch(request);
}).catch(error => {
console.error(error);
throw error;
});
}
看看在Dataflow Cloud Composer Example。它描述了如何云作曲家可以与云功能结合使用时,一个新的文件到达一个GCS斗触发一个基于Python的数据流任务。