View a markdown version of this page

Use DescribeStreamSummary with an AWS SDK or CLI - AWS SDK Code Examples

There are more AWS SDK examples available in the AWS Doc SDK Examples GitHub repo.

Use DescribeStreamSummary with an AWS SDK or CLI

The following code examples show how to use DescribeStreamSummary.

Action examples are code excerpts from larger programs and must be run in context. You can see this action in context in the following code example:

CLI
AWS CLI

To describe a data stream summary

The following describe-stream-summary example provides a summarized description (without the shard list) of the specified data stream.

aws kinesis describe-stream-summary \ --stream-name samplestream

Output:

{ "StreamDescriptionSummary": { "StreamName": "samplestream", "StreamARN": "arn:aws:kinesis:us-west-2:123456789012:stream/samplestream", "StreamStatus": "ACTIVE", "RetentionPeriodHours": 48, "StreamCreationTimestamp": 1572297168.0, "EnhancedMonitoring": [ { "ShardLevelMetrics": [] } ], "EncryptionType": "NONE", "OpenShardCount": 3, "ConsumerCount": 0 } }

For more information, see Creating and Managing Streams in the Amazon Kinesis Data Streams Developer Guide.

Python
SDK for Python (Boto3)
Note

There's more on GitHub. Find the complete example and learn how to set up and run in the AWS Code Examples Repository.

def describe_stream_summary(self, stream_name): """ Provides a summarized description of a Kinesis data stream. :param stream_name: The name of the stream to describe. :return: A dictionary containing the stream description summary. """ try: response = self.kinesis_client.describe_stream_summary( StreamName=stream_name ) summary = response.get("StreamDescriptionSummary", dict()) logger.info( "Described stream summary for '%s'. Status: %s.", stream_name, summary.get("StreamStatus", "UNKNOWN"), ) return summary except ClientError as err: if err.response["Error"]["Code"] == "ResourceNotFoundException": logger.error( "Stream '%s' not found. Verify the stream name.", stream_name ) raise