Skip to content

describe_topic_partitions async

describe_topic_partitions(
    cluster_arn: __string,
    topic_name: __string,
    *,
    config_overrides: Optional[AsyncKafkaClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[__string] = None,
) -> DescribeTopicPartitionsResponse

Returns partition details of this topic on a MSK cluster.

Parameters:

  • cluster_arn (__string) –

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

  • topic_name (__string) –

    The Kafka topic name that uniquely identifies the topic.

  • max_results (Optional[MaxResults], default: None ) –

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

  • next_token (Optional[__string], default: None ) –

    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.

Raises:

Source code in docs_src/capo_kafka/_services/async_kafka.py
async def describe_topic_partitions(
    self,
    cluster_arn: "capo_kafka.types.__string.__string",
    topic_name: "capo_kafka.types.__string.__string",
    *,
    config_overrides: Optional[AsyncKafkaClientConfig] = None,
    max_results: Optional["capo_kafka.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_kafka.types.__string.__string"] = None,
) -> "capo_kafka.types.describe_topic_partitions_response.DescribeTopicPartitionsResponse":
    """<p>Returns partition details of this topic on a MSK cluster.</p>

    Args:
        cluster_arn: <p>The Amazon Resource Name (ARN) that uniquely identifies the cluster.</p>
        topic_name: <p>The Kafka topic name that uniquely identifies the topic.</p>
        max_results: <p>The maximum number of results to return in the response. If there are more results, the response includes a NextToken parameter.</p>
        next_token: <p>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.</p>

    Raises:
        capo_kafka.errors.bad_request_exception.BadRequestException: <p>Returns information about an error.</p>
        capo_kafka.errors.forbidden_exception.ForbiddenException: <p>Returns information about an error.</p>
        capo_kafka.errors.internal_server_error_exception.InternalServerErrorException: <p>Returns information about an error.</p>
        capo_kafka.errors.not_found_exception.NotFoundException: <p>Returns information about an error.</p>
        capo_kafka.errors.unauthorized_exception.UnauthorizedException: <p>Returns information about an error.</p>
        capo_kafka.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_kafka.types.describe_topic_partitions_request.DescribeTopicPartitionsRequest]",
    ) -> AsyncOperationResponse[
        "capo_kafka.types.describe_topic_partitions_response.DescribeTopicPartitionsResponse"
    ]:
        import capo_kafka._operations.kafka.describe_topic_partitions

        (
            output,
            http_response,
        ) = await capo_kafka._operations.kafka.describe_topic_partitions.async_describe_topic_partitions(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeTopicPartitions")
    )
    input_: capo_kafka.types.describe_topic_partitions_request.DescribeTopicPartitionsRequest = {
        "cluster_arn": cluster_arn,
        "topic_name": topic_name,
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output