查询Topic列表
功能介绍
查询Topic列表。
URI
GET /v2/{project_id}/mqs/instances/{instance_id}/topics
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
project_id |
是 |
String |
租户的项目ID。 |
|
instance_id |
是 |
String |
实例ID。 |
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
app_name |
否 |
String |
应用名称。 |
|
name |
否 |
String |
Topic名称。 |
|
access_policy |
否 |
String |
权限类型。
|
|
limit |
否 |
String |
分页查询大小。默认查询所有的topic。 |
|
offset |
否 |
String |
分页查询的偏移量。默认值是0。 |
请求参数
无
响应参数
状态码: 200
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
total |
Integer |
topic的总数。 |
|
size |
Integer |
当前查询的topic数量。 |
|
permissions |
Array of strings |
允许操作的权限。 |
|
topics |
Array<Object> |
Topic列表。 |
|
policies |
Array<Object> |
权限列表。 |
|
remain_partitions |
Integer |
剩余分区数。 |
|
max_partitions |
Integer |
分区总数。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
policiesOnly |
Boolean |
是否只更新策略。 |
|
name |
String |
topic名称。 |
|
replication |
Integer |
副本数,配置数据的可靠性。 |
|
partition |
Integer |
topic分区数,设置消费的并发数。 |
|
retention_time |
Integer |
消息老化时间。 |
|
sync_message_flush |
Boolean |
是否使用同步落盘。默认值为false。同步落盘会导致性能降低。 |
|
sync_replication |
Boolean |
是否开启同步复制,开启后,客户端生产消息时相应的也要设置acks=-1,否则不生效,默认关闭。 |
|
app_id |
String |
应用ID。 |
|
app_name |
String |
应用名称。 |
|
permissions |
Array of strings |
允许操作的权限。 |
|
external_configs |
Object |
其他配置。 |
|
description |
String |
描述。 |
|
sensitive_word |
String |
敏感字段。 |
|
topic_type |
Integer |
topic类型。 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
owner |
Boolean |
是否为创建topic时所选择的应用。 |
|
user_name |
String |
集成应用key。 |
|
app_name |
String |
应用名称。 |
|
access_policy |
String |
权限类型。
|
|
tag |
String |
权限类型对应的标签。 当权限类型是all时,发布和订阅的标签用符号“&”隔开。 当有多个标签时,标签用符号“||”隔开。 |
请求示例
GET https://{endpoint}/v2/{project_id}/mqs/instances/{instance_id}/topics
响应示例
状态码: 200
OK
{
"total" : 91,
"size" : 1,
"permissions" : [ "modify" ],
"topics" : [ {
"policiesOnly" : false,
"name" : "topic-test",
"replication" : 3,
"partition" : 3,
"retention_time" : 72,
"sync_replication" : false,
"sync_message_flush" : false,
"app_id" : "ba1408c8-xxxx-xxxx-xxxx-21a218f4xxxx",
"app_name" : "app-test",
"permissions" : [ "read", "access", "delete", "modify" ],
"external_configs" : { },
"description" : "",
"sensitive_word" : "",
"topic_type" : 0
} ],
"policies" : {
"owner" : false,
"user_name" : "user-test",
"app_name" : "app-test",
"access_policy" : "pub",
"tag" : "pub_tag"
},
"remain_partitions" : 37,
"max_partitions" : 300
}
状态码
|
状态码 |
描述 |
|---|---|
|
200 |
OK |
|
400 |
Bad Request |
|
403 |
Forbidden |
错误码
请参见错误码。