Hi,
I am triggering the dag using the following command:
curl -kX POST
https://smtca01379.rd.corpintra.net:8081/api/experimental/dags/api_test/dag_runs
-H 'Cache-Control: no-cache' -H 'Content-Type: application/json' -d
'{"conf":"{\"input_path\":\"/mapr/ayush\",
\"output_path\":\"/mapr/output\", \"output_format\":\"/mapr/type\",
\"path_desc_file\":\"/mapr/path_desc_file\"}"}'
I am able to get access to parameters inside my code using:
params['dag_run'].conf['input_path']
After running the curl command I am getting the response as:
{"execution_date":"2020-07-07T13:00:02+00:00","message":"Created <DagRun
api_test @ 2020-07-07 13:00:02+00:00: manual__2020-07-07T13:00:02+00:00,
externally triggered: True>","run_id":"manual__2020-07-07T13:00:02+00:00"}
Is there any way in which I can validate the conf parameters which are sent
through rest api?
for example: I want to check whether input path given exists on the cluster
or not. If it does not exist, we should get an error and the dag should
not trigger.
If the validation fails, the response should be sent back to the api.
Thanks and Regards,
Ayush Goel