Reassigning Replicas of a Topic for a Kafka Instance
Function
This API is used to reassign replicas of a topic for a Kafka instance.
Debugging
You can use API Explorer to debug this API.
URI
POST /v2/{project_id}/instances/{instance_id}/management/topics/{topic}/replicas-reassignment
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Project ID. |
| instance_id | Yes | String | Instance ID. |
| topic | Yes | String | Topic name. |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| partitions | No | Array of partitions objects | Assignment of replicas of the partition after the change. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| partition | No | Integer | Partition ID. |
| replicas | No | Array of integers | ID of the broker where the replica is expected to reside. The first integer in the array represents the leader replica broker ID. All partitions must have the same number of replicas. The number of replicas cannot be larger than the number of brokers. |
Response Parameters
None
Example Requests
POST https://{endpoint}/v2/{project_id}/instances/{instance_id}/management/topics/{topic}/replicas-reassignment
{
"partitions" : [ {
"partition" : 1,
"replicas" : [ 1, 2 ]
}, {
"partition" : 0,
"replicas" : [ 0, 1 ]
} ]
} Example Responses
None
Status Codes
| Status Code | Description |
|---|---|
| 204 | The replicas are reassigned successfully. |
Error Codes
See Error Codes.
Last Article: Adding Partitions to a Topic for a Kafka Instance
Next Article: Querying the Disk Usage Status of Topics
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.