Last active
July 28, 2017 16:39
-
-
Save cjmatta/1fbe85a20b2811e2b0852ee2f7aebc2c to your computer and use it in GitHub Desktop.
Script to submit JSON connector config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "wikipedia-irc", | |
"config": { | |
"producer.interceptor.classes": "io.confluent.monitoring.clients.interceptor.MonitoringProducerInterceptor", | |
"connector.class": "org.cmatta.kafka.connect.irc.IrcSourceConnector", | |
"irc.server": "irc.wikimedia.org", | |
"kafka.topic": "wikipedia.raw", | |
"irc.channels": "#en.wikipedia,#en.wiktionary,#en.wikibooks,#en.wikinews,#es.wikipedia,#fr.wikipedia", | |
"tasks.max": "2" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ $2 ]];then | |
CONNECT_HOST=$1 | |
INPUT_FILE=$2 | |
else | |
CONNECT_HOST=localhost:8083 | |
INPUT_FILE=$1 | |
fi | |
if [[ ! -f $INPUT_FILE ]]; then | |
echo "ERROR: Input file ${INPUT_FILE} not found!"; | |
fi | |
HEADER="Content-Type: application/json" | |
echo "curl -s -X POST -H \"${HEADER}\" --data @${INPUT_FILE} http://${CONNECT_HOST}/connectors" | |
curl -s -X POST -H "${HEADER}" --data @${INPUT_FILE} http://${CONNECT_HOST}/connectors | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment