Kafka REST 2.0.1: GET /topics/{topic:string}/partitions
Retrieves a list of partitions for the topic.
Description
Depending on the configuration, the type of information retrieved has different behavior.
See the streams.default.stream
parameter in Kafka REST 2.0.1: Configuration Parameters.
Parameters Defined | Response |
---|---|
streams.default.stream is defined | Gets metadata about specific MapR-ES partitions within a topic. The user could pass fully qualified topic name or not. If a fully qualified topic name is not used, metadata is retrieved and appended to the default stream path. |
streams.default.stream is not defined | Gets metadata about specific MapR-ES partitions within topic. The user could only pass fully qualified topic name that contains stream path. |
Parameters | Description |
---|---|
topic_name (string) | Name of the topic. |
Syntax
http://<host>:8082/topics/<topic_name>/partitions
Request Example
curl -X GET "http://localhost:8082/topics/testtopic1/partitions"
Response Example
The following response example returns a topic with two partitions.
[
{
"partition":0,
"leader":0,
"replicas":
[{
"broker":0,
"leader":true,
"in_sync":true
}]
},
{
"partition":1,
"leader":0,
"replicas":
[{
"broker":0,
"leader":true,
"in_sync":true
}]
}
]