Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/k6/next/javascript-api/jslib/aws/kinesisclient/liststreams.md, or by sending Accept: text/markdown to https://grafana.com/docs/k6/next/javascript-api/jslib/aws/kinesisclient/liststreams/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
This is documentation for the next version of Grafana k6 documentation. For the latest stable release, go to the latest version.
listStreams
KinesisClient.listStreams([options]) lists the Kinesis streams in the current region.
Parameters
| Parameter | Type | Description |
|---|---|---|
| options | object (optional) | Configuration for the listing operation. |
Options
| Parameter | Type | Description |
|---|---|---|
| exclusiveStartStreamName | string | The name of the stream to start listing from (exclusive). |
| limit | number | The maximum number of streams to return. |
Returns
| Type | Description |
|---|---|
Promise<Object> | A Promise that fulfills with the list of streams. |
Returns object
| Property | Type | Description |
|---|---|---|
| streamNames | Array | An array of stream names. |
| hasMoreStreams | boolean | Indicates if there are more streams to list. |
Example
import {
AWSConfig,
KinesisClient,
} from 'https://jslib.k6.io/aws/0.14.0/kinesis.js';
const awsConfig = new AWSConfig({
region: __ENV.AWS_REGION,
accessKeyId: __ENV.AWS_ACCESS_KEY_ID,
secretAccessKey: __ENV.AWS_SECRET_ACCESS_KEY,
});
const kinesis = new KinesisClient(awsConfig);
export default async function () {
// List all streams
const streams = await kinesis.listStreams();
console.log('Available streams:', streams.streamNames);
console.log('Has more streams:', streams.hasMoreStreams);
// List streams with pagination
const limitedStreams = await kinesis.listStreams({ limit: 5 });
console.log('First 5 streams:', limitedStreams.streamNames);
// List streams starting from a specific stream
if (limitedStreams.hasMoreStreams && limitedStreams.streamNames.length > 0) {
const nextBatch = await kinesis.listStreams({
exclusiveStartStreamName: limitedStreams.streamNames[limitedStreams.streamNames.length - 1],
});
console.log('Next batch of streams:', nextBatch.streamNames);
}
}Was this page helpful?
Related resources from Grafana Labs

