listStreams method
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 10.
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.
May throw LimitExceededException.
Parameter exclusiveStartStreamName
:
The name of the stream to start the list with.
Parameter limit
:
The maximum number of streams to list.
Implementation
Future<ListStreamsOutput> listStreams({
String? exclusiveStartStreamName,
int? limit,
}) async {
_s.validateStringLength(
'exclusiveStartStreamName',
exclusiveStartStreamName,
1,
128,
);
_s.validateNumRange(
'limit',
limit,
1,
10000,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'Kinesis_20131202.ListStreams'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
if (exclusiveStartStreamName != null)
'ExclusiveStartStreamName': exclusiveStartStreamName,
if (limit != null) 'Limit': limit,
},
);
return ListStreamsOutput.fromJson(jsonResponse.body);
}