If I use this json parameter to trigger a DAG {"number":["1","2","3"], "items":["a", "b", "c"]}, how can I use dag_run.conf to access the values and pass them to the ssh command in the SSHoperator task?
For example
def run_config(**kwargs):
number_input = kwargs['dag_run'].conf.get('number')
items_input = kwargs['dag_run'].conf.get('items')
return number_input, items_input
#assign the returned values from the run_config function to the following variables
number, item = run_config
#use the above 2 variables as argument in the following ssh command call
with DAG(blah blah blah) as dag:
for i in range(0, len(number)):
process_task = SSHOperator(
task_id='run_'.format(number[i]),
command='run_somthing.sh' + ' ' + number[i] + ' ' + item[i]
)