Kafka / Client / describe_topic_partitions

describe_topic_partitions

Kafka.Client.describe_topic_partitions(**kwargs)

Returns partition details of this topic on a MSK cluster.

See also: AWS API Documentation

Request Syntax

response = client.describe_topic_partitions(
    ClusterArn='string',
    TopicName='string',
    MaxResults=123,
    NextToken='string'
)
Parameters:
  • ClusterArn (string) –

    [REQUIRED]

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

  • TopicName (string) –

    [REQUIRED]

    The Kafka topic name that uniquely identifies the topic.

  • MaxResults (integer) – The maximum number of results to return in the response. If there are more results, the response includes a NextToken parameter.

  • NextToken (string) – 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.

Return type:

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.

Exceptions

  • Kafka.Client.exceptions.BadRequestException

  • Kafka.Client.exceptions.UnauthorizedException

  • Kafka.Client.exceptions.InternalServerErrorException

  • Kafka.Client.exceptions.ForbiddenException

  • Kafka.Client.exceptions.NotFoundException