Skip to content

KinesisClient

Index > Kinesis > KinesisClient

Auto-generated documentation for Kinesis type annotations stubs module types-aiobotocore-kinesis.

KinesisClient

Type annotations and code completion for session.client("kinesis") boto3 documentation

Usage example
from aioboto3.session import Session
from types_aiobotocore_kinesis.client import KinesisClient

session = Session()
async with session.client("kinesis") as client:
    client: KinesisClient

Exceptions

aioboto3 client exceptions are generated in runtime. This class provides code completion for session.client("kinesis").exceptions structure.

Usage example
async with session.client("kinesis") as client:
    try:
        do_something(client)
    except (
            client.ClientError,
        client.ExpiredIteratorException,
        client.ExpiredNextTokenException,
        client.InternalFailureException,
        client.InvalidArgumentException,
        client.KMSAccessDeniedException,
        client.KMSDisabledException,
        client.KMSInvalidStateException,
        client.KMSNotFoundException,
        client.KMSOptInRequired,
        client.KMSThrottlingException,
        client.LimitExceededException,
        client.ProvisionedThroughputExceededException,
        client.ResourceInUseException,
        client.ResourceNotFoundException,
        client.ValidationException,
    ) as e:
        print(e)
Type checking example
from types_aiobotocore_kinesis.client import Exceptions

def handle_error(exc: Exceptions.ClientError) -> None:
    ...

Methods

add_tags_to_stream

Adds or updates tags for the specified Kinesis data stream.

Type annotations and code completion for session.client("kinesis").add_tags_to_stream method. boto3 documentation

