1. 接口描述
接口请求域名:
ckafka.api.qcloud.com
本接口(GetTopicAttributes)用于在用户获取消息队列 CKafka 实例的主题属性。2. 输入参数
参数名称 | 必选 | 类型 | 描述 |
instanceId | 是 | String | 实例 ID |
topicName | 是 | String | 主题名称 |
3. 输出参数
参数名称 | 类型 | 描述 |
topicId | String | 主题 ID |
partitionNum | Int | 分区个数 |
enableWhiteList | Int | IP 白名单开关,1:打开; 0:关闭 |
note | String | 主题备注 |
ipWhiteList | array | IP 白名单列表 |
createTime | Int | 创建时间,时间戳,单位:秒 |
partitions | Array | 分区详情 |
partitions::partition | Int | Partition ID |
partitions::leaderStatus | Int | Leader 运行状态 |
partitions::replicaNum | array | 副本个数 |
partitions::isrNum | array | ISR 个数 |
config | array | topic 配置数组 |
config::min.insync.replicas | Int | - |
config::unclean.leader.election.enable | bool | - |
config::retention.ms | Int | 消息保留时间 |
config::segment.ms | Int | Segment 分片滚动的时长 |
config::cleanup.policy | String | 日志清理模式,默认 delete。 delete:日志按保存时间删除;compact:日志按 key 压缩;compact, delete:日志按 key 压缩且会保存时间删除。 |
4. 示例
输入:
https://domain/v2/index.php?Action=GetTopicAttributes&instanceId=ckafka-xxooa0&topicName=topic-xxxxxx&<公共请求参数>
输出:
{"code": 0,"message": "","codeDesc": "Success","data": {"topicId": "topic-4dyo4uuw","createTime": 1533006993,"note": "","partitionNum": 1,"enableWhiteList": 0,"ipWhiteList": [],"config": {"min.insync.replicas": 1,"unclean.leader.election.enable": "false","retention.ms": 60000,"segment.ms": 3600000,"cleanup.policy": "delete"},"partitions": [{"partition": 0,"leaderStatus": 0,"isrNum": 1,"replicaNum": 1}]}}