Lists your Kinesis data streams.
The number of streams may be too large to return from a single call to ListStreams. You can limit the number of returned streams using the Limit parameter. If you do not specify a value for the Limit parameter, Kinesis Data Streams uses the default limit, which is currently 100.
You can detect if there are more streams available to list by using the HasMoreStreams flag from the returned output. If there are more streams available, you can request more streams by using the name of the last stream returned by the ListStreams request in the ExclusiveStartStreamName parameter in a subsequent request to ListStreams. The group of stream names returned by the subsequent request is then added to the list. You can continue this process until all the stream names have been collected in the list.
ListStreams has a limit of five transactions per second per account.
Parameters:
-
limit
(Optional[ListStreamsInputLimit], default:
None
)
–
The maximum number of streams to list. The default value is 100. If you specify a value greater than 100, at most 100 results are returned.
-
exclusive_start_stream_name
(Optional[StreamName], default:
None
)
–
The name of the stream to start the list with.
-
next_token
(Optional[NextToken], default:
None
)
–
Raises:
-
ExpiredNextTokenException
–
The pagination token passed to the operation is expired.
-
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.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_kinesis/_services/kinesis.py
| def list_streams(
self,
*,
config_overrides: Optional[KinesisClientConfig] = None,
limit: Optional[
"capo_kinesis.types.list_streams_input_limit.ListStreamsInputLimit"
] = None,
exclusive_start_stream_name: Optional[
"capo_kinesis.types.stream_name.StreamName"
] = None,
next_token: Optional["capo_kinesis.types.next_token.NextToken"] = None,
) -> "capo_kinesis.types.list_streams_output.ListStreamsOutput":
"""<p>Lists your Kinesis data streams.</p> <p>The number of streams may be too large to return from a single call to <code>ListStreams</code>. You can limit the number of returned streams using the <code>Limit</code> parameter. If you do not specify a value for the <code>Limit</code> parameter, Kinesis Data Streams uses the default limit, which is currently 100.</p> <p>You can detect if there are more streams available to list by using the <code>HasMoreStreams</code> flag from the returned output. If there are more streams available, you can request more streams by using the name of the last stream returned by the <code>ListStreams</code> request in the <code>ExclusiveStartStreamName</code> parameter in a subsequent request to <code>ListStreams</code>. The group of stream names returned by the subsequent request is then added to the list. You can continue this process until all the stream names have been collected in the list. </p> <p> <a>ListStreams</a> has a limit of five transactions per second per account.</p>
Args:
limit: <p>The maximum number of streams to list. The default value is 100. If you specify a value greater than 100, at most 100 results are returned.</p>
exclusive_start_stream_name: <p>The name of the stream to start the list with.</p>
next_token: <p></p>
Raises:
capo_kinesis.errors.expired_next_token_exception.ExpiredNextTokenException: <p>The pagination token passed to the operation is expired.</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.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_kinesis.types.list_streams_input.ListStreamsInput]",
) -> OperationResponse[
"capo_kinesis.types.list_streams_output.ListStreamsOutput"
]:
import capo_kinesis._operations.kinesis_20131202.list_streams
output, http_response = (
capo_kinesis._operations.kinesis_20131202.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_kinesis.types.list_streams_input.ListStreamsInput = {}
if limit is not None:
input_["limit"] = limit
if exclusive_start_stream_name is not None:
input_["exclusive_start_stream_name"] = exclusive_start_stream_name
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
|