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": ""
}
POST api/v1/peers/create

You can create a Kafka peer using this endpoint. Here is the request and response format for creating a Kafka peer.

Request Fields

peer
object
required

Configuration of the peer to be created.

allow_update
boolean

Whether you wish to update a peer with this name if it already exists. Default is false.

Response Fields

status
CREATED|FAILED

Whether the creation/update was successful. If yes, the value will be CREATED. Else it will be FAILED.

message
string

Error message if any

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": ""
}