Skip to content

iter_describe_topic_partitions

iter_describe_topic_partitions(
    cluster_arn: __string,
    topic_name: __string,
    *,
    config_overrides: Optional[KafkaClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[__string] = None,
) -> Iterator[TopicPartitionInfo]
Source code in docs_src/capo_kafka/_services/kafka.py
def iter_describe_topic_partitions(
    self,
    cluster_arn: "capo_kafka.types.__string.__string",
    topic_name: "capo_kafka.types.__string.__string",
    *,
    config_overrides: Optional[KafkaClientConfig] = None,
    max_results: Optional["capo_kafka.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_kafka.types.__string.__string"] = None,
) -> "Iterator[capo_kafka.types.topic_partition_info.TopicPartitionInfo]":
    _token = next_token
    while True:
        _response = self.describe_topic_partitions(
            cluster_arn,
            topic_name,
            config_overrides=config_overrides,
            max_results=max_results,
            next_token=_token,
        )
        _page = _resolve_path(_response, ("partitions",))
        for _item in _page or []:
            yield _item
        _token = _resolve_path(_response, ("next_token",))
        if not _token:
            break