Kafka Connect
Get the worker’s version information
curl localhost:8083/ | jq
{
"version": "0.10.0.1-cp1",
"commit": "ea5fcd28195f168b"
}
List the connector plugins available on this worker
curl localhost:8083/connector-plugins | jq
Listing active connectors on a worker
curl localhost:8083/connectors
create connector
curl -XPOST http://10.10.100.11:8084/connectors -H 'Content-Type: application/json' -d'
{
"name": "person_group_es_sink",
"config": {
"connector.class": "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector",
"tasks.max": "10",
"topics": "person_group",
"connection.url": "http://10.10.100.59:9200,http://10.10.100.77:9200,http://10.10.100.99:9200",
"batch.size": "2000",
"linger.ms": "5",
"max.in.flight.requests": "11",
"type.name": "person_group",
"key.ignore": "false",
"schema.ignore": "true"
}
}
'
delete a connector
curl -XDELETE http://10.10.100.11:8084/connectors/person_group_es_sink
restart a connector
curl -X POST localhost:8084/connectors/person_group_es_sink/restart
pause a connector
curl -X PUT localhost:8084/connectors/person_group_es_sink/pause
Resuming a connector
curl -X PUT localhost:8084/connectors/person_group_es_sink/resume
Updating connector configuration
curl -X PUT -H "Content-Type: application/json" --data '{"connector.class":"FileStreamSinkConnector","file":"test.sink.txt","tasks.max":"2","topics":"connect-test","name":"local-file-sink"}' localhost:8083/connectors/local-file-sink/config
Getting connector status
curl localhost:8083/connectors/person_group_es_sink/status | jq
{"name":"person_group_es_sink","connector":{"state":"RUNNING","worker_id":"10.10.101.11:8084"},"tasks":[{"state":"RUNNING","id":0,"worker_id":"10.10.101.16:8084"},{"state":"RUNNING","id":1,"worker_id":"10.10.101.15:8084"},{"state":"RUNNING","id":2,"worker_id":"10.10.101.14:8084"},{"state":"RUNNING","id":3,"worker_id":"10.10.101.12:8084"},{"state":"RUNNING","id":4,"worker_id":"10.10.101.13:8084"},{"state":"RUNNING","id":5,"worker_id":"10.10.101.11:8084"},{"state":"RUNNING","id":6,"worker_id":"10.10.101.16:8084"},{"state":"RUNNING","id":7,"worker_id":"10.10.101.15:8084"},{"state":"RUNNING","id":8,"worker_id":"10.10.101.14:8084"},{"state":"RUNNING","id":9,"worker_id":"10.10.101.12:8084"}]}
Getting tasks for a connector
curl localhost:8083/connectors/person_group_es_sink/tasks | jq
Restarting a task
curl -X POST localhost:8083/connectors/person_group_es_sink/tasks/0/restart
(no response printed if success)
Getting connector info
curl localhost:8083/connectors/person_group_es_sink | jq
Getting connector config
curl localhost:8083/connectors/person_group_es_sink/config | jq