+# Start data delivery for a job, action : START or STOP
+# URI and parameters (POST): "/jobdata/<string:producer_id>/<string:job_id>?action=action"
+# response: 200 or 204
+@app.route(JOB_DATA,
+ methods=['POST'])
+def start_jobdata(producer_id, job_id):
+
+ action=request.args.get('action')
+
+ if (action is None):
+ return UNKNOWN_QUERY_PARAMETERS,400
+ else:
+ if (len(request.args) != 1):
+ return UNKNOWN_QUERY_PARAMETERS,400
+ else:
+ if ((action != "START") and (action != "STOP")):
+ return UNKNOWN_QUERY_PARAMETERS,400
+
+ print("Job data action received for producer: "+str(producer_id)+" and job: "+str(job_id) + " action: " + action)
+
+ job_dict=get_callback_dict(producer_id, job_id)
+ if (job_dict is None):
+ return JOB_NOT_FOUND,404
+
+ if (job_dict['json'] is None):
+ return JOB_DATA_NOT_FOUND, 400
+ else:
+ if (action == "START"):
+ job_dict['delivering']=True
+ else:
+ job_dict['delivering']=False
+ return "",200
+