更新时间:2025-09-03 GMT+08:00
查询Topic的分区列表
功能介绍
查询Topic的分区列表
URI
GET /v2/{project_id}/kafka/instances/{instance_id}/topics/{topic}/partitions
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
项目ID,获取方式请参见获取项目ID。 |
instance_id |
是 |
String |
实例id |
topic |
是 |
String |
主题 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
offset |
否 |
Integer |
偏移量,表示查询该偏移量后面的记录 |
limit |
否 |
Integer |
查询返回记录的数量限制 |
请求参数
无
请求示例
查询topic的分区列表
GET https://{endpoint}/v2/{project_id}/kafka/instances/{instance_id}/topics/{topic}/partitions?start=1&limit=10
响应示例
状态码:200
查询topic的分区列表成功
{ "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 } ] }
状态码
状态码 |
描述 |
---|---|
200 |
查询topic的分区列表成功 |
错误码
请参见错误码。
父主题: 主题管理