Querying Topics of a Specified Consumer Group
Function
This API is used to query topics of a specified consumer group.
Calling Method
For details, see Calling APIs.
URI
GET /v2/{engine}/{project_id}/instances/{instance_id}/groups/{group}/topics
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
engine |
Yes |
String |
Engine. |
|
project_id |
Yes |
String |
Project ID. For details, see Obtaining a Project ID. |
|
instance_id |
Yes |
String |
Instance ID. |
|
group |
Yes |
String |
Consumer group ID. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
offset |
No |
Integer |
Offset, which is the position where the query starts. The value must be greater than or equal to 0. |
|
limit |
No |
Integer |
Maximum number of topics returned in the current query. The default value is 10. The value ranges from 1 to 50. |
|
sort_key |
No |
String |
Sorting rule:
|
|
sort_dir |
No |
String |
Sort in:
|
|
topic |
No |
String |
Topic name. |
Request Parameters
None
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
topics |
Array of GroupTopicEntity objects |
Consumer group topic. |
|
total |
Integer |
Total. |
Example Requests
GET https://{endpoint}/v2/{engine}/{project_id}/instances/{instance_id}/groups/{group}/topics
Example Responses
Status code: 200
Successful
{
"topics" : [ {
"topic" : "topic-1",
"partitions" : 1,
"lag" : 0
}, {
"topic" : "topic-2",
"partitions" : 2,
"lag" : 10
} ],
"total" : 2
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Successful |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.