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. For details, see Obtaining a Project ID. |
|
instance_id |
Yes |
String |
Instance ID. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
limit |
No |
Integer |
Number of records to query. The value ranges from 1 to 50. |
|
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. |
|
message_type |
String |
Message type (available only for RocketMQ 5.x instances). |
Example Requests
Querying a list of 10 topics of a specified RocketMQ instance from offset=0
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
} ],
"message_type" : "NORMAL"
}, {
"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
} ],
"message_type" : "NORMAL"
}, {
"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
} ],
"message_type" : "NORMAL"
} ]
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Query succeeded. |
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.