DescribeStream - Amazon Kinesis Data Streams Service

DescribeStream

Describes the specified Kinesis data stream.

Note

This API has been revised. It's highly recommended that you use the DescribeStreamSummary API to get a summarized description of the specified Kinesis data stream and the ListShards API to list the shards in a specified data stream and obtain information about each shard.

Note

When invoking this API, you must use either the StreamARN or the StreamName parameter, or both. It is recommended that you use the StreamARN input parameter when you invoke this API.

The information returned includes the stream name, Amazon Resource Name (ARN), creation time, enhanced metric configuration, and shard map. The shard map is an array of shard objects. For each shard object, there is the hash key and sequence number ranges that the shard spans, and the IDs of any earlier shards that played in a role in creating the shard. Every record ingested in the stream is identified by a sequence number, which is assigned when the record is put into the stream.

You can limit the number of shards returned by each call. For more information, see Retrieving Shards from a Stream in the Amazon Kinesis Data Streams Developer Guide.

There are no guarantees about the chronological order shards returned. To process shards in chronological order, use the ID of the parent shard to track the lineage to the oldest shard.

This operation has a limit of 10 transactions per second per account.

Request Syntax

{ "ExclusiveStartShardId": "string", "Limit": number, "StreamARN": "string", "StreamName": "string" }

Request Parameters

The request accepts the following data in JSON format.

ExclusiveStartShardId

The shard ID of the shard to start with.

Specify this parameter to indicate that you want to describe the stream starting with the shard whose ID immediately follows ExclusiveStartShardId.

If you don't specify this parameter, the default behavior for DescribeStream is to describe the stream starting with the first shard in the stream.

Type: String

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

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

Required: No

Limit

The maximum number of shards to return in a single call. The default value is 100. If you specify a value greater than 100, at most 100 results are returned.

Type: Integer

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

Required: No

StreamARN

The ARN of the stream.

Type: String

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

Pattern: arn:aws.*:kinesis:.*:\d{12}:stream/\S+

Required: No

StreamName

The name of the stream to describe.

Type: String

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

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

Required: No

Response Syntax

{ "StreamDescription": { "EncryptionType": "string", "EnhancedMonitoring": [ { "ShardLevelMetrics": [ "string" ] } ], "HasMoreShards": boolean, "KeyId": "string", "RetentionPeriodHours": number, "Shards": [ { "AdjacentParentShardId": "string", "HashKeyRange": { "EndingHashKey": "string", "StartingHashKey": "string" }, "ParentShardId": "string", "SequenceNumberRange": { "EndingSequenceNumber": "string", "StartingSequenceNumber": "string" }, "ShardId": "string" } ], "StreamARN": "string", "StreamCreationTimestamp": number, "StreamModeDetails": { "StreamMode": "string" }, "StreamName": "string", "StreamStatus": "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.

StreamDescription

The current status of the stream, the stream Amazon Resource Name (ARN), an array of shard objects that comprise the stream, and whether there are more shards available.

Type: StreamDescription object

Errors

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

AccessDeniedException

Specifies that you do not have the permissions required to perform this operation.

HTTP Status Code: 400

InvalidArgumentException

A specified parameter exceeds its restrictions, is not supported, or can't be used. For more information, see the returned message.

HTTP Status Code: 400

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

ResourceNotFoundException

The requested resource could not be found. The stream might not be specified correctly.

HTTP Status Code: 400

Examples

To get information about a stream

The following JSON example describes 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.DescribeStream { "StreamName":"exampleStreamName" }

Sample Response

HTTP/1.1 200 OK x-amzn-RequestId: <RequestId> Content-Type: application/x-amz-json-1.1 Content-Length: <PayloadSizeBytes> Date: <Date> { "StreamDescription": { "EnhancedMonitoring":[ { "ShardLevelMetrics":[ "IncomingBytes", "OutgoingRecords" ] } ], "HasMoreShards": false, "RetentionPeriodHours": 24, "StreamCreationTimestamp": 1.468346745E9, "Shards": [ { "HashKeyRange": { "EndingHashKey": "113427455640312821154458202477256070484", "StartingHashKey": "0" }, "SequenceNumberRange": { "EndingSequenceNumber": "21269319989741826081360214168359141376", "StartingSequenceNumber": "21267647932558653966460912964485513216" }, "ShardId": "shardId-000000000000" }, { "HashKeyRange": { "EndingHashKey": "226854911280625642308916404954512140969", "StartingHashKey": "113427455640312821154458202477256070485" }, "SequenceNumberRange": { "StartingSequenceNumber": "21267647932558653966460912964485513217" }, "ShardId": "shardId-000000000001" }, { "HashKeyRange": { "EndingHashKey": "340282366920938463463374607431768211455", "StartingHashKey": "226854911280625642308916404954512140970" }, "SequenceNumberRange": { "StartingSequenceNumber": "21267647932558653966460912964485513218" }, "ShardId": "shardId-000000000002" } ], "StreamARN": "arn:aws:kinesis:us-east-1:111122223333:exampleStreamName", "StreamName": "exampleStreamName", "StreamStatus": "ACTIVE" } }

See Also

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