Skip to content

list_streams

list_streams(
    *,
    config_overrides: Optional[KeyspacesStreamsClientConfig] = None,
    keyspace_name: Optional[KeyspaceName] = None,
    table_name: Optional[TableName] = None,
    max_results: Optional[int] = None,
    next_token: Optional[StreamArnToken] = None,
) -> ListStreamsOutput

Returns a list of all data capture streams associated with your Amazon Keyspaces account or for a specific keyspace or table. The response includes information such as stream ARNs, table associations, creation timestamps, and current status. This operation helps you discover and manage all active data streams in your Amazon Keyspaces environment.

Parameters:

  • keyspace_name (Optional[KeyspaceName], default: None ) –

    The name of the keyspace for which to list streams. If specified, only streams associated with tables in this keyspace are returned. If omitted, streams from all keyspaces are included in the results.

  • table_name (Optional[TableName], default: None ) –

    The name of the table for which to list streams. Must be used together with keyspaceName. If specified, only streams associated with this specific table are returned.

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

    The maximum number of streams to return in a single ListStreams request. The default value is 100. The minimum value is 1 and the maximum value is 100.

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

    An optional pagination token provided by a previous ListStreams operation. If this parameter is specified, the response includes only records beyond the token, up to the value specified by maxResults.

Raises:

  • AccessDeniedException –

    You don't have sufficient access permissions to perform this operation.

    This exception occurs when your IAM user or role lacks the required permissions to access the Amazon Keyspaces resource or perform the requested action. Check your IAM policies and ensure they grant the necessary permissions.

  • InternalServerException –

    The Amazon Keyspaces service encountered an unexpected error while processing the request.

    This internal server error is not related to your request parameters. Retry your request after a brief delay. If the issue persists, contact Amazon Web Services Support with details of your request to help identify and resolve the problem.

  • ResourceNotFoundException –

    The requested resource doesn't exist or could not be found.

    This exception occurs when you attempt to access a keyspace, table, stream, or other Amazon Keyspaces resource that doesn't exist or that has been deleted. Verify that the resource identifier is correct and that the resource exists in your account.

  • ThrottlingException –

    The request rate is too high and exceeds the service's throughput limits.

    This exception occurs when you send too many requests in a short period of time. Implement exponential backoff in your retry strategy to handle this exception. Reducing your request frequency or distributing requests more evenly can help avoid throughput exceptions.

    This exception can also occur when more than two processes are reading from the same stream shard at the same time. Ensure that only one process reads from a stream shard at the same time.

  • ValidationException –

    The request validation failed because one or more input parameters failed validation.

    This exception occurs when there are syntax errors in the request, field constraints are violated, or required parameters are missing. To help you fix the issue, the exception message provides details about which parameter failed and why.

  • UnknownServiceError –

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

Source code in docs_src/capo_keyspacesstreams/_services/keyspaces_streams.py
def list_streams(
    self,
    *,
    config_overrides: Optional[KeyspacesStreamsClientConfig] = None,
    keyspace_name: Optional[
        "capo_keyspacesstreams.types.keyspace_name.KeyspaceName"
    ] = None,
    table_name: Optional["capo_keyspacesstreams.types.table_name.TableName"] = None,
    max_results: Optional[int] = None,
    next_token: Optional[
        "capo_keyspacesstreams.types.stream_arn_token.StreamArnToken"
    ] = None,
) -> "capo_keyspacesstreams.types.list_streams_output.ListStreamsOutput":
    """<p>Returns a list of all data capture streams associated with your Amazon Keyspaces account or for a specific keyspace or table. The response includes information such as stream ARNs, table associations, creation timestamps, and current status. This operation helps you discover and manage all active data streams in your Amazon Keyspaces environment.</p>

    Args:
        keyspace_name: <p> The name of the keyspace for which to list streams. If specified, only streams associated with tables in this keyspace are returned. If omitted, streams from all keyspaces are included in the results. </p>
        table_name: <p> The name of the table for which to list streams. Must be used together with <code>keyspaceName</code>. If specified, only streams associated with this specific table are returned. </p>
        max_results: <p> The maximum number of streams to return in a single <code>ListStreams</code> request. The default value is 100. The minimum value is 1 and the maximum value is 100. </p>
        next_token: <p> An optional pagination token provided by a previous <code>ListStreams</code> operation. If this parameter is specified, the response includes only records beyond the token, up to the value specified by <code>maxResults</code>. </p>

    Raises:
        capo_keyspacesstreams.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access permissions to perform this operation. </p> <p>This exception occurs when your IAM user or role lacks the required permissions to access the Amazon Keyspaces resource or perform the requested action. Check your IAM policies and ensure they grant the necessary permissions.</p>
        capo_keyspacesstreams.errors.internal_server_exception.InternalServerException: <p>The Amazon Keyspaces service encountered an unexpected error while processing the request. </p> <p>This internal server error is not related to your request parameters. Retry your request after a brief delay. If the issue persists, contact Amazon Web Services Support with details of your request to help identify and resolve the problem.</p>
        capo_keyspacesstreams.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource doesn't exist or could not be found. </p> <p>This exception occurs when you attempt to access a keyspace, table, stream, or other Amazon Keyspaces resource that doesn't exist or that has been deleted. Verify that the resource identifier is correct and that the resource exists in your account.</p>
        capo_keyspacesstreams.errors.throttling_exception.ThrottlingException: <p>The request rate is too high and exceeds the service's throughput limits. </p> <p>This exception occurs when you send too many requests in a short period of time. Implement exponential backoff in your retry strategy to handle this exception. Reducing your request frequency or distributing requests more evenly can help avoid throughput exceptions.</p> <p>This exception can also occur when more than two processes are reading from the same stream shard at the same time. Ensure that only one process reads from a stream shard at the same time. </p>
        capo_keyspacesstreams.errors.validation_exception.ValidationException: <p>The request validation failed because one or more input parameters failed validation. </p> <p>This exception occurs when there are syntax errors in the request, field constraints are violated, or required parameters are missing. To help you fix the issue, the exception message provides details about which parameter failed and why.</p>
        capo_keyspacesstreams.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_keyspacesstreams.types.list_streams_input.ListStreamsInput]",
    ) -> OperationResponse[
        "capo_keyspacesstreams.types.list_streams_output.ListStreamsOutput"
    ]:
        import capo_keyspacesstreams._operations.keyspaces_streams.list_streams

        output, http_response = (
            capo_keyspacesstreams._operations.keyspaces_streams.list_streams.list_streams(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListStreams")
    )
    input_: capo_keyspacesstreams.types.list_streams_input.ListStreamsInput = {}
    if keyspace_name is not None:
        input_["keyspace_name"] = keyspace_name
    if table_name is not None:
        input_["table_name"] = table_name
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output