Struct aws_sdk_kinesis::Client
source · pub struct Client { /* private fields */ }
Expand description
Client for Amazon Kinesis
Client for invoking operations on Amazon Kinesis. Each operation on Amazon Kinesis is a method on this
this struct. .send()
MUST be invoked on the generated operations to dispatch the request to the service.
Examples
Constructing a client and invoking an operation
// create a shared configuration. This can be used & shared between multiple service clients.
let shared_config = aws_config::load_from_env().await;
let client = aws_sdk_kinesis::Client::new(&shared_config);
// invoke an operation
/* let rsp = client
.<operation_name>().
.<param>("some value")
.send().await; */
Constructing a client with custom configuration
use aws_config::retry::RetryConfig;
let shared_config = aws_config::load_from_env().await;
let config = aws_sdk_kinesis::config::Builder::from(&shared_config)
.retry_config(RetryConfig::disabled())
.build();
let client = aws_sdk_kinesis::Client::from_conf(config);
Implementations§
source§impl Client
impl Client
sourcepub fn with_config(
client: Client<DynConnector, DynMiddleware<DynConnector>>,
conf: Config
) -> Self
pub fn with_config(
client: Client<DynConnector, DynMiddleware<DynConnector>>,
conf: Config
) -> Self
Creates a client with the given service configuration.
source§impl Client
impl Client
Constructs a fluent builder for the AddTagsToStream
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:The name of the stream.
tags(HashMap<String, String>)
/set_tags(Option<HashMap<String, String>>)
:A set of up to 10 key-value pairs to use to create the tags.
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the stream.
- On success, responds with
AddTagsToStreamOutput
- On failure, responds with
SdkError<AddTagsToStreamError>
sourcepub fn create_stream(&self) -> CreateStream
pub fn create_stream(&self) -> CreateStream
Constructs a fluent builder for the CreateStream
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:A name to identify the stream. The stream name is scoped to the Amazon Web Services account used by the application that creates the stream. It is also scoped by Amazon Web Services Region. That is, two streams in two different Amazon Web Services accounts can have the same name. Two streams in the same Amazon Web Services account but in two different Regions can also have the same name.
shard_count(i32)
/set_shard_count(Option<i32>)
:The number of shards that the stream will use. The throughput of the stream is a function of the number of shards; more shards are required for greater provisioned throughput.
stream_mode_details(StreamModeDetails)
/set_stream_mode_details(Option<StreamModeDetails>)
:Indicates the capacity mode of the data stream. Currently, in Kinesis Data Streams, you can choose between an on-demand capacity mode and a provisioned capacity mode for your data streams.
- On success, responds with
CreateStreamOutput
- On failure, responds with
SdkError<CreateStreamError>
sourcepub fn decrease_stream_retention_period(&self) -> DecreaseStreamRetentionPeriod
pub fn decrease_stream_retention_period(&self) -> DecreaseStreamRetentionPeriod
Constructs a fluent builder for the DecreaseStreamRetentionPeriod
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:The name of the stream to modify.
retention_period_hours(i32)
/set_retention_period_hours(Option<i32>)
:The new retention period of the stream, in hours. Must be less than the current retention period.
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the stream.
- On success, responds with
DecreaseStreamRetentionPeriodOutput
- On failure, responds with
SdkError<DecreaseStreamRetentionPeriodError>
sourcepub fn delete_stream(&self) -> DeleteStream
pub fn delete_stream(&self) -> DeleteStream
Constructs a fluent builder for the DeleteStream
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:The name of the stream to delete.
enforce_consumer_deletion(bool)
/set_enforce_consumer_deletion(Option<bool>)
:If this parameter is unset (
null
) or if you set it tofalse
, and the stream has registered consumers, the call toDeleteStream
fails with aResourceInUseException
.stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the stream.
- On success, responds with
DeleteStreamOutput
- On failure, responds with
SdkError<DeleteStreamError>
sourcepub fn deregister_stream_consumer(&self) -> DeregisterStreamConsumer
pub fn deregister_stream_consumer(&self) -> DeregisterStreamConsumer
Constructs a fluent builder for the DeregisterStreamConsumer
operation.
- The fluent builder is configurable:
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the Kinesis data stream that the consumer is registered with. For more information, see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces.
consumer_name(impl Into<String>)
/set_consumer_name(Option<String>)
:The name that you gave to the consumer.
consumer_arn(impl Into<String>)
/set_consumer_arn(Option<String>)
:The ARN returned by Kinesis Data Streams when you registered the consumer. If you don’t know the ARN of the consumer that you want to deregister, you can use the ListStreamConsumers operation to get a list of the descriptions of all the consumers that are currently registered with a given data stream. The description of a consumer contains its ARN.
- On success, responds with
DeregisterStreamConsumerOutput
- On failure, responds with
SdkError<DeregisterStreamConsumerError>
sourcepub fn describe_limits(&self) -> DescribeLimits
pub fn describe_limits(&self) -> DescribeLimits
Constructs a fluent builder for the DescribeLimits
operation.
- The fluent builder takes no input, just
send
it. - On success, responds with
DescribeLimitsOutput
with field(s):shard_limit(Option<i32>)
:The maximum number of shards.
open_shard_count(Option<i32>)
:The number of open shards.
on_demand_stream_count(Option<i32>)
:Indicates the number of data streams with the on-demand capacity mode.
on_demand_stream_count_limit(Option<i32>)
:The maximum number of data streams with the on-demand capacity mode.
- On failure, responds with
SdkError<DescribeLimitsError>
sourcepub fn describe_stream(&self) -> DescribeStream
pub fn describe_stream(&self) -> DescribeStream
Constructs a fluent builder for the DescribeStream
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:The name of the stream to describe.
limit(i32)
/set_limit(Option<i32>)
: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.
exclusive_start_shard_id(impl Into<String>)
/set_exclusive_start_shard_id(Option<String>)
: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.stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the stream.
- On success, responds with
DescribeStreamOutput
with field(s):stream_description(Option<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.
- On failure, responds with
SdkError<DescribeStreamError>
sourcepub fn describe_stream_consumer(&self) -> DescribeStreamConsumer
pub fn describe_stream_consumer(&self) -> DescribeStreamConsumer
Constructs a fluent builder for the DescribeStreamConsumer
operation.
- The fluent builder is configurable:
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the Kinesis data stream that the consumer is registered with. For more information, see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces.
consumer_name(impl Into<String>)
/set_consumer_name(Option<String>)
:The name that you gave to the consumer.
consumer_arn(impl Into<String>)
/set_consumer_arn(Option<String>)
:The ARN returned by Kinesis Data Streams when you registered the consumer.
- On success, responds with
DescribeStreamConsumerOutput
with field(s):consumer_description(Option<ConsumerDescription>)
:An object that represents the details of the consumer.
- On failure, responds with
SdkError<DescribeStreamConsumerError>
sourcepub fn describe_stream_summary(&self) -> DescribeStreamSummary
pub fn describe_stream_summary(&self) -> DescribeStreamSummary
Constructs a fluent builder for the DescribeStreamSummary
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:The name of the stream to describe.
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the stream.
- On success, responds with
DescribeStreamSummaryOutput
with field(s):stream_description_summary(Option<StreamDescriptionSummary>)
:A
StreamDescriptionSummary
containing information about the stream.
- On failure, responds with
SdkError<DescribeStreamSummaryError>
sourcepub fn disable_enhanced_monitoring(&self) -> DisableEnhancedMonitoring
pub fn disable_enhanced_monitoring(&self) -> DisableEnhancedMonitoring
Constructs a fluent builder for the DisableEnhancedMonitoring
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:The name of the Kinesis data stream for which to disable enhanced monitoring.
shard_level_metrics(Vec<MetricsName>)
/set_shard_level_metrics(Option<Vec<MetricsName>>)
:List of shard-level metrics to disable.
The following are the valid shard-level metrics. The value “
ALL
” disables every metric.-
IncomingBytes
-
IncomingRecords
-
OutgoingBytes
-
OutgoingRecords
-
WriteProvisionedThroughputExceeded
-
ReadProvisionedThroughputExceeded
-
IteratorAgeMilliseconds
-
ALL
For more information, see Monitoring the Amazon Kinesis Data Streams Service with Amazon CloudWatch in the Amazon Kinesis Data Streams Developer Guide.
-
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the stream.
- On success, responds with
DisableEnhancedMonitoringOutput
with field(s):stream_name(Option<String>)
:The name of the Kinesis data stream.
current_shard_level_metrics(Option<Vec<MetricsName>>)
:Represents the current state of the metrics that are in the enhanced state before the operation.
desired_shard_level_metrics(Option<Vec<MetricsName>>)
:Represents the list of all the metrics that would be in the enhanced state after the operation.
stream_arn(Option<String>)
:The ARN of the stream.
- On failure, responds with
SdkError<DisableEnhancedMonitoringError>
sourcepub fn enable_enhanced_monitoring(&self) -> EnableEnhancedMonitoring
pub fn enable_enhanced_monitoring(&self) -> EnableEnhancedMonitoring
Constructs a fluent builder for the EnableEnhancedMonitoring
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:The name of the stream for which to enable enhanced monitoring.
shard_level_metrics(Vec<MetricsName>)
/set_shard_level_metrics(Option<Vec<MetricsName>>)
:List of shard-level metrics to enable.
The following are the valid shard-level metrics. The value “
ALL
” enables every metric.-
IncomingBytes
-
IncomingRecords
-
OutgoingBytes
-
OutgoingRecords
-
WriteProvisionedThroughputExceeded
-
ReadProvisionedThroughputExceeded
-
IteratorAgeMilliseconds
-
ALL
For more information, see Monitoring the Amazon Kinesis Data Streams Service with Amazon CloudWatch in the Amazon Kinesis Data Streams Developer Guide.
-
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the stream.
- On success, responds with
EnableEnhancedMonitoringOutput
with field(s):stream_name(Option<String>)
:The name of the Kinesis data stream.
current_shard_level_metrics(Option<Vec<MetricsName>>)
:Represents the current state of the metrics that are in the enhanced state before the operation.
desired_shard_level_metrics(Option<Vec<MetricsName>>)
:Represents the list of all the metrics that would be in the enhanced state after the operation.
stream_arn(Option<String>)
:The ARN of the stream.
- On failure, responds with
SdkError<EnableEnhancedMonitoringError>
sourcepub fn get_records(&self) -> GetRecords
pub fn get_records(&self) -> GetRecords
Constructs a fluent builder for the GetRecords
operation.
- The fluent builder is configurable:
shard_iterator(impl Into<String>)
/set_shard_iterator(Option<String>)
:The position in the shard from which you want to start sequentially reading data records. A shard iterator specifies this position using the sequence number of a data record in the shard.
limit(i32)
/set_limit(Option<i32>)
:The maximum number of records to return. Specify a value of up to 10,000. If you specify a value that is greater than 10,000,
GetRecords
throwsInvalidArgumentException
. The default value is 10,000.stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the stream.
- On success, responds with
GetRecordsOutput
with field(s):records(Option<Vec<Record>>)
:The data records retrieved from the shard.
next_shard_iterator(Option<String>)
:The next position in the shard from which to start sequentially reading data records. If set to
null
, the shard has been closed and the requested iterator does not return any more data.millis_behind_latest(Option<i64>)
:The number of milliseconds the
GetRecords
response is from the tip of the stream, indicating how far behind current time the consumer is. A value of zero indicates that record processing is caught up, and there are no new records to process at this moment.child_shards(Option<Vec<ChildShard>>)
:The list of the current shard’s child shards, returned in the
GetRecords
API’s response only when the end of the current shard is reached.
- On failure, responds with
SdkError<GetRecordsError>
sourcepub fn get_shard_iterator(&self) -> GetShardIterator
pub fn get_shard_iterator(&self) -> GetShardIterator
Constructs a fluent builder for the GetShardIterator
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:The name of the Amazon Kinesis data stream.
shard_id(impl Into<String>)
/set_shard_id(Option<String>)
:The shard ID of the Kinesis Data Streams shard to get the iterator for.
shard_iterator_type(ShardIteratorType)
/set_shard_iterator_type(Option<ShardIteratorType>)
:Determines how the shard iterator is used to start reading data records from the shard.
The following are the valid Amazon Kinesis shard iterator types:
-
AT_SEQUENCE_NUMBER - Start reading from the position denoted by a specific sequence number, provided in the value
StartingSequenceNumber
. -
AFTER_SEQUENCE_NUMBER - Start reading right after the position denoted by a specific sequence number, provided in the value
StartingSequenceNumber
. -
AT_TIMESTAMP - Start reading from the position denoted by a specific time stamp, provided in the value
Timestamp
. -
TRIM_HORIZON - Start reading at the last untrimmed record in the shard in the system, which is the oldest data record in the shard.
-
LATEST - Start reading just after the most recent record in the shard, so that you always read the most recent data in the shard.
-
starting_sequence_number(impl Into<String>)
/set_starting_sequence_number(Option<String>)
:The sequence number of the data record in the shard from which to start reading. Used with shard iterator type AT_SEQUENCE_NUMBER and AFTER_SEQUENCE_NUMBER.
timestamp(DateTime)
/set_timestamp(Option<DateTime>)
:The time stamp of the data record from which to start reading. Used with shard iterator type AT_TIMESTAMP. A time stamp is the Unix epoch date with precision in milliseconds. For example,
2016-04-04T19:58:46.480-00:00
or1459799926.480
. If a record with this exact time stamp does not exist, the iterator returned is for the next (later) record. If the time stamp is older than the current trim horizon, the iterator returned is for the oldest untrimmed data record (TRIM_HORIZON).stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the stream.
- On success, responds with
GetShardIteratorOutput
with field(s):shard_iterator(Option<String>)
:The position in the shard from which to start reading data records sequentially. A shard iterator specifies this position using the sequence number of a data record in a shard.
- On failure, responds with
SdkError<GetShardIteratorError>
sourcepub fn increase_stream_retention_period(&self) -> IncreaseStreamRetentionPeriod
pub fn increase_stream_retention_period(&self) -> IncreaseStreamRetentionPeriod
Constructs a fluent builder for the IncreaseStreamRetentionPeriod
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:The name of the stream to modify.
retention_period_hours(i32)
/set_retention_period_hours(Option<i32>)
:The new retention period of the stream, in hours. Must be more than the current retention period.
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the stream.
- On success, responds with
IncreaseStreamRetentionPeriodOutput
- On failure, responds with
SdkError<IncreaseStreamRetentionPeriodError>
sourcepub fn list_shards(&self) -> ListShards
pub fn list_shards(&self) -> ListShards
Constructs a fluent builder for the ListShards
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:The name of the data stream whose shards you want to list.
You cannot specify this parameter if you specify the
NextToken
parameter.next_token(impl Into<String>)
/set_next_token(Option<String>)
:When the number of shards in the data stream is greater than the default value for the
MaxResults
parameter, or if you explicitly specify a value forMaxResults
that is less than the number of shards in the data stream, the response includes a pagination token namedNextToken
. You can specify thisNextToken
value in a subsequent call toListShards
to list the next set of shards.Don’t specify
StreamName
orStreamCreationTimestamp
if you specifyNextToken
because the latter unambiguously identifies the stream.You can optionally specify a value for the
MaxResults
parameter when you specifyNextToken
. If you specify aMaxResults
value that is less than the number of shards that the operation returns if you don’t specifyMaxResults
, the response will contain a newNextToken
value. You can use the newNextToken
value in a subsequent call to theListShards
operation.Tokens expire after 300 seconds. When you obtain a value for
NextToken
in the response to a call toListShards
, you have 300 seconds to use that value. If you specify an expired token in a call toListShards
, you getExpiredNextTokenException
.exclusive_start_shard_id(impl Into<String>)
/set_exclusive_start_shard_id(Option<String>)
:Specify this parameter to indicate that you want to list the shards starting with the shard whose ID immediately follows
ExclusiveStartShardId
.If you don’t specify this parameter, the default behavior is for
ListShards
to list the shards starting with the first one in the stream.You cannot specify this parameter if you specify
NextToken
.max_results(i32)
/set_max_results(Option<i32>)
:The maximum number of shards to return in a single call to
ListShards
. The maximum number of shards to return in a single call. The default value is 1000. If you specify a value greater than 1000, at most 1000 results are returned.When the number of shards to be listed is greater than the value of
MaxResults
, the response contains aNextToken
value that you can use in a subsequent call toListShards
to list the next set of shards.stream_creation_timestamp(DateTime)
/set_stream_creation_timestamp(Option<DateTime>)
:Specify this input parameter to distinguish data streams that have the same name. For example, if you create a data stream and then delete it, and you later create another data stream with the same name, you can use this input parameter to specify which of the two streams you want to list the shards for.
You cannot specify this parameter if you specify the
NextToken
parameter.shard_filter(ShardFilter)
/set_shard_filter(Option<ShardFilter>)
:Enables you to filter out the response of the
ListShards
API. You can only specify one filter at a time.If you use the
ShardFilter
parameter when invoking the ListShards API, theType
is the required property and must be specified. If you specify theAT_TRIM_HORIZON
,FROM_TRIM_HORIZON
, orAT_LATEST
types, you do not need to specify either theShardId
or theTimestamp
optional properties.If you specify the
AFTER_SHARD_ID
type, you must also provide the value for the optionalShardId
property. TheShardId
property is identical in fuctionality to theExclusiveStartShardId
parameter of theListShards
API. WhenShardId
property is specified, the response includes the shards starting with the shard whose ID immediately follows theShardId
that you provided.If you specify the
AT_TIMESTAMP
orFROM_TIMESTAMP_ID
type, you must also provide the value for the optionalTimestamp
property. If you specify the AT_TIMESTAMP type, then all shards that were open at the provided timestamp are returned. If you specify the FROM_TIMESTAMP type, then all shards starting from the provided timestamp to TIP are returned.stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the stream.
- On success, responds with
ListShardsOutput
with field(s):shards(Option<Vec<Shard>>)
:An array of JSON objects. Each object represents one shard and specifies the IDs of the shard, the shard’s parent, and the shard that’s adjacent to the shard’s parent. Each object also contains the starting and ending hash keys and the starting and ending sequence numbers for the shard.
next_token(Option<String>)
:When the number of shards in the data stream is greater than the default value for the
MaxResults
parameter, or if you explicitly specify a value forMaxResults
that is less than the number of shards in the data stream, the response includes a pagination token namedNextToken
. You can specify thisNextToken
value in a subsequent call toListShards
to list the next set of shards. For more information about the use of this pagination token when calling theListShards
operation, seeListShardsInput$NextToken
.Tokens expire after 300 seconds. When you obtain a value for
NextToken
in the response to a call toListShards
, you have 300 seconds to use that value. If you specify an expired token in a call toListShards
, you getExpiredNextTokenException
.
- On failure, responds with
SdkError<ListShardsError>
sourcepub fn list_stream_consumers(&self) -> ListStreamConsumers
pub fn list_stream_consumers(&self) -> ListStreamConsumers
Constructs a fluent builder for the ListStreamConsumers
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the Kinesis data stream for which you want to list the registered consumers. For more information, see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:When the number of consumers that are registered with the data stream is greater than the default value for the
MaxResults
parameter, or if you explicitly specify a value forMaxResults
that is less than the number of consumers that are registered with the data stream, the response includes a pagination token namedNextToken
. You can specify thisNextToken
value in a subsequent call toListStreamConsumers
to list the next set of registered consumers.Don’t specify
StreamName
orStreamCreationTimestamp
if you specifyNextToken
because the latter unambiguously identifies the stream.You can optionally specify a value for the
MaxResults
parameter when you specifyNextToken
. If you specify aMaxResults
value that is less than the number of consumers that the operation returns if you don’t specifyMaxResults
, the response will contain a newNextToken
value. You can use the newNextToken
value in a subsequent call to theListStreamConsumers
operation to list the next set of consumers.Tokens expire after 300 seconds. When you obtain a value for
NextToken
in the response to a call toListStreamConsumers
, you have 300 seconds to use that value. If you specify an expired token in a call toListStreamConsumers
, you getExpiredNextTokenException
.max_results(i32)
/set_max_results(Option<i32>)
:The maximum number of consumers that you want a single call of
ListStreamConsumers
to return. The default value is 100. If you specify a value greater than 100, at most 100 results are returned.stream_creation_timestamp(DateTime)
/set_stream_creation_timestamp(Option<DateTime>)
:Specify this input parameter to distinguish data streams that have the same name. For example, if you create a data stream and then delete it, and you later create another data stream with the same name, you can use this input parameter to specify which of the two streams you want to list the consumers for.
You can’t specify this parameter if you specify the NextToken parameter.
- On success, responds with
ListStreamConsumersOutput
with field(s):consumers(Option<Vec<Consumer>>)
:An array of JSON objects. Each object represents one registered consumer.
next_token(Option<String>)
:When the number of consumers that are registered with the data stream is greater than the default value for the
MaxResults
parameter, or if you explicitly specify a value forMaxResults
that is less than the number of registered consumers, the response includes a pagination token namedNextToken
. You can specify thisNextToken
value in a subsequent call toListStreamConsumers
to list the next set of registered consumers. For more information about the use of this pagination token when calling theListStreamConsumers
operation, seeListStreamConsumersInput$NextToken
.Tokens expire after 300 seconds. When you obtain a value for
NextToken
in the response to a call toListStreamConsumers
, you have 300 seconds to use that value. If you specify an expired token in a call toListStreamConsumers
, you getExpiredNextTokenException
.
- On failure, responds with
SdkError<ListStreamConsumersError>
sourcepub fn list_streams(&self) -> ListStreams
pub fn list_streams(&self) -> ListStreams
Constructs a fluent builder for the ListStreams
operation.
This operation supports pagination; See into_paginator()
.
- The fluent builder is configurable:
limit(i32)
/set_limit(Option<i32>)
:The maximum number of streams to list. The default value is 100. If you specify a value greater than 100, at most 100 results are returned.
exclusive_start_stream_name(impl Into<String>)
/set_exclusive_start_stream_name(Option<String>)
:The name of the stream to start the list with.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
- On success, responds with
ListStreamsOutput
with field(s):stream_names(Option<Vec<String>>)
:The names of the streams that are associated with the Amazon Web Services account making the
ListStreams
request.has_more_streams(Option<bool>)
:If set to
true
, there are more streams available to list.next_token(Option<String>)
:stream_summaries(Option<Vec<StreamSummary>>)
:
- On failure, responds with
SdkError<ListStreamsError>
Constructs a fluent builder for the ListTagsForStream
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:The name of the stream.
exclusive_start_tag_key(impl Into<String>)
/set_exclusive_start_tag_key(Option<String>)
:The key to use as the starting point for the list of tags. If this parameter is set,
ListTagsForStream
gets all tags that occur afterExclusiveStartTagKey
.limit(i32)
/set_limit(Option<i32>)
:The number of tags to return. If this number is less than the total number of tags associated with the stream,
HasMoreTags
is set totrue
. To list additional tags, setExclusiveStartTagKey
to the last key in the response.stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the stream.
- On success, responds with
ListTagsForStreamOutput
with field(s):tags(Option<Vec<Tag>>)
:A list of tags associated with
StreamName
, starting with the first tag afterExclusiveStartTagKey
and up to the specifiedLimit
.has_more_tags(Option<bool>)
:If set to
true
, more tags are available. To request additional tags, setExclusiveStartTagKey
to the key of the last tag returned.
- On failure, responds with
SdkError<ListTagsForStreamError>
sourcepub fn merge_shards(&self) -> MergeShards
pub fn merge_shards(&self) -> MergeShards
Constructs a fluent builder for the MergeShards
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:The name of the stream for the merge.
shard_to_merge(impl Into<String>)
/set_shard_to_merge(Option<String>)
:The shard ID of the shard to combine with the adjacent shard for the merge.
adjacent_shard_to_merge(impl Into<String>)
/set_adjacent_shard_to_merge(Option<String>)
:The shard ID of the adjacent shard for the merge.
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the stream.
- On success, responds with
MergeShardsOutput
- On failure, responds with
SdkError<MergeShardsError>
sourcepub fn put_record(&self) -> PutRecord
pub fn put_record(&self) -> PutRecord
Constructs a fluent builder for the PutRecord
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:The name of the stream to put the data record into.
data(Blob)
/set_data(Option<Blob>)
:The data blob to put into the record, which is base64-encoded when the blob is serialized. When the data blob (the payload before base64-encoding) is added to the partition key size, the total size must not exceed the maximum record size (1 MiB).
partition_key(impl Into<String>)
/set_partition_key(Option<String>)
:Determines which shard in the stream the data record is assigned to. Partition keys are Unicode strings with a maximum length limit of 256 characters for each key. Amazon Kinesis Data Streams uses the partition key as input to a hash function that maps the partition key and associated data to a specific shard. Specifically, an MD5 hash function is used to map partition keys to 128-bit integer values and to map associated data records to shards. As a result of this hashing mechanism, all data records with the same partition key map to the same shard within the stream.
explicit_hash_key(impl Into<String>)
/set_explicit_hash_key(Option<String>)
:The hash value used to explicitly determine the shard the data record is assigned to by overriding the partition key hash.
sequence_number_for_ordering(impl Into<String>)
/set_sequence_number_for_ordering(Option<String>)
:Guarantees strictly increasing sequence numbers, for puts from the same client and to the same partition key. Usage: set the
SequenceNumberForOrdering
of record n to the sequence number of record n-1 (as returned in the result when putting record n-1). If this parameter is not set, records are coarsely ordered based on arrival time.stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the stream.
- On success, responds with
PutRecordOutput
with field(s):shard_id(Option<String>)
:The shard ID of the shard where the data record was placed.
sequence_number(Option<String>)
:The sequence number identifier that was assigned to the put data record. The sequence number for the record is unique across all records in the stream. A sequence number is the identifier associated with every record put into the stream.
encryption_type(Option<EncryptionType>)
:The encryption type to use on the record. This parameter can be one of the following values:
-
NONE
: Do not encrypt the records in the stream. -
KMS
: Use server-side encryption on the records in the stream using a customer-managed Amazon Web Services KMS key.
-
- On failure, responds with
SdkError<PutRecordError>
sourcepub fn put_records(&self) -> PutRecords
pub fn put_records(&self) -> PutRecords
Constructs a fluent builder for the PutRecords
operation.
- The fluent builder is configurable:
records(Vec<PutRecordsRequestEntry>)
/set_records(Option<Vec<PutRecordsRequestEntry>>)
:The records associated with the request.
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:The stream name associated with the request.
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the stream.
- On success, responds with
PutRecordsOutput
with field(s):failed_record_count(Option<i32>)
:The number of unsuccessfully processed records in a
PutRecords
request.records(Option<Vec<PutRecordsResultEntry>>)
:An array of successfully and unsuccessfully processed record results. A record that is successfully added to a stream includes
SequenceNumber
andShardId
in the result. A record that fails to be added to a stream includesErrorCode
andErrorMessage
in the result.encryption_type(Option<EncryptionType>)
:The encryption type used on the records. This parameter can be one of the following values:
-
NONE
: Do not encrypt the records. -
KMS
: Use server-side encryption on the records using a customer-managed Amazon Web Services KMS key.
-
- On failure, responds with
SdkError<PutRecordsError>
sourcepub fn register_stream_consumer(&self) -> RegisterStreamConsumer
pub fn register_stream_consumer(&self) -> RegisterStreamConsumer
Constructs a fluent builder for the RegisterStreamConsumer
operation.
- The fluent builder is configurable:
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the Kinesis data stream that you want to register the consumer with. For more info, see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces.
consumer_name(impl Into<String>)
/set_consumer_name(Option<String>)
:For a given Kinesis data stream, each consumer must have a unique name. However, consumer names don’t have to be unique across data streams.
- On success, responds with
RegisterStreamConsumerOutput
with field(s):consumer(Option<Consumer>)
:An object that represents the details of the consumer you registered. When you register a consumer, it gets an ARN that is generated by Kinesis Data Streams.
- On failure, responds with
SdkError<RegisterStreamConsumerError>
Constructs a fluent builder for the RemoveTagsFromStream
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:The name of the stream.
tag_keys(Vec<String>)
/set_tag_keys(Option<Vec<String>>)
:A list of tag keys. Each corresponding tag is removed from the stream.
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the stream.
- On success, responds with
RemoveTagsFromStreamOutput
- On failure, responds with
SdkError<RemoveTagsFromStreamError>
sourcepub fn split_shard(&self) -> SplitShard
pub fn split_shard(&self) -> SplitShard
Constructs a fluent builder for the SplitShard
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:The name of the stream for the shard split.
shard_to_split(impl Into<String>)
/set_shard_to_split(Option<String>)
:The shard ID of the shard to split.
new_starting_hash_key(impl Into<String>)
/set_new_starting_hash_key(Option<String>)
:A hash key value for the starting hash key of one of the child shards created by the split. The hash key range for a given shard constitutes a set of ordered contiguous positive integers. The value for
NewStartingHashKey
must be in the range of hash keys being mapped into the shard. TheNewStartingHashKey
hash key value and all higher hash key values in hash key range are distributed to one of the child shards. All the lower hash key values in the range are distributed to the other child shard.stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the stream.
- On success, responds with
SplitShardOutput
- On failure, responds with
SdkError<SplitShardError>
sourcepub fn start_stream_encryption(&self) -> StartStreamEncryption
pub fn start_stream_encryption(&self) -> StartStreamEncryption
Constructs a fluent builder for the StartStreamEncryption
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:The name of the stream for which to start encrypting records.
encryption_type(EncryptionType)
/set_encryption_type(Option<EncryptionType>)
:The encryption type to use. The only valid value is
KMS
.key_id(impl Into<String>)
/set_key_id(Option<String>)
:The GUID for the customer-managed Amazon Web Services KMS key to use for encryption. This value can be a globally unique identifier, a fully specified Amazon Resource Name (ARN) to either an alias or a key, or an alias name prefixed by “alias/”.You can also use a master key owned by Kinesis Data Streams by specifying the alias
aws/kinesis
.-
Key ARN example:
arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
-
Alias ARN example:
arn:aws:kms:us-east-1:123456789012:alias/MyAliasName
-
Globally unique key ID example:
12345678-1234-1234-1234-123456789012
-
Alias name example:
alias/MyAliasName
-
Master key owned by Kinesis Data Streams:
alias/aws/kinesis
-
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the stream.
- On success, responds with
StartStreamEncryptionOutput
- On failure, responds with
SdkError<StartStreamEncryptionError>
sourcepub fn stop_stream_encryption(&self) -> StopStreamEncryption
pub fn stop_stream_encryption(&self) -> StopStreamEncryption
Constructs a fluent builder for the StopStreamEncryption
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:The name of the stream on which to stop encrypting records.
encryption_type(EncryptionType)
/set_encryption_type(Option<EncryptionType>)
:The encryption type. The only valid value is
KMS
.key_id(impl Into<String>)
/set_key_id(Option<String>)
:The GUID for the customer-managed Amazon Web Services KMS key to use for encryption. This value can be a globally unique identifier, a fully specified Amazon Resource Name (ARN) to either an alias or a key, or an alias name prefixed by “alias/”.You can also use a master key owned by Kinesis Data Streams by specifying the alias
aws/kinesis
.-
Key ARN example:
arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012
-
Alias ARN example:
arn:aws:kms:us-east-1:123456789012:alias/MyAliasName
-
Globally unique key ID example:
12345678-1234-1234-1234-123456789012
-
Alias name example:
alias/MyAliasName
-
Master key owned by Kinesis Data Streams:
alias/aws/kinesis
-
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the stream.
- On success, responds with
StopStreamEncryptionOutput
- On failure, responds with
SdkError<StopStreamEncryptionError>
sourcepub fn update_shard_count(&self) -> UpdateShardCount
pub fn update_shard_count(&self) -> UpdateShardCount
Constructs a fluent builder for the UpdateShardCount
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:The name of the stream.
target_shard_count(i32)
/set_target_shard_count(Option<i32>)
:The new number of shards. This value has the following default limits. By default, you cannot do the following:
-
Set this value to more than double your current shard count for a stream.
-
Set this value below half your current shard count for a stream.
-
Set this value to more than 10000 shards in a stream (the default limit for shard count per stream is 10000 per account per region), unless you request a limit increase.
-
Scale a stream with more than 10000 shards down unless you set this value to less than 10000 shards.
-
scaling_type(ScalingType)
/set_scaling_type(Option<ScalingType>)
:The scaling type. Uniform scaling creates shards of equal size.
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:The ARN of the stream.
- On success, responds with
UpdateShardCountOutput
with field(s):stream_name(Option<String>)
:The name of the stream.
current_shard_count(Option<i32>)
:The current number of shards.
target_shard_count(Option<i32>)
:The updated number of shards.
stream_arn(Option<String>)
:The ARN of the stream.
- On failure, responds with
SdkError<UpdateShardCountError>
sourcepub fn update_stream_mode(&self) -> UpdateStreamMode
pub fn update_stream_mode(&self) -> UpdateStreamMode
Constructs a fluent builder for the UpdateStreamMode
operation.
- The fluent builder is configurable:
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:Specifies the ARN of the data stream whose capacity mode you want to update.
stream_mode_details(StreamModeDetails)
/set_stream_mode_details(Option<StreamModeDetails>)
:Specifies the capacity mode to which you want to set your data stream. Currently, in Kinesis Data Streams, you can choose between an on-demand capacity mode and a provisioned capacity mode for your data streams.
- On success, responds with
UpdateStreamModeOutput
- On failure, responds with
SdkError<UpdateStreamModeError>
source§impl Client
impl Client
sourcepub fn new(sdk_config: &SdkConfig) -> Self
pub fn new(sdk_config: &SdkConfig) -> Self
Creates a new client from an SDK Config.
Panics
- This method will panic if the
sdk_config
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
sdk_config
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it.
sourcepub fn from_conf(conf: Config) -> Self
pub fn from_conf(conf: Config) -> Self
Creates a new client from the service Config
.
Panics
- This method will panic if the
conf
is missing an async sleep implementation. If you experience this panic, set thesleep_impl
on the Config passed into this function to fix it. - This method will panic if the
conf
is missing an HTTP connector. If you experience this panic, set thehttp_connector
on the Config passed into this function to fix it.