The CLI can create, modify, pause, restart, and remove Apache Kafka Connect connectors. Kafka Connect cluster permissions will be applied to each operation. The commands for these actions are shown in the table below.
config
create
delete
pause
restart
resume
status
task
tasks
update
List the connectors
lenses-cli connectors
List currently deployed connectors, optionally filter by name, cluster and namespace:
lenses-cli connectors --cluster-name="dev" #[[--names [--unwrap]]
The --names flag displays only the names of the connectors. When used with --unwrap, it will print each connector name on a separate line in the output.
--names
--unwrap
lenses-cli connectors --supported
lenses-cli connectors plugins --cluster-name="dev"
lenses-cli connector create \ --name=example \ --cluster-name=dev \ --configs='{"connector.class":"org.apache.kafka.connect.file.FileStreamSinkConnector", "file":"/dev/null", "name":"example", "tasks.max":"8", "topics":"test_topic"}'
You can create a connector using a file:
lenses-cli connector create ./connector.yaml
Example file:
clusterName: dev config: connector.class: "org.apache.kafka.connect.file.FileStreamSinkConnector" file: "/dev/null" tasks.max: "2" topics: "test_topic" name: "example"
# Inline lenses-cli connector update \ --name=example \ --cluster-name=dev \ --configs='{"connector.class":"org.apache.kafka.connect.file.FileStreamSinkConnector", "file":"/dev/null", "name":"example", "tasks.max":"2", "topics":"test_topic"}' # or from file lenses-cli connector update ./connector.yaml
lenses-cli connector config \ --cluster-name="dev" \ --name="nullsink"
lenses-cli connector status \ --cluster-name="dev" \ --name="nullsink"
lenses-cli connector pause \ --cluster-name="dev" \ --name="nullsink"
lenses-cli connector resume \ --cluster-name="dev" \ --name="nullsink"
lenses-cli connector restart \ --cluster-name="dev" \ --name="nullsink"
lenses-cli connector task restart \ --task=0 \ --cluster-name="dev" \ --name="nullsink"
lenses-cli connector tasks \ --cluster-name="dev" \ --name="nullsink"
lenses-cli connector task status \ --cluster-name="dev" \ --name="nullsink" --task=1
lenses-cli connector delete \ --cluster-name="dev" \ --name="nullsink"
On this page