Method definition
await def add_tags_to_stream(
    self,
    *,
    StreamName: str,
    Tags: Mapping[str, str],
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: AddTagsToStreamInputRequestTypeDef = {  # (1)
    "StreamName": ...,
    "Tags": ...,
}

parent.add_tags_to_stream(**kwargs)
  1. See AddTagsToStreamInputRequestTypeDef

can_paginate

Check if an operation can be paginated.

Type annotations and code completion for session.client("kinesis").can_paginate method. boto3 documentation

Method definition
def can_paginate(
    self,
    operation_name: str,
) -> bool:
    ...

close

Closes underlying endpoint connections.

Type annotations and code completion for session.client("kinesis").close method. boto3 documentation

Method definition
await def close(
    self,
) -> None:
    ...

create_stream

Creates a Kinesis data stream.

Type annotations and code completion for session.client("kinesis").create_stream method. boto3 documentation

Method definition
await def create_stream(
    self,
    *,
    StreamName: str,
    ShardCount: int = ...,
    StreamModeDetails: StreamModeDetailsTypeDef = ...,  # (1)
) -> EmptyResponseMetadataTypeDef:  # (2)
    ...
  1. See StreamModeDetailsTypeDef
  2. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: CreateStreamInputRequestTypeDef = {  # (1)
    "StreamName": ...,
}

parent.create_stream(**kwargs)
  1. See CreateStreamInputRequestTypeDef

decrease_stream_retention_period

Decreases the Kinesis data stream's retention period, which is the length of time data records are accessible after they are added to the stream.

Type annotations and code completion for session.client("kinesis").decrease_stream_retention_period method. boto3 documentation

Method definition
await def decrease_stream_retention_period(
    self,
    *,
    StreamName: str,
    RetentionPeriodHours: int,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: DecreaseStreamRetentionPeriodInputRequestTypeDef = {  # (1)
    "StreamName": ...,
    "RetentionPeriodHours": ...,
}

parent.decrease_stream_retention_period(**kwargs)
  1. See DecreaseStreamRetentionPeriodInputRequestTypeDef

delete_stream

Deletes a Kinesis data stream and all its shards and data.

Type annotations and code completion for session.client("kinesis").delete_stream method. boto3 documentation

Method definition
await def delete_stream(
    self,
    *,
    StreamName: str,
    EnforceConsumerDeletion: bool = ...,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: DeleteStreamInputRequestTypeDef = {  # (1)
    "StreamName": ...,
}

parent.delete_stream(**kwargs)
  1. See DeleteStreamInputRequestTypeDef

deregister_stream_consumer

To deregister a consumer, provide its ARN.

Type annotations and code completion for session.client("kinesis").deregister_stream_consumer method. boto3 documentation

Method definition
await def deregister_stream_consumer(
    self,
    *,
    StreamARN: str = ...,
    ConsumerName: str = ...,
    ConsumerARN: str = ...,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: DeregisterStreamConsumerInputRequestTypeDef = {  # (1)
    "StreamARN": ...,
}

parent.deregister_stream_consumer(**kwargs)
  1. See DeregisterStreamConsumerInputRequestTypeDef

describe_limits

Describes the shard limits and usage for the account.

Type annotations and code completion for session.client("kinesis").describe_limits method. boto3 documentation

Method definition
await def describe_limits(
    self,
) -> DescribeLimitsOutputTypeDef:  # (1)
    ...
  1. See DescribeLimitsOutputTypeDef

describe_stream

Describes the specified Kinesis data stream.

Type annotations and code completion for session.client("kinesis").describe_stream method. boto3 documentation

Method definition
await def describe_stream(
    self,
    *,
    StreamName: str,
    Limit: int = ...,
    ExclusiveStartShardId: str = ...,
) -> DescribeStreamOutputTypeDef:  # (1)
    ...
  1. See DescribeStreamOutputTypeDef
Usage example with kwargs
kwargs: DescribeStreamInputRequestTypeDef = {  # (1)
    "StreamName": ...,
}

parent.describe_stream(**kwargs)
  1. See DescribeStreamInputRequestTypeDef

describe_stream_consumer

To get the description of a registered consumer, provide the ARN of the consumer.

Type annotations and code completion for session.client("kinesis").describe_stream_consumer method. boto3 documentation

Method definition
await def describe_stream_consumer(
    self,
    *,
    StreamARN: str = ...,
    ConsumerName: str = ...,
    ConsumerARN: str = ...,
) -> DescribeStreamConsumerOutputTypeDef:  # (1)
    ...
  1. See DescribeStreamConsumerOutputTypeDef
Usage example with kwargs
kwargs: DescribeStreamConsumerInputRequestTypeDef = {  # (1)
    "StreamARN": ...,
}

parent.describe_stream_consumer(**kwargs)
  1. See DescribeStreamConsumerInputRequestTypeDef

describe_stream_summary

Provides a summarized description of the specified Kinesis data stream without the shard list.

Type annotations and code completion for session.client("kinesis").describe_stream_summary method. boto3 documentation

Method definition
await def describe_stream_summary(
    self,
    *,
    StreamName: str,
) -> DescribeStreamSummaryOutputTypeDef:  # (1)
    ...
  1. See DescribeStreamSummaryOutputTypeDef
Usage example with kwargs
kwargs: DescribeStreamSummaryInputRequestTypeDef = {  # (1)
    "StreamName": ...,
}

parent.describe_stream_summary(**kwargs)
  1. See DescribeStreamSummaryInputRequestTypeDef

disable_enhanced_monitoring

Disables enhanced monitoring.

Type annotations and code completion for session.client("kinesis").disable_enhanced_monitoring method. boto3 documentation

Method definition
await def disable_enhanced_monitoring(
    self,
    *,
    StreamName: str,
    ShardLevelMetrics: Sequence[MetricsNameType],  # (1)
) -> EnhancedMonitoringOutputTypeDef:  # (2)
    ...
  1. See MetricsNameType
  2. See EnhancedMonitoringOutputTypeDef
Usage example with kwargs
kwargs: DisableEnhancedMonitoringInputRequestTypeDef = {  # (1)
    "StreamName": ...,
    "ShardLevelMetrics": ...,
}

parent.disable_enhanced_monitoring(**kwargs)
  1. See DisableEnhancedMonitoringInputRequestTypeDef

enable_enhanced_monitoring

Enables enhanced Kinesis data stream monitoring for shard-level metrics.

Type annotations and code completion for session.client("kinesis").enable_enhanced_monitoring method. boto3 documentation

Method definition
await def enable_enhanced_monitoring(
    self,
    *,
    StreamName: str,
    ShardLevelMetrics: Sequence[MetricsNameType],  # (1)
) -> EnhancedMonitoringOutputTypeDef:  # (2)
    ...
  1. See MetricsNameType
  2. See EnhancedMonitoringOutputTypeDef
Usage example with kwargs
kwargs: EnableEnhancedMonitoringInputRequestTypeDef = {  # (1)
    "StreamName": ...,
    "ShardLevelMetrics": ...,
}

parent.enable_enhanced_monitoring(**kwargs)
  1. See EnableEnhancedMonitoringInputRequestTypeDef

generate_presigned_url

Generate a presigned url given a client, its method, and arguments.

Type annotations and code completion for session.client("kinesis").generate_presigned_url method. boto3 documentation

Method definition
await def generate_presigned_url(
    self,
    ClientMethod: str,
    Params: Mapping[str, Any] = ...,
    ExpiresIn: int = 3600,
    HttpMethod: str = ...,
) -> str:
    ...

get_records

Gets data records from a Kinesis data stream's shard.

Type annotations and code completion for session.client("kinesis").get_records method. boto3 documentation

Method definition
await def get_records(
    self,
    *,
    ShardIterator: str,
    Limit: int = ...,
) -> GetRecordsOutputTypeDef:  # (1)
    ...
  1. See GetRecordsOutputTypeDef
Usage example with kwargs
kwargs: GetRecordsInputRequestTypeDef = {  # (1)
    "ShardIterator": ...,
}

parent.get_records(**kwargs)
  1. See GetRecordsInputRequestTypeDef

get_shard_iterator

Gets an Amazon Kinesis shard iterator.

Type annotations and code completion for session.client("kinesis").get_shard_iterator method. boto3 documentation

Method definition
await def get_shard_iterator(
    self,
    *,
    StreamName: str,
    ShardId: str,
    ShardIteratorType: ShardIteratorTypeType,  # (1)
    StartingSequenceNumber: str = ...,
    Timestamp: Union[datetime, str] = ...,
) -> GetShardIteratorOutputTypeDef:  # (2)
    ...
  1. See ShardIteratorTypeType
  2. See GetShardIteratorOutputTypeDef
Usage example with kwargs
kwargs: GetShardIteratorInputRequestTypeDef = {  # (1)
    "StreamName": ...,
    "ShardId": ...,
    "ShardIteratorType": ...,
}

parent.get_shard_iterator(**kwargs)
  1. See GetShardIteratorInputRequestTypeDef

increase_stream_retention_period

Increases the Kinesis data stream's retention period, which is the length of time data records are accessible after they are added to the stream.

Type annotations and code completion for session.client("kinesis").increase_stream_retention_period method. boto3 documentation

Method definition
await def increase_stream_retention_period(
    self,
    *,
    StreamName: str,
    RetentionPeriodHours: int,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: IncreaseStreamRetentionPeriodInputRequestTypeDef = {  # (1)
    "StreamName": ...,
    "RetentionPeriodHours": ...,
}

parent.increase_stream_retention_period(**kwargs)
  1. See IncreaseStreamRetentionPeriodInputRequestTypeDef

list_shards

Lists the shards in a stream and provides information about each shard.

Type annotations and code completion for session.client("kinesis").list_shards method. boto3 documentation

Method definition
await def list_shards(
    self,
    *,
    StreamName: str = ...,
    NextToken: str = ...,
    ExclusiveStartShardId: str = ...,
    MaxResults: int = ...,
    StreamCreationTimestamp: Union[datetime, str] = ...,
    ShardFilter: ShardFilterTypeDef = ...,  # (1)
) -> ListShardsOutputTypeDef:  # (2)
    ...
  1. See ShardFilterTypeDef
  2. See ListShardsOutputTypeDef
Usage example with kwargs
kwargs: ListShardsInputRequestTypeDef = {  # (1)
    "StreamName": ...,
}

parent.list_shards(**kwargs)
  1. See ListShardsInputRequestTypeDef

list_stream_consumers

Lists the consumers registered to receive data from a stream using enhanced fan- out, and provides information about each consumer.

Type annotations and code completion for session.client("kinesis").list_stream_consumers method. boto3 documentation

Method definition
await def list_stream_consumers(
    self,
    *,
    StreamARN: str,
    NextToken: str = ...,
    MaxResults: int = ...,
    StreamCreationTimestamp: Union[datetime, str] = ...,
) -> ListStreamConsumersOutputTypeDef:  # (1)
    ...
  1. See ListStreamConsumersOutputTypeDef
Usage example with kwargs
kwargs: ListStreamConsumersInputRequestTypeDef = {  # (1)
    "StreamARN": ...,
}

parent.list_stream_consumers(**kwargs)
  1. See ListStreamConsumersInputRequestTypeDef

list_streams

Lists your Kinesis data streams.

Type annotations and code completion for session.client("kinesis").list_streams method. boto3 documentation

Method definition
await def list_streams(
    self,
    *,
    Limit: int = ...,
    ExclusiveStartStreamName: str = ...,
) -> ListStreamsOutputTypeDef:  # (1)
    ...
  1. See ListStreamsOutputTypeDef
Usage example with kwargs
kwargs: ListStreamsInputRequestTypeDef = {  # (1)
    "Limit": ...,
}

parent.list_streams(**kwargs)
  1. See ListStreamsInputRequestTypeDef

list_tags_for_stream

Lists the tags for the specified Kinesis data stream.

Type annotations and code completion for session.client("kinesis").list_tags_for_stream method. boto3 documentation

Method definition
await def list_tags_for_stream(
    self,
    *,
    StreamName: str,
    ExclusiveStartTagKey: str = ...,
    Limit: int = ...,
) -> ListTagsForStreamOutputTypeDef:  # (1)
    ...
  1. See ListTagsForStreamOutputTypeDef
Usage example with kwargs
kwargs: ListTagsForStreamInputRequestTypeDef = {  # (1)
    "StreamName": ...,
}

parent.list_tags_for_stream(**kwargs)
  1. See ListTagsForStreamInputRequestTypeDef

merge_shards

Merges two adjacent shards in a Kinesis data stream and combines them into a single shard to reduce the stream's capacity to ingest and transport data.

Type annotations and code completion for session.client("kinesis").merge_shards method. boto3 documentation

Method definition
await def merge_shards(
    self,
    *,
    StreamName: str,
    ShardToMerge: str,
    AdjacentShardToMerge: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: MergeShardsInputRequestTypeDef = {  # (1)
    "StreamName": ...,
    "ShardToMerge": ...,
    "AdjacentShardToMerge": ...,
}

parent.merge_shards(**kwargs)
  1. See MergeShardsInputRequestTypeDef

put_record

Writes a single data record into an Amazon Kinesis data stream.

Type annotations and code completion for session.client("kinesis").put_record method. boto3 documentation

Method definition
await def put_record(
    self,
    *,
    StreamName: str,
    Data: Union[str, bytes, IO[Any], StreamingBody],
    PartitionKey: str,
    ExplicitHashKey: str = ...,
    SequenceNumberForOrdering: str = ...,
) -> PutRecordOutputTypeDef:  # (1)
    ...
  1. See PutRecordOutputTypeDef
Usage example with kwargs
kwargs: PutRecordInputRequestTypeDef = {  # (1)
    "StreamName": ...,
    "Data": ...,
    "PartitionKey": ...,
}

parent.put_record(**kwargs)
  1. See PutRecordInputRequestTypeDef

put_records

Writes multiple data records into a Kinesis data stream in a single call (also referred to as a PutRecords request).

Type annotations and code completion for session.client("kinesis").put_records method. boto3 documentation

Method definition
await def put_records(
    self,
    *,
    Records: Sequence[PutRecordsRequestEntryTypeDef],  # (1)
    StreamName: str,
) -> PutRecordsOutputTypeDef:  # (2)
    ...
  1. See PutRecordsRequestEntryTypeDef
  2. See PutRecordsOutputTypeDef
Usage example with kwargs
kwargs: PutRecordsInputRequestTypeDef = {  # (1)
    "Records": ...,
    "StreamName": ...,
}

parent.put_records(**kwargs)
  1. See PutRecordsInputRequestTypeDef

register_stream_consumer

Registers a consumer with a Kinesis data stream.

Type annotations and code completion for session.client("kinesis").register_stream_consumer method. boto3 documentation

Method definition
await def register_stream_consumer(
    self,
    *,
    StreamARN: str,
    ConsumerName: str,
) -> RegisterStreamConsumerOutputTypeDef:  # (1)
    ...
  1. See RegisterStreamConsumerOutputTypeDef
Usage example with kwargs
kwargs: RegisterStreamConsumerInputRequestTypeDef = {  # (1)
    "StreamARN": ...,
    "ConsumerName": ...,
}

parent.register_stream_consumer(**kwargs)
  1. See RegisterStreamConsumerInputRequestTypeDef

remove_tags_from_stream

Removes tags from the specified Kinesis data stream.

Type annotations and code completion for session.client("kinesis").remove_tags_from_stream method. boto3 documentation

Method definition
await def remove_tags_from_stream(
    self,
    *,
    StreamName: str,
    TagKeys: Sequence[str],
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: RemoveTagsFromStreamInputRequestTypeDef = {  # (1)
    "StreamName": ...,
    "TagKeys": ...,
}

parent.remove_tags_from_stream(**kwargs)
  1. See RemoveTagsFromStreamInputRequestTypeDef

split_shard

Splits a shard into two new shards in the Kinesis data stream, to increase the stream's capacity to ingest and transport data.

Type annotations and code completion for session.client("kinesis").split_shard method. boto3 documentation

Method definition
await def split_shard(
    self,
    *,
    StreamName: str,
    ShardToSplit: str,
    NewStartingHashKey: str,
) -> EmptyResponseMetadataTypeDef:  # (1)
    ...
  1. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: SplitShardInputRequestTypeDef = {  # (1)
    "StreamName": ...,
    "ShardToSplit": ...,
    "NewStartingHashKey": ...,
}

parent.split_shard(**kwargs)
  1. See SplitShardInputRequestTypeDef

start_stream_encryption

Enables or updates server-side encryption using an Amazon Web Services KMS key for a specified stream.

Type annotations and code completion for session.client("kinesis").start_stream_encryption method. boto3 documentation

Method definition
await def start_stream_encryption(
    self,
    *,
    StreamName: str,
    EncryptionType: EncryptionTypeType,  # (1)
    KeyId: str,
) -> EmptyResponseMetadataTypeDef:  # (2)
    ...
  1. See EncryptionTypeType
  2. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: StartStreamEncryptionInputRequestTypeDef = {  # (1)
    "StreamName": ...,
    "EncryptionType": ...,
    "KeyId": ...,
}

parent.start_stream_encryption(**kwargs)
  1. See StartStreamEncryptionInputRequestTypeDef

stop_stream_encryption

Disables server-side encryption for a specified stream.

Type annotations and code completion for session.client("kinesis").stop_stream_encryption method. boto3 documentation

Method definition
await def stop_stream_encryption(
    self,
    *,
    StreamName: str,
    EncryptionType: EncryptionTypeType,  # (1)
    KeyId: str,
) -> EmptyResponseMetadataTypeDef:  # (2)
    ...
  1. See EncryptionTypeType
  2. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: StopStreamEncryptionInputRequestTypeDef = {  # (1)
    "StreamName": ...,
    "EncryptionType": ...,
    "KeyId": ...,
}

parent.stop_stream_encryption(**kwargs)
  1. See StopStreamEncryptionInputRequestTypeDef

subscribe_to_shard

This operation establishes an HTTP/2 connection between the consumer you specify in the ConsumerARN parameter and the shard you specify in the ShardId parameter.

Type annotations and code completion for session.client("kinesis").subscribe_to_shard method. boto3 documentation

Method definition
await def subscribe_to_shard(
    self,
    *,
    ConsumerARN: str,
    ShardId: str,
    StartingPosition: StartingPositionTypeDef,  # (1)
) -> SubscribeToShardOutputTypeDef:  # (2)
    ...
  1. See StartingPositionTypeDef
  2. See SubscribeToShardOutputTypeDef
Usage example with kwargs
kwargs: SubscribeToShardInputRequestTypeDef = {  # (1)
    "ConsumerARN": ...,
    "ShardId": ...,
    "StartingPosition": ...,
}

parent.subscribe_to_shard(**kwargs)
  1. See SubscribeToShardInputRequestTypeDef

update_shard_count

Updates the shard count of the specified stream to the specified number of shards.

Type annotations and code completion for session.client("kinesis").update_shard_count method. boto3 documentation

Method definition
await def update_shard_count(
    self,
    *,
    StreamName: str,
    TargetShardCount: int,
    ScalingType: ScalingTypeType,  # (1)
) -> UpdateShardCountOutputTypeDef:  # (2)
    ...
  1. See ScalingTypeType
  2. See UpdateShardCountOutputTypeDef
Usage example with kwargs
kwargs: UpdateShardCountInputRequestTypeDef = {  # (1)
    "StreamName": ...,
    "TargetShardCount": ...,
    "ScalingType": ...,
}

parent.update_shard_count(**kwargs)
  1. See UpdateShardCountInputRequestTypeDef

update_stream_mode

Updates the capacity mode of the data stream.

Type annotations and code completion for session.client("kinesis").update_stream_mode method. boto3 documentation

Method definition
await def update_stream_mode(
    self,
    *,
    StreamARN: str,
    StreamModeDetails: StreamModeDetailsTypeDef,  # (1)
) -> EmptyResponseMetadataTypeDef:  # (2)
    ...
  1. See StreamModeDetailsTypeDef
  2. See EmptyResponseMetadataTypeDef
Usage example with kwargs
kwargs: UpdateStreamModeInputRequestTypeDef = {  # (1)
    "StreamARN": ...,
    "StreamModeDetails": ...,
}

parent.update_stream_mode(**kwargs)
  1. See UpdateStreamModeInputRequestTypeDef

__aenter__

Type annotations and code completion for session.client("kinesis").__aenter__ method. boto3 documentation

Method definition
await def __aenter__(
    self,
) -> KinesisClient:
    ...

__aexit__

Type annotations and code completion for session.client("kinesis").__aexit__ method. boto3 documentation

Method definition
await def __aexit__(
    self,
    exc_type: Any,
    exc_val: Any,
    exc_tb: Any,
) -> Any:
    ...

get_paginator

Type annotations and code completion for session.client("kinesis").get_paginator method with overloads.

get_waiter

Type annotations and code completion for session.client("kinesis").get_waiter method with overloads.