- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
ListStreamsCommand
Lists all of the streams in your Amazon Web Services account.
Requires permission to access the ListStreams action.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { IoTClient, ListStreamsCommand } from "@aws-sdk/client-iot"; // ES Modules import
// const { IoTClient, ListStreamsCommand } = require("@aws-sdk/client-iot"); // CommonJS import
const client = new IoTClient(config);
const input = { // ListStreamsRequest
maxResults: Number("int"),
nextToken: "STRING_VALUE",
ascendingOrder: true || false,
};
const command = new ListStreamsCommand(input);
const response = await client.send(command);
// { // ListStreamsResponse
// streams: [ // StreamsSummary
// { // StreamSummary
// streamId: "STRING_VALUE",
// streamArn: "STRING_VALUE",
// streamVersion: Number("int"),
// description: "STRING_VALUE",
// },
// ],
// nextToken: "STRING_VALUE",
// };
ListStreamsCommand Input
See ListStreamsCommandInput for more details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
ascendingOrder | boolean | undefined | Set to true to return the list of streams in ascending order. |
maxResults | number | undefined | The maximum number of results to return at a time. |
nextToken | string | undefined | A token used to get the next set of results. |
ListStreamsCommand Output
See ListStreamsCommandOutput for details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
nextToken | string | undefined | A token used to get the next set of results. |
streams | StreamSummary[] | undefined | A list of streams. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InternalFailureException | server | An unexpected error has occurred. |
InvalidRequestException | client | The request is not valid. |
ServiceUnavailableException | server | The service is temporarily unavailable. |
ThrottlingException | client | The rate exceeds the limit. |
UnauthorizedException | client | You are not authorized to perform this operation. |
IoTServiceException | Base exception class for all service exceptions from IoT service. |