Hello,
I have developed a Python script based on the SDK version 6.4 documentation, but I got an error when I ran the script:
“raise EnginelessError(streamsets.sdk.exceptions.EnginelessError: The SDK does not support publishing engineless pipelines. Please visit the UI to get instructions on how to install a deployment and engine, to proceed further.”.
It’s odd becausethe deployment and engine have already been set up. The engine’s information has been included in the script. I’m not sure why I’m getting this error.
# Import the ControlHub class from the SDK.
from streamsets.sdk import ControlHub
from streamsets.sdk import DataCollector
from datetime import datetime
# Connect to the Control Hub instance you want to interact with.
sch = ControlHub(credential_id='example123', token='example123')
print("connected")
# Get the engine information
sdc = sch.data_collectors.get(engine_url='https://example.org:12345')
id = sdc.id
print(f"Found the Data Collector with ID: {sdc.id}")
# Build the pipeline
pipeline_builder = sch.get_pipeline_builder(id=sdc.id)
dev_raw_data_source = pipeline_builder.add_stage('Dev Raw Data Source')
trash = pipeline_builder.add_stage('Trash')
# Connecting the stages together
dev_raw_data_source >> trash
print("pipeline created")
# Use the pipeline_builder to build the pipeline and name it 'SDK Example Pipeline'.
sdk_example_pipeline = pipeline_builder.build('SDK Example Pipeline')
# Add the pipeline to the SCH instance, effectively publishing the pipeline for use.
sch.publish_pipeline(sdk_example_pipeline)
#sch.publish_pipeline(pipeline, commit_message='First commit of my first pipeline')
print("published")
Thank you.