Is there a way I can trigger a tap via a REST API ...
# singer-tap-development
n
Is there a way I can trigger a tap via a REST API endpoint? I currently run my meltano taps in docker as scheduled jobs using Dagster (similar to airflow).
If I just want to confirm the auth success which Meltano command should I run?
e
If I just want to confirm the auth success which Meltano command should I run?
Probably
meltano config <plugin name> test
n
Is there a way to run this command in code (CLI commands in code)
e
The CLI is the only stable interface we support at the moment, but you could try calling the same code that the
click
subcommand calls after looking at the source on github. Other than that, you could always use
subprocess
.
a
Use Matatika to host your project and start your pipeline with our API. No change to your Meltano project required. https://www.matatika.com/docs/api/resources/jobs#create-a-job-from-a-pipeline
n
@Edgar Ramírez (Arch.dev) I was going through Singer SDK. I am wondering if there's a way to use "self.tap.run_connection_test()" as shown here: https://github.com/meltano/sdk/blob/main/singer_sdk/testing/tap_tests.py I am only trying to verify connection success (connection credentials). I am planning on running a separate server and calling a function within the tap namespace with the credentials as parameters (copying them to env variables and using in YAML).
Or use run_sync_dry_run?
e
You'd probably need to run the tap as part of a web server, so I'm not sure if it's really useful for your purposes. You could have though have a web server that calls the tap in a subprocess with
tap-example --config ... --test
n
I am trying use the inbuilt functions, for example I am not sure why this shouldn't work: tap1 = Tapduo(config=SAMPLE_CONFIG, parse_env_config=True) resp = tap1.run_sync_dry_run( dry_run_record_limit=1, streams=[ActivityLogStream] )
I'd need to pass different config and test individual stream connection, that's why trying this instead
e
Well there's no better way to know than trying it 😅
😅 1
n
I used run_sync_dry_run and this works well. Using this I can pass the config of the tap and specify which stream to do a connection test on. It returns True if the dry run is successful. Even if the source sends an exception like 429 but the auth was successful it returns True.
👍 1