Skip to content

Instantly share code, notes, and snippets.

@Joel-hanson
Created June 19, 2024 13:43
Show Gist options
  • Save Joel-hanson/2fbfee824abff3ecadb14e04f869f0ae to your computer and use it in GitHub Desktop.
Save Joel-hanson/2fbfee824abff3ecadb14e04f869f0ae to your computer and use it in GitHub Desktop.

1. Get details about this Connect worker and the id of the Kafka cluster it is connected to

curl -X GET "http://localhost:8083/" -H "accept: application/json"

2. List the current loggers and their log levels

curl -X GET "http://localhost:8083/admin/loggers" -H "accept: application/json"

3. Get the log level for the specified logger

curl -X GET "http://localhost:8083/admin/loggers/{logger}" -H "accept: application/json"

4. Set the log level for the specified logger

curl -X PUT "http://localhost:8083/admin/loggers/{logger}?scope=worker" -H "Content-Type: application/json" -d '{ "logLevel": "INFO" }'

5. List all connector plugins installed

curl -X GET "http://localhost:8083/connector-plugins?connectorsOnly=true" -H "accept: application/json"

6. Get the configuration definition for the specified pluginName

curl -X GET "http://localhost:8083/connector-plugins/{pluginName}/config" -H "accept: application/json"

7. Validate the provided configuration against the configuration definition for the specified pluginName

curl -X PUT "http://localhost:8083/connector-plugins/{pluginName}/config/validate" -H "Content-Type: application/json" -d '{ "key": "value" }'

8. List all active connectors

curl -X GET "http://localhost:8083/connectors" -H "accept: application/json"

9. Create a new connector

curl -X POST "http://localhost:8083/connectors" -H "Content-Type: application/json" -d '{ "name": "new-connector", "config": { "connector.class": "org.apache.kafka.connect.file.FileStreamSinkConnector", "tasks.max": "1", "file": "/tmp/test.sink.txt", "topics": "test" } }'

10. Delete the specified connector

curl -X DELETE "http://localhost:8083/connectors/{connector}" -H "accept: application/json"

11. Get the details for the specified connector

curl -X GET "http://localhost:8083/connectors/{connector}" -H "accept: application/json"

12. Get the configuration for the specified connector

curl -X GET "http://localhost:8083/connectors/{connector}/config" -H "accept: application/json"

13. Create or reconfigure the specified connector

curl -X PUT "http://localhost:8083/connectors/{connector}/config" -H "Content-Type: application/json" -d '{ "configKey": "configValue" }'

14. Reset the offsets for the specified connector

curl -X DELETE "http://localhost:8083/connectors/{connector}/offsets" -H "accept: application/json"

15. Get the current offsets for the specified connector

curl -X GET "http://localhost:8083/connectors/{connector}/offsets" -H "accept: application/json"

16. Alter the offsets for the specified connector

curl -X PATCH "http://localhost:8083/connectors/{connector}/offsets" -H "Content-Type: application/json" -d '{ "offsets": [{ "offset": {}, "partition": {} }] }'

17. Pause the specified connector

curl -X PUT "http://localhost:8083/connectors/{connector}/pause" -H "accept: application/json"

18. Restart the specified connector

curl -X POST "http://localhost:8083/connectors/{connector}/restart?includeTasks=false&onlyFailed=false" -H "accept: application/json"

19. Resume the specified connector

curl -X PUT "http://localhost:8083/connectors/{connector}/resume" -H "accept: application/json"

20. Get the status for the specified connector

curl -X GET "http://localhost:8083/connectors/{connector}/status" -H "accept: application/json"

21. Stop the specified connector

curl -X PUT "http://localhost:8083/connectors/{connector}/stop" -H "accept: application/json"

22. List all tasks and their configurations for the specified connector

curl -X GET "http://localhost:8083/connectors/{connector}/tasks" -H "accept: application/json"

23. Get the configuration of all tasks for the specified connector (deprecated)

curl -X GET "http://localhost:8083/connectors/{connector}/tasks-config" -H "accept: application/json"

24. Restart the specified task for the specified connector

curl -X POST "http://localhost:8083/connectors/{connector}/tasks/{task}/restart" -H "accept: application/json"

25. Get the state of the specified task for the specified connector

curl -X GET "http://localhost:8083/connectors/{connector}/tasks/{task}/status" -H "accept: application/json"

26. Get the list of topics actively used by the specified connector

curl -X GET "http://localhost:8083/connectors/{connector}/topics" -H "accept: application/json"

27. Reset the list of topics actively used by the specified connector

curl -X PUT "http://localhost:8083/connectors/{connector}/topics/reset" -H "accept: application/json"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment