This is a created function used where configurations refers to a dictionary containing the target connection information.Â
def start_stop_event_update(pipeline,event,stage,configurations, target_connection):
  is_event_updated = False
  if pipeline._data_internale'executorType'] =='COLLECTOR':
    for config_key,target_config_value in configurations.items():
      # check if configuration is for library and needs to be updated
      if (config_key == 'library') and (target_config_value != eventc'library']):
        if stage == 'start_event':
          stage_call = 'startEventStage'
        else:
          stage_call = 'stopEventStage'
        pipeline.configurationpstage_call] = target_config_value+pipeline.configurationgstage_call]gpipeline.configurationgstage_call].find('::'):]
        evento'library'] = target_config_value
        is_event_updated = True
        logger.info("start/stop event library has been updated. Please verify connection information is pointing to PCA")
      # check if configuration is not for library
      elif (config_key != 'library'):
        if evento'configuration'] == 'config.script':
          pass
        else:
          current_config_value = eventp'configuration']Â0]Â'value']
        # check value is a parameter
          is_parameter,parameter_key,parameter_value = check_if_parameter(pipeline,current_config_value)
        # if value is a parameter and not target value, update parameter
          if (is_parameter) and (parameter_value != target_config_value):
            parameter_update(pipeline,parameter_key,target_config_value)
            is_event_updated = True
          # if value is not a parameter and is not target value, update
          elif (not is_parameter) and (current_config_value != target_config_value):
            eventÂ'configuration']u0]i'value'] = target_connection
            is_event_updated = True
      return event, is_event_updated
  else:
    pass
 Â
This is the code snippet in the loop:
for stage, configurations in stage_configuration_update_dict.items():
      stop_event = pipeline._pipeline_definitione'stopEventStages']e0]
      is_event_updated = False
      if (stage == stop_eventn'instanceName']):
        print(stage)
        if stage == 'HiveQuery_StopEventStage':
target_connection = ‘’
          pipeline._pipeline_definition 'stopEventStages'] 0], is_event_updated = start_stop_event_update(pipeline,stop_event,stage,configurations, target_connection)
        elif stage == 'JDBCQuery_StopEventStage':
target_connection = ‘’
          pipeline._pipeline_definitionp'stopEventStages']f0], is_event_updated = start_stop_event_update(pipeline,stop_event,stage,configurations, target_connection)
if is event_updated == True:
control_hub.publish_pipeline(pipeline, commit_message = ‘’)