KeyspacesStreams / Client / get_shard_iterator
get_shard_iterator¶
- KeyspacesStreams.Client.get_shard_iterator(**kwargs)¶
Returns a shard iterator that serves as a bookmark for reading data from a specific position in an Amazon Keyspaces data stream’s shard. The shard iterator specifies the shard position from which to start reading data records sequentially. You can specify whether to begin reading at the latest record, the oldest record, or at a particular sequence number within the shard.
See also: AWS API Documentation
Request Syntax
response = client.get_shard_iterator( streamArn='string', shardId='string', shardIteratorType='TRIM_HORIZON'|'LATEST'|'AT_SEQUENCE_NUMBER'|'AFTER_SEQUENCE_NUMBER', sequenceNumber='string' )
- Parameters:
streamArn (string) –
[REQUIRED]
The Amazon Resource Name (ARN) of the stream for which to get the shard iterator. The ARN uniquely identifies the stream within Amazon Keyspaces.
shardId (string) –
[REQUIRED]
The identifier of the shard within the stream. The shard ID uniquely identifies a subset of the stream’s data records that you want to access.
shardIteratorType (string) –
[REQUIRED]
Determines how the shard iterator is positioned. Must be one of the following:
TRIM_HORIZON
- Start reading at the last untrimmed record in the shard, which is the oldest data record in the shard.AT_SEQUENCE_NUMBER
- Start reading exactly from the specified sequence number.AFTER_SEQUENCE_NUMBER
- Start reading right after the specified sequence number.LATEST
- Start reading just after the most recent record in the shard, so that you always read the most recent data.
sequenceNumber (string) – The sequence number of the data record in the shard from which to start reading. Required if
ShardIteratorType
isAT_SEQUENCE_NUMBER
orAFTER_SEQUENCE_NUMBER
. This parameter is ignored for other iterator types.
- Return type:
dict
- Returns:
Response Syntax
{ 'shardIterator': 'string' }
Response Structure
(dict) –
shardIterator (string) –
The unique identifier for the shard iterator. This value is used in the
GetRecords
operation to retrieve data records from the specified shard. Each shard iterator expires 5 minutes after it is returned to the requester.
Exceptions