Querying the Topic List
Function
This API is used to query the topic list of a RocketMQ instance.
URI
GET /v2/{project_id}/instances/{instance_id}/topics
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. |
instance_id |
Yes |
String |
Instance ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
limit |
No |
Integer |
Number of records to query. |
offset |
No |
Integer |
Offset, which is the position where the query starts. The value must be greater than or equal to 0. |
Request Parameters
None
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
total |
Integer |
Total number of topics. |
max |
Integer |
Maximum number of topics that can be created. |
remaining |
Integer |
Remaining number of topics that can be created. |
next_offset |
Integer |
Offset of the next page. |
previous_offset |
Integer |
Offset of the previous page. |
topics |
Array of Topic objects |
Topic list. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Topic name. |
total_read_queue_num |
Number |
Total number of read queues. |
total_write_queue_num |
Number |
Total number of write queues. |
permission |
String |
Permissions. |
brokers |
Array of brokers objects |
Associated brokers. |
Example Requests
Querying the topic list of a RocketMQ instance
GET https://{endpoint}/v2/{project_id}/instances/{instance_id}/topics?offset=0&limit=10
Example Responses
Status code: 200
Query succeeded.
{ "total" : "3,", "max" : "2000,", "remaining" : "1997,", "next_offset" : "-1,", "previous_offset" : "-1,", "topics" : [ { "name" : "topic-1", "total_read_queue_num" : 3, "total_write_queue_num" : 3, "permission" : "all", "brokers" : [ { "broker_name" : "broker-0", "read_queue_num" : 3, "write_queue_num" : 3 } ] }, { "name" : "topic-2", "total_read_queue_num" : 3, "total_write_queue_num" : 3, "permission" : "all", "brokers" : [ { "broker_name" : "broker-0", "read_queue_num" : 3, "write_queue_num" : 3 } ] }, { "name" : "topic-3", "total_read_queue_num" : 3, "total_write_queue_num" : 3, "permission" : "all", "brokers" : [ { "broker_name" : "broker-0", "read_queue_num" : 3, "write_queue_num" : 3 } ] } ] }
Status Codes
Status Code |
Description |
---|---|
200 |
Query succeeded. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackFor any further questions, feel free to contact us through the chatbot.
Chatbot