This API is used to query the partition list of a topic.
GET /v2/{project_id}/kafka/instances/{instance_id}/topics/{topic}/partitions
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain it, see Obtaining a Project ID. |
instance_id |
Yes |
String |
Instance ID. |
topic |
Yes |
String |
Topic. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
offset |
No |
Integer |
Offset. The records after this offset will be queried. |
limit |
No |
Integer |
Maximum number of records that can be returned. |
None
Status code: 200
Parameter |
Type |
Description |
---|---|---|
total |
Integer |
Total records. |
partitions |
Array of partitions objects |
Partition array. |
Querying the partition list of a topic
GET https://{endpoint}/v2/{project_id}/kafka/instances/{instance_id}/topics/{topic}/partitions?start=1&limit=10
Status code: 200
The partition list of the topic is queried successfully.
{ "total" : 3, "partitions" : [ { "partition" : 0, "start_offset" : 0, "last_offset" : 1216303, "message_count" : 1216303, "last_update_time" : 1688011291458 }, { "partition" : 1, "start_offset" : 0, "last_offset" : 985447, "message_count" : 985447, "last_update_time" : 1688011291469 }, { "partition" : 2, "start_offset" : 0, "last_offset" : 923340, "message_count" : 923340, "last_update_time" : 1688011291526 } ] }
Status Code |
Description |
---|---|
200 |
The partition list of the topic is queried successfully. |
See Error Codes.