获取 topic 详细信息-GetUKafkaTopicInfo

获取指定 topic 的详细信息,包括Topic属性、消息动态、分区情况

Request Parameters

Parameter nameTypeDescriptionRequired
Regionstring地域。 参见 地域和可用区列表Yes
Zonestring可用区。参见 可用区列表Yes
ProjectIdstring项目ID。不填写为默认项目,子帐号必须填写。 请参考GetProjectList接口No
ClusterInstanceIdstringUkafka 集群 IDYes
Topicstring指定的 TopicYes

Response Elements

Parameter nameTypeDescriptionRequired
RetCodeint操作返回码Yes
Actionstring操作名称Yes
Partitionsobjecttopic 分区信息Yes
TopicPropertyobjecttopic 属性Yes
MessageStateobjecttopic 消息动态Yes

TopicProperty

Parameter nameTypeDescriptionRequired
NumOfReplicaint副本数量No
NumOfPartitionint分区数量No
NumOfBrokerintbroker 数量No
NumOfOccupyBrokerint占用 broker 数量No
UnderReplicasPerfloat落后副本占比No
BrokerSpreadPerfloattopic 的 broker 覆盖率No
BrokerSkewedPerfloattopic 的 broker 倾斜率No
PreferredReplicasPerfloat优先副本占有率No
SumOfPartitionOffsetinttopic 的 offset 之和No
SumTopicUsageinttopic 的磁盘使用之和No

MessageState

Parameter nameTypeDescriptionRequired
LastUpdateTimeinttopic上次更新时间(时间戳)No
BytesInPerSecfloattopic 每分钟流入消息速率No
BytesOutPerSecfloattopic 每分钟流出消息速率No
MessagesInPerSecfloattopic 每分钟流入消息条数No

Request Example

https://api.ucloud.cn/?Action=GetUKafkaTopicInfo
&Zone=cn-bj2-02
&ClusterInstanceId=ukafka-asje3q
&Topic=foo
&Region=VjMeLUzs
&ProjectId=AQtYNwBR

Response Example

{
    "RetCode": 0,
    "Action": "GetUKafkaTopicInfoResponse",
    "Partitions": {
        "0": {
            "topic": "foo",
            "partition": 0,
            "leader": 3,
            "replicas": [
                3,
                2,
                1
            ],
            "isr": [
                3,
                2,
                1
            ],
            "usage": 190224
        },
        "1": {
            "topic": "foo",
            "partition": 1,
            "leader": 1,
            "replicas": [
                1,
                3,
                2
            ],
            "isr": [
                1,
                3,
                2
            ],
            "usage": 190672
        },
        "2": {
            "topic": "foo",
            "partition": 2,
            "leader": 2,
            "replicas": [
                2,
                1,
                3
            ],
            "isr": [
                2,
                1,
                3
            ],
            "usage": 190372
        }
    },
    "TopicProperty": {
        "numOfReplica": 3,
        "numOfPartition": 3,
        "numOfBroker": 3,
        "numOfOccupyBroker": 3,
        "underReplicasPer": 0,
        "BrokerSpreadPer": 1,
        "BrokerSkewedPer": 0,
        "PreferredReplicasPer": 1,
        "SumOfPartitionOffset": 1773815,
        "SumTopicUsage": 571268
    },
    "MessageState": {
        "MessagesInPerSec": 1.2239025941412993,
        "BytesInPerSec": 58.74732451878237,
        "BytesOutPerSec": 58.06401734087217,
        "LastUpdateTime": 1537340210000
    }
}