Querying the Consumer Group List or Details
Function
This API is used to query the consumer group list or details.
URI
GET /v2/{project_id}/instances/{instance_id}/groups/{group}/topics
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition Project ID. For details about how to obtain it, see Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A |
|
instance_id |
Yes |
String |
Definition Instance ID. You can call the API for querying all instances to obtain the instance ID. The instance ID is in the response body. Constraints N/A Range N/A Default Value N/A |
|
group |
Yes |
String |
Definition Consumer group name. Constraints N/A Range N/A Default value N/A |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
topic |
No |
String |
Definition Topic to be queried. If this parameter is not specified, the entire topic list is queried. If this parameter is specified, details of the topic are queried. Constraints N/A Range N/A Default value N/A |
|
limit |
No |
Integer |
Definition Maximum number of topics that can be returned in a query. Constraints N/A Range 1–50 Default value 10 |
|
offset |
No |
Integer |
Definition Offset where the query starts. Constraints N/A Range ≥ 0 Default value 0 |
Request Parameters
None
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
topics |
Array of strings |
Definition Topic list. This parameter is displayed only when you query the topic consumption list. |
|
total |
Integer |
Definition Total number of topics. This parameter is displayed only when you query the topic consumption list. Range N/A |
|
lag |
Long |
Definition Total number of accumulated messages. Range N/A |
|
max_offset |
Long |
Definition Total number of messages. Range N/A |
|
consumer_offset |
Long |
Definition Number of consumed messages. Range N/A |
|
brokers |
Array of Brokers objects |
Definition Associated brokers of topics. This parameter is displayed only when you query the topic consumption details. |
|
Parameter |
Type |
Description |
|---|---|---|
|
broker_name |
String |
Definition Names of the associated brokers. Range N/A |
|
queues |
Array of Queue objects |
Definition Queue details of the associated brokers. |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
Integer |
Definition Queue ID. Range N/A |
|
lag |
Long |
Definition Total number of accumulated messages in the queue. Range N/A |
|
broker_offset |
Long |
Definition Total number of messages in the queue. Range N/A |
|
consumer_offset |
Long |
Definition Number of consumed messages. Range N/A |
|
last_message_time |
Long |
Definition Time (UNIX, in millisecond) when the latest consumed message was stored. Range N/A |
Example Requests
None
Example Responses
Status code: 200
Consumer group list or details queried successfully.
-
Successful
{ "topics" : [ "topic-test" ], "total" : 1 } -
Consumer group details are queried successfully.
{ "lag" : 0, "max_offset" : 1, "consumer_offset" : 1, "brokers" : [ { "broker_name" : "broker-0", "queues" : [ { "id" : 0, "lag" : 0, "broker_offset" : 0, "consumer_offset" : 0, "last_message_time" : 0 }, { "id" : 1, "lag" : 0, "broker_offset" : 1, "consumer_offset" : 1, "last_message_time" : 1679398537088 }, { "id" : 0, "lag" : 0, "broker_offset" : 0, "consumer_offset" : 0, "last_message_time" : 0 } ] } ] }
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Consumer group list or details queried successfully. |
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.