Managed Streaming for Kafka

2025/11/18 - Managed Streaming for Kafka - 3 new api methods

Changes  Amazon MSK adds three new APIs, ListTopics, DescribeTopic, and DescribeTopicPartitions for viewing Kafka topics in your MSK clusters.

DescribeTopicPartitions (new) Link ¶

Returns partition details of this topic on a MSK cluster.

See also: AWS API Documentation

Request Syntax

client.describe_topic_partitions(
    ClusterArn='string',
    TopicName='string',
    MaxResults=123,
    NextToken='string'
)
type ClusterArn:

string

param ClusterArn:

[REQUIRED]

The Amazon Resource Name (ARN) that uniquely identifies the cluster.

type TopicName:

string

param TopicName:

[REQUIRED]

The Kafka topic name that uniquely identifies the topic.

type MaxResults:

integer

param MaxResults:

The maximum number of results to return in the response. If there are more results, the response includes a NextToken parameter.

type NextToken:

string

param NextToken:

The paginated results marker. When the result of the operation is truncated, the call returns NextToken in the response. To get the next batch, provide this token in your next request.

rtype:

dict

returns:

Response Syntax

{
    'Partitions': [
        {
            'Partition': 123,
            'Leader': 123,
            'Replicas': [
                123,
            ],
            'Isr': [
                123,
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    200 response

    • Partitions (list) --

      The list of partition information for the topic.

      • (dict) --

        Contains information about a topic partition.

        • Partition (integer) --

          The partition ID.

        • Leader (integer) --

          The leader broker ID for the partition.

        • Replicas (list) --

          The list of replica broker IDs for the partition.

          • (integer) --

        • Isr (list) --

          The list of in-sync replica broker IDs for the partition.

          • (integer) --

    • NextToken (string) --

      The paginated results marker. When the result of a DescribeTopicPartitions operation is truncated, the call returns NextToken in the response. To get another batch of configurations, provide this token in your next request.

DescribeTopic (new) Link ¶

Returns topic details of this topic on a MSK cluster.

See also: AWS API Documentation

Request Syntax

client.describe_topic(
    ClusterArn='string',
    TopicName='string'
)
type ClusterArn:

string

param ClusterArn:

[REQUIRED]

The Amazon Resource Name (ARN) that uniquely identifies the cluster.

type TopicName:

string

param TopicName:

[REQUIRED]

The Kafka topic name that uniquely identifies the topic.

rtype:

dict

returns:

Response Syntax

{
    'TopicArn': 'string',
    'TopicName': 'string',
    'ReplicationFactor': 123,
    'PartitionCount': 123,
    'Configs': 'string',
    'Status': 'CREATING'|'UPDATING'|'DELETING'|'ACTIVE'
}

Response Structure

  • (dict) --

    200 response

    • TopicArn (string) --

      The Amazon Resource Name (ARN) of the topic.

    • TopicName (string) --

      The Kafka topic name of the topic.

    • ReplicationFactor (integer) --

      The replication factor of the topic.

    • PartitionCount (integer) --

      The partition count of the topic.

    • Configs (string) --

      Topic configurations encoded as a Base64 string.

    • Status (string) --

      The status of the topic.

ListTopics (new) Link ¶

List topics in a MSK cluster.

See also: AWS API Documentation

Request Syntax

client.list_topics(
    ClusterArn='string',
    MaxResults=123,
    NextToken='string',
    TopicNameFilter='string'
)
type ClusterArn:

string

param ClusterArn:

[REQUIRED]

The Amazon Resource Name (ARN) that uniquely identifies the cluster.

type MaxResults:

integer

param MaxResults:

The maximum number of results to return in the response. If there are more results, the response includes a NextToken parameter.

type NextToken:

string

param NextToken:

The paginated results marker. When the result of the operation is truncated, the call returns NextToken in the response. To get the next batch, provide this token in your next request.

type TopicNameFilter:

string

param TopicNameFilter:

Returns topics starting with given name.

rtype:

dict

returns:

Response Syntax

{
    'Topics': [
        {
            'TopicArn': 'string',
            'TopicName': 'string',
            'ReplicationFactor': 123,
            'PartitionCount': 123,
            'OutOfSyncReplicaCount': 123
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    200 response

    • Topics (list) --

      List containing topics info.

      • (dict) --

        Includes identification info about the topic.

        • TopicArn (string) --

          The Amazon Resource Name (ARN) of the topic.

        • TopicName (string) --

          Name for a topic.

        • ReplicationFactor (integer) --

          Replication factor for a topic.

        • PartitionCount (integer) --

          Partition count for a topic.

        • OutOfSyncReplicaCount (integer) --

          Number of out-of-sync replicas for a topic.

    • NextToken (string) --

      The paginated results marker. When the result of a ListTopics operation is truncated, the call returns NextToken in the response. To get another batch of configurations, provide this token in your next request.