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

DescribeStream

Describes the specified Amazon Kinesis stream.

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 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,
   "StreamName": "string"
}

Request Parameters

The request accepts the following data in JSON format.

ExclusiveStartShardId

The shard ID of the shard to start 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 shards to return in a single call. The default value is 100. If you specify a value greater than 100, at most 100 shards are returned.

Type: Integer

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

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: Yes

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,
      "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 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.

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

Example

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: