Menu
Amazon Kinesis Streams Service API Reference
API Reference (API Version 2013-12-02)

ListStreams

Lists your Kinesis 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 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 5 transactions per second per account.

Request Syntax

{
   "ExclusiveStartStreamName": "string",
   "Limit": number
}

Request Parameters

The request accepts the following data in JSON format.

ExclusiveStartStreamName

The name of the stream to start the list with.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: [a-zA-Z0-9_.-]+

Required: No

Limit

The maximum number of streams to list.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 10000.

Required: No

Response Syntax

{
   "HasMoreStreams": boolean,
   "StreamNames": [ "string" ]
}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

HasMoreStreams

If set to true, there are more streams available to list.

Type: Boolean

StreamNames

The names of the streams that are associated with the AWS account making the ListStreams request.

Type: Array of strings

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: [a-zA-Z0-9_.-]+

Errors

For information about the errors that are common to all actions, see Common Errors.

LimitExceededException

The requested resource exceeds the maximum number allowed, or the number of concurrent stream requests exceeds the maximum number allowed.

HTTP Status Code: 400

Example

To list your streams

The following JSON example lists your streams, starting with the specified stream.

Sample Request

POST / HTTP/1.1
Host: kinesis.<region>.<domain>
Content-Length: <PayloadSizeBytes>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Authorization: <AuthParams>
Connection: Keep-Alive 
X-Amz-Date: <Date>
X-Amz-Target: Kinesis_20131202.ListStreams

Sample Response

HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date> 
{
  "HasMoreStreams": false,
  "StreamNames": [
    "exampleStreamName"
  ]
}

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: