I am using Python SDK to build pipeline and using Start Jobs as processor but I am not able to add “Identifier” with Job ID configuration using SDK also how to add authentication type as username and password using SDK itself.
Solved
Difficulty finding configuration of Start Job using SDK
Best answer by Sanjeev
ControlHub.VERIFY_SSL_CERTIFICATES = False
sch = ControlHub(server_url=SCH_URL, credential_id=CRED_ID, token=CRED_TOKEN)
pipeline_builder = sch.get_pipeline_builder(engine_id=ENGINE_ID, engine_type=ENGINE_TYPE)
jobs = [
{
"jobIdType": "ID",
"jobId": "334cecc8-9b95-477a-8940-7a4857758068:cd4694f6-2c60-11ec-988d-5b2e605d28aa"
}
]
dev_raw_data_source = pipeline_builder.add_stage('Dev Raw Data Source')
start_job_processor = pipeline_builder.add_stage('Start Jobs')
start_job_processor.set_attributes(task_name='my_job',
control_hub_url=SCH_URL,
jobs=jobs,
auth_id=CRED_ID,
password=CRED_TOKEN)
trash = pipeline_builder.add_stage('Trash')
dev_raw_data_source >> start_job_processor >> trash
pipeline = pipeline_builder.build('Sanju_StartJob_Test')
sch.publish_pipeline(pipeline, commit_message='Testing start job processor')
please refer to approach described @ https://github.com/streamsets/tutorials/tree/master/sdk-tutorials/find-methods-fields to figure out the available methods/attributes for a given stage. Hope this helps
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.