Skip to content

describe_stream async

describe_stream(
    stream_arn: StreamArn,
    *,
    config_overrides: Optional[AsyncDynamoDBStreamsClientConfig] = None,
    limit: Optional[PositiveIntegerObject] = None,
    exclusive_start_shard_id: Optional[ShardId] = None,
    shard_filter: Optional[ShardFilter] = None,
) -> DescribeStreamOutput

Returns information about a stream, including the current status of the stream, its Amazon Resource Name (ARN), the composition of its shards, and its corresponding DynamoDB table.

You can call DescribeStream at a maximum rate of 10 times per second.

Each shard in the stream has a SequenceNumberRange associated with it. If the SequenceNumberRange has a StartingSequenceNumber but no EndingSequenceNumber, then the shard is still open (able to receive more stream records). If both StartingSequenceNumber and EndingSequenceNumber are present, then that shard is closed and can no longer receive more data.

Parameters:

  • stream_arn (StreamArn) –

    The Amazon Resource Name (ARN) for the stream.

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

    The maximum number of shard objects to return. The upper limit is 100.

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

    The shard ID of the first item that this operation will evaluate. Use the value that was returned for LastEvaluatedShardId in the previous operation.

  • shard_filter (Optional[ShardFilter], default: None ) –

    This optional field contains the filter definition for the DescribeStream API.

Raises:

  • InternalServerError –

    An error occurred on the server side.

  • ResourceNotFoundException –

    The operation tried to access a nonexistent table or index. The resource might not be specified correctly, or its status might not be ACTIVE.

  • UnknownServiceError –

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

Source code in docs_src/capo_dynamodb_streams/_services/async_dynamo_db_streams.py
async def describe_stream(
    self,
    stream_arn: "capo_dynamodb_streams.types.stream_arn.StreamArn",
    *,
    config_overrides: Optional[AsyncDynamoDBStreamsClientConfig] = None,
    limit: Optional[
        "capo_dynamodb_streams.types.positive_integer_object.PositiveIntegerObject"
    ] = None,
    exclusive_start_shard_id: Optional[
        "capo_dynamodb_streams.types.shard_id.ShardId"
    ] = None,
    shard_filter: Optional[
        "capo_dynamodb_streams.types.shard_filter.ShardFilter"
    ] = None,
) -> "capo_dynamodb_streams.types.describe_stream_output.DescribeStreamOutput":
    """<p>Returns information about a stream, including the current status of the stream, its Amazon Resource Name (ARN), the composition of its shards, and its corresponding DynamoDB table.</p> <note> <p>You can call <code>DescribeStream</code> at a maximum rate of 10 times per second.</p> </note> <p>Each shard in the stream has a <code>SequenceNumberRange</code> associated with it. If the <code>SequenceNumberRange</code> has a <code>StartingSequenceNumber</code> but no <code>EndingSequenceNumber</code>, then the shard is still open (able to receive more stream records). If both <code>StartingSequenceNumber</code> and <code>EndingSequenceNumber</code> are present, then that shard is closed and can no longer receive more data.</p>

    Args:
        stream_arn: <p>The Amazon Resource Name (ARN) for the stream.</p>
        limit: <p>The maximum number of shard objects to return. The upper limit is 100.</p>
        exclusive_start_shard_id: <p>The shard ID of the first item that this operation will evaluate. Use the value that was returned for <code>LastEvaluatedShardId</code> in the previous operation. </p>
        shard_filter: <p>This optional field contains the filter definition for the <code>DescribeStream</code> API.</p>

    Raises:
        capo_dynamodb_streams.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</p>
        capo_dynamodb_streams.errors.resource_not_found_exception.ResourceNotFoundException: <p>The operation tried to access a nonexistent table or index. The resource might not be specified correctly, or its status might not be <code>ACTIVE</code>.</p>
        capo_dynamodb_streams.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        (
            output,
            http_response,
        ) = await capo_dynamodb_streams._operations.dynamo_db_streams_20120810.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_dynamodb_streams.types.describe_stream_input.DescribeStreamInput = {
        "stream_arn": stream_arn
    }
    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 shard_filter is not None:
        input_["shard_filter"] = shard_filter

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