You can create a Kafka peer using this endpoint. Here is the request and response format for creating a Kafka peer.
Request Fields
Configuration of the peer to be created.
The name of the peer to be created.
The type of peer to be created. The value for Kafka is 9.
Configuration for the Kafka peer
Array of Kafka servers. Ex: ["localhost:9092"]
The username to connect to the Kafka server.
The password associated with the Kafka user.
sasl
PLAIN|SCRAM-SHA-256|SCRAM-SHA-512
required
The SASL mechanism to use. Ex: PLAIN
Whether the Kafka server is running without TLS. Default is false
.
partitioner
LeastBackup|Manual|RoundRobin|StickyKey|Sticky|
required
The partitioner to use. Default is empty string.
Whether you wish to update a peer with this name if it already exists. Default is false
.
Response Fields
Whether the creation/update was successful. If yes, the value will be CREATED
. Else it will be FAILED
.
curl --request POST \
--url http://localhost:3000/api/v1/peers/create \
--header 'Authorization: Basic OmJsYWNrU3dhbpEyMw==' \
--header 'Content-Type: application/json' \
--data '{
"peer": {
"name": "kafka_peer_via_api",
"type": 9,
"kafka_config": {
"servers": ["localhost:9092"],
"username": "kafka",
"password": "kafka",
"sasl": "PLAIN",
"disable_tls": false,
"partitioner": "RoundRobin"
}
},
"allow_update":false
}'
{
"status": "CREATED",
"message": ""
}