Querying Topic Details

This API is out-of-date and may not be maintained in the future. Please use the API described in Querying Topic Details.

URI

GET /v1.0/{project_id}/instances/{instance_id}/manage/topics/{topic}

The following table describes the parameters.

Table 1 Parameters

Parameter

Type

Mandatory

Description

project_id

String

Yes

Project ID.

instance_id

String

Yes

Instance ID.

topic

String

Yes

Topic name.

Request

Request parameters

None.

Example request

None.

Response

Response parameters

Table 2 describes the response parameters.

Table 2 Response parameters

Parameter

Type

Description

topic

String

Topic name.

partitions

Array of object partitions

Partition list. For details, see Table 3.

group_subscribed

Array of String

List of consumer groups that subscribe to the topic.

Table 3 partitions parameters

Parameter

Type

Description

partition

Integer

Partition ID.

leader

Integer

ID of the broker where the leader replica resides.

leo

long

LEO of the partition leader replica.

hw

long

High watermark (HW) of the partition.

lso

long

Log start offset (LSO) of the partition leader replica.

last_update_timestamp

long

Time when the last message was written to the partition.

replicas

Array of object replicas

Replica list. For details, see Table 4.

Table 4 replicas parameters

Parameter

Type

Description

broker

Integer

ID of the broker where the replica resides.

leader

Boolean

Whether the replica is the leader.

in_sync

Boolean

Whether the replica is in the ISR.

size

Long

Current log size of the replica.

lag

Long

Number of messages that lag behind the high watermark in the replica.

Example response

{
    "topic": "test",
    "partitions": [
        {
            "partition": 0,
            "leader": 2,
            "replicas": [
                {
                    "broker": 2,
                    "leader": true,
                    "in_sync": true,
                    "size": 123971146,
                    "lag": 0
                },
                {
                    "broker": 1,
                    "leader": false,
                    "in_sync": true,
                    "size": 123971146,
                    "lag": 0
                },
                {
                    "broker": 0,
                    "leader": false,
                    "in_sync": true,
                    "size": 123971146,
                    "lag": 0
                }
            ],
            "lso": 0,
            "leo": 13598,
            "hw": 13598,
            "last_update_timestamp": 1571477180985
        },
        {
            "partition": 2,
            "leader": 1,
            "replicas": [
                {
                    "broker": 1,
                    "leader": true,
                    "in_sync": true,
                    "size": 123889531,
                    "lag": 0
                },
                {
                    "broker": 0,
                    "leader": false,
                    "in_sync": true,
                    "size": 123889531,
                    "lag": 0
                },
                {
                    "broker": 2,
                    "leader": false,
                    "in_sync": true,
                    "size": 123889531,
                    "lag": 0
                }
            ],
            "lso": 0,
            "leo": 13601,
            "hw": 13601,
            "last_update_timestamp": 1571477077146
        },
        {
            "partition": 1,
            "leader": 0,
            "replicas": [
                {
                    "broker": 0,
                    "leader": true,
                    "in_sync": true,
                    "size": 127245604,
                    "lag": 0
                },
                {
                    "broker": 2,
                    "leader": false,
                    "in_sync": true,
                    "size": 127245604,
                    "lag": 0
                },
                {
                    "broker": 1,
                    "leader": false,
                    "in_sync": true,
                    "size": 127245604,
                    "lag": 0
                }
            ],
            "lso": 0,
            "leo": 13599,
            "hw": 13599,
            "last_update_timestamp": 1571477172959
        }
    ],
    "group_subscribed": [
        "test-consumer-group"
    ]
}

Status Code

Table 5 describes the status code of successful operations. For details about other status codes, see Table 1.

Table 5 Status code

Status Code

Description

200

Topic details queried successfully.