Skip to content

describe_stream async

describe_stream(
    *,
    config_overrides: Optional[AsyncKinesisClientConfig] = None,
    stream_name: Optional[StreamName] = None,
    limit: Optional[DescribeStreamInputLimit] = None,
    exclusive_start_shard_id: Optional[ShardId] = None,
    stream_arn: Optional[StreamARN] = None,
    stream_id: Optional[StreamId] = None,
) -> DescribeStreamOutput

Describes the specified Kinesis data stream.

This API has been revised. It's highly recommended that you use the DescribeStreamSummary API to get a summarized description of the specified Kinesis data stream and the ListShards API to list the shards in a specified data stream and obtain information about each shard.

When invoking this API, you must use either the StreamARN or the StreamName parameter, or both. It is recommended that you use the StreamARN input parameter when you invoke this API.

The information returned includes the stream name, Amazon Resource Name (ARN), creation time, enhanced metric configuration, and shard map. The shard map is an array of shard objects. For each shard object, there is the hash key and sequence number ranges that the shard spans, and the IDs of any earlier shards that played in a role in creating the shard. Every record ingested in the stream is identified by a sequence number, which is assigned when the record is put into the stream.

You can limit the number of shards returned by each call. For more information, see Retrieving Shards from a Stream in the Amazon Kinesis Data Streams Developer Guide.

There are no guarantees about the chronological order shards returned. To process shards in chronological order, use the ID of the parent shard to track the lineage to the oldest shard.

This operation has a limit of 10 transactions per second per account.

Parameters:

  • stream_name (Optional[StreamName], default: None ) –

    The name of the stream to describe.

  • limit (Optional[DescribeStreamInputLimit], default: None ) –

    The maximum number of shards to return in a single call. The default value is 100. If you specify a value greater than 100, at most 100 results are returned.

  • exclusive_start_shard_id (Optional[ShardId], default: None ) –

    The shard ID of the shard to start with.

    Specify this parameter to indicate that you want to describe the stream starting with the shard whose ID immediately follows ExclusiveStartShardId.

    If you don't specify this parameter, the default behavior for DescribeStream is to describe the stream starting with the first shard in the stream.

  • stream_arn (Optional[StreamARN], default: None ) –

    The ARN of the stream.

  • stream_id (Optional[StreamId], default: None ) –

    Not Implemented. Reserved for future use.

Raises:

  • AccessDeniedException –

    Specifies that you do not have the permissions required to perform this operation.

  • InvalidArgumentException –

    A specified parameter exceeds its restrictions, is not supported, or can't be used. For more information, see the returned message.

  • LimitExceededException –

    The requested resource exceeds the maximum number allowed, or the number of concurrent stream requests exceeds the maximum number allowed.

  • ResourceNotFoundException –

    The requested resource could not be found. The stream might not be specified correctly.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_kinesis/_services/async_kinesis.py
async def describe_stream(
    self,
    *,
    config_overrides: Optional[AsyncKinesisClientConfig] = None,
    stream_name: Optional["capo_kinesis.types.stream_name.StreamName"] = None,
    limit: Optional[
        "capo_kinesis.types.describe_stream_input_limit.DescribeStreamInputLimit"
    ] = None,
    exclusive_start_shard_id: Optional[
        "capo_kinesis.types.shard_id.ShardId"
    ] = None,
    stream_arn: Optional["capo_kinesis.types.stream_arn.StreamARN"] = None,
    stream_id: Optional["capo_kinesis.types.stream_id.StreamId"] = None,
) -> "capo_kinesis.types.describe_stream_output.DescribeStreamOutput":
    """<p>Describes the specified Kinesis data stream.</p> <note> <p>This API has been revised. It's highly recommended that you use the <a>DescribeStreamSummary</a> API to get a summarized description of the specified Kinesis data stream and the <a>ListShards</a> API to list the shards in a specified data stream and obtain information about each shard. </p> </note> <note> <p>When invoking this API, you must use either the <code>StreamARN</code> or the <code>StreamName</code> parameter, or both. It is recommended that you use the <code>StreamARN</code> input parameter when you invoke this API.</p> </note> <p>The information returned includes the stream name, Amazon Resource Name (ARN), creation time, enhanced metric configuration, and shard map. The shard map is an array of shard objects. For each shard object, there is the hash key and sequence number ranges that the shard spans, and the IDs of any earlier shards that played in a role in creating the shard. Every record ingested in the stream is identified by a sequence number, which is assigned when the record is put into the stream.</p> <p>You can limit the number of shards returned by each call. For more information, see <a href="https://docs.aws.amazon.com/kinesis/latest/dev/kinesis-using-sdk-java-retrieve-shards.html">Retrieving Shards from a Stream</a> in the <i>Amazon Kinesis Data Streams Developer Guide</i>.</p> <p>There are no guarantees about the chronological order shards returned. To process shards in chronological order, use the ID of the parent shard to track the lineage to the oldest shard.</p> <p>This operation has a limit of 10 transactions per second per account.</p>

    Args:
        stream_name: <p>The name of the stream to describe.</p>
        limit: <p>The maximum number of shards to return in a single call. The default value is 100. If you specify a value greater than 100, at most 100 results are returned.</p>
        exclusive_start_shard_id: <p>The shard ID of the shard to start with.</p> <p>Specify this parameter to indicate that you want to describe the stream starting with the shard whose ID immediately follows <code>ExclusiveStartShardId</code>.</p> <p>If you don't specify this parameter, the default behavior for <code>DescribeStream</code> is to describe the stream starting with the first shard in the stream.</p>
        stream_arn: <p>The ARN of the stream.</p>
        stream_id: <p>Not Implemented. Reserved for future use.</p>

    Raises:
        capo_kinesis.errors.access_denied_exception.AccessDeniedException: <p>Specifies that you do not have the permissions required to perform this operation.</p>
        capo_kinesis.errors.invalid_argument_exception.InvalidArgumentException: <p>A specified parameter exceeds its restrictions, is not supported, or can't be used. For more information, see the returned message.</p>
        capo_kinesis.errors.limit_exceeded_exception.LimitExceededException: <p>The requested resource exceeds the maximum number allowed, or the number of concurrent stream requests exceeds the maximum number allowed. </p>
        capo_kinesis.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource could not be found. The stream might not be specified correctly.</p>
        capo_kinesis.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_kinesis.types.describe_stream_input.DescribeStreamInput]",
    ) -> AsyncOperationResponse[
        "capo_kinesis.types.describe_stream_output.DescribeStreamOutput"
    ]:
        import capo_kinesis._operations.kinesis_20131202.describe_stream

        (
            output,
            http_response,
        ) = await capo_kinesis._operations.kinesis_20131202.describe_stream.async_describe_stream(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeStream")
    )
    input_: capo_kinesis.types.describe_stream_input.DescribeStreamInput = {}
    if stream_name is not None:
        input_["stream_name"] = stream_name
    if limit is not None:
        input_["limit"] = limit
    if exclusive_start_shard_id is not None:
        input_["exclusive_start_shard_id"] = exclusive_start_shard_id
    if stream_arn is not None:
        input_["stream_arn"] = stream_arn
    if stream_id is not None:
        input_["stream_id"] = stream_id

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