Struct aws_sdk_kinesis::client::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.
§Constructing a Client
A Config
is required to construct a client. For most use cases, the aws-config
crate should be used to automatically resolve this config using
aws_config::load_from_env()
, since this will resolve an SdkConfig
which can be shared
across multiple different AWS SDK clients. This config resolution process can be customized
by calling aws_config::from_env()
instead, which returns a ConfigLoader
that uses
the builder pattern to customize the default config.
In the simplest case, creating a client looks as follows:
let config = aws_config::load_from_env().await;
let client = aws_sdk_kinesis::Client::new(&config);
Occasionally, SDKs may have additional service-specific values that can be set on the Config
that
is absent from SdkConfig
, or slightly different settings for a specific client may be desired.
The Config
struct implements From<&SdkConfig>
, so setting these specific settings can be
done as follows:
let sdk_config = ::aws_config::load_from_env().await;
let config = aws_sdk_kinesis::config::Builder::from(&sdk_config)
.some_service_specific_setting("value")
.build();
See the aws-config
docs and Config
for more information on customizing configuration.
Note: Client construction is expensive due to connection thread pool initialization, and should be done once at application start-up.
§Using the Client
A client has a function for every operation that can be performed by the service.
For example, the AddTagsToStream
operation has
a Client::add_tags_to_stream
, function which returns a builder for that operation.
The fluent builder ultimately has a send()
function that returns an async future that
returns a result, as illustrated below:
let result = client.add_tags_to_stream()
.stream_name("example")
.send()
.await;
The underlying HTTP requests that get made by this can be modified with the customize_operation
function on the fluent builder. See the customize
module for more
information.
Implementations§
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>)
:
required: falseThe name of the stream.
tags(impl Into<String>, impl Into<String>)
/set_tags(Option<HashMap::<String, String>>)
:
required: trueA set of up to 10 key-value pairs to use to create the tags.
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:
required: falseThe ARN of the stream.
- On success, responds with
AddTagsToStreamOutput
- On failure, responds with
SdkError<AddTagsToStreamError>
source§impl Client
impl Client
sourcepub fn create_stream(&self) -> CreateStreamFluentBuilder
pub fn create_stream(&self) -> CreateStreamFluentBuilder
Constructs a fluent builder for the CreateStream
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:
required: trueA 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>)
:
required: falseThe 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>)
:
required: falseIndicates 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>
source§impl Client
impl Client
sourcepub fn decrease_stream_retention_period(
&self
) -> DecreaseStreamRetentionPeriodFluentBuilder
pub fn decrease_stream_retention_period( &self ) -> DecreaseStreamRetentionPeriodFluentBuilder
Constructs a fluent builder for the DecreaseStreamRetentionPeriod
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:
required: falseThe name of the stream to modify.
retention_period_hours(i32)
/set_retention_period_hours(Option<i32>)
:
required: trueThe 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>)
:
required: falseThe ARN of the stream.
- On success, responds with
DecreaseStreamRetentionPeriodOutput
- On failure, responds with
SdkError<DecreaseStreamRetentionPeriodError>
source§impl Client
impl Client
sourcepub fn delete_resource_policy(&self) -> DeleteResourcePolicyFluentBuilder
pub fn delete_resource_policy(&self) -> DeleteResourcePolicyFluentBuilder
Constructs a fluent builder for the DeleteResourcePolicy
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the data stream or consumer.
- On success, responds with
DeleteResourcePolicyOutput
- On failure, responds with
SdkError<DeleteResourcePolicyError>
source§impl Client
impl Client
sourcepub fn delete_stream(&self) -> DeleteStreamFluentBuilder
pub fn delete_stream(&self) -> DeleteStreamFluentBuilder
Constructs a fluent builder for the DeleteStream
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:
required: falseThe name of the stream to delete.
enforce_consumer_deletion(bool)
/set_enforce_consumer_deletion(Option<bool>)
:
required: falseIf 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>)
:
required: falseThe ARN of the stream.
- On success, responds with
DeleteStreamOutput
- On failure, responds with
SdkError<DeleteStreamError>
source§impl Client
impl Client
sourcepub fn deregister_stream_consumer(
&self
) -> DeregisterStreamConsumerFluentBuilder
pub fn deregister_stream_consumer( &self ) -> DeregisterStreamConsumerFluentBuilder
Constructs a fluent builder for the DeregisterStreamConsumer
operation.
- The fluent builder is configurable:
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:
required: falseThe 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>)
:
required: falseThe name that you gave to the consumer.
consumer_arn(impl Into<String>)
/set_consumer_arn(Option<String>)
:
required: falseThe 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>
source§impl Client
impl Client
sourcepub fn describe_limits(&self) -> DescribeLimitsFluentBuilder
pub fn describe_limits(&self) -> DescribeLimitsFluentBuilder
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(i32)
:The maximum number of shards.
open_shard_count(i32)
:The number of open shards.
on_demand_stream_count(i32)
:Indicates the number of data streams with the on-demand capacity mode.
on_demand_stream_count_limit(i32)
:The maximum number of data streams with the on-demand capacity mode.
- On failure, responds with
SdkError<DescribeLimitsError>
source§impl Client
impl Client
sourcepub fn describe_stream(&self) -> DescribeStreamFluentBuilder
pub fn describe_stream(&self) -> DescribeStreamFluentBuilder
Constructs a fluent builder for the DescribeStream
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:
required: falseThe name of the stream to describe.
limit(i32)
/set_limit(Option<i32>)
:
required: falseThe 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>)
:
required: falseThe 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>)
:
required: falseThe 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>
source§impl Client
impl Client
sourcepub fn describe_stream_consumer(&self) -> DescribeStreamConsumerFluentBuilder
pub fn describe_stream_consumer(&self) -> DescribeStreamConsumerFluentBuilder
Constructs a fluent builder for the DescribeStreamConsumer
operation.
- The fluent builder is configurable:
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:
required: falseThe 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>)
:
required: falseThe name that you gave to the consumer.
consumer_arn(impl Into<String>)
/set_consumer_arn(Option<String>)
:
required: falseThe 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>
source§impl Client
impl Client
sourcepub fn describe_stream_summary(&self) -> DescribeStreamSummaryFluentBuilder
pub fn describe_stream_summary(&self) -> DescribeStreamSummaryFluentBuilder
Constructs a fluent builder for the DescribeStreamSummary
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:
required: falseThe name of the stream to describe.
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:
required: falseThe 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>
source§impl Client
impl Client
sourcepub fn disable_enhanced_monitoring(
&self
) -> DisableEnhancedMonitoringFluentBuilder
pub fn disable_enhanced_monitoring( &self ) -> DisableEnhancedMonitoringFluentBuilder
Constructs a fluent builder for the DisableEnhancedMonitoring
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:
required: falseThe name of the Kinesis data stream for which to disable enhanced monitoring.
shard_level_metrics(MetricsName)
/set_shard_level_metrics(Option<Vec::<MetricsName>>)
:
required: trueList 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>)
:
required: falseThe 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>
source§impl Client
impl Client
sourcepub fn enable_enhanced_monitoring(
&self
) -> EnableEnhancedMonitoringFluentBuilder
pub fn enable_enhanced_monitoring( &self ) -> EnableEnhancedMonitoringFluentBuilder
Constructs a fluent builder for the EnableEnhancedMonitoring
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:
required: falseThe name of the stream for which to enable enhanced monitoring.
shard_level_metrics(MetricsName)
/set_shard_level_metrics(Option<Vec::<MetricsName>>)
:
required: trueList 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>)
:
required: falseThe 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>
source§impl Client
impl Client
sourcepub fn get_records(&self) -> GetRecordsFluentBuilder
pub fn get_records(&self) -> GetRecordsFluentBuilder
Constructs a fluent builder for the GetRecords
operation.
- The fluent builder is configurable:
shard_iterator(impl Into<String>)
/set_shard_iterator(Option<String>)
:
required: trueThe 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>)
:
required: falseThe 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>)
:
required: falseThe ARN of the stream.
- On success, responds with
GetRecordsOutput
with field(s):records(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>
source§impl Client
impl Client
sourcepub fn get_resource_policy(&self) -> GetResourcePolicyFluentBuilder
pub fn get_resource_policy(&self) -> GetResourcePolicyFluentBuilder
Constructs a fluent builder for the GetResourcePolicy
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the data stream or consumer.
- On success, responds with
GetResourcePolicyOutput
with field(s):policy(String)
:Details of the resource policy. This is formatted as a JSON string.
- On failure, responds with
SdkError<GetResourcePolicyError>
source§impl Client
impl Client
sourcepub fn get_shard_iterator(&self) -> GetShardIteratorFluentBuilder
pub fn get_shard_iterator(&self) -> GetShardIteratorFluentBuilder
Constructs a fluent builder for the GetShardIterator
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:
required: falseThe name of the Amazon Kinesis data stream.
shard_id(impl Into<String>)
/set_shard_id(Option<String>)
:
required: trueThe shard ID of the Kinesis Data Streams shard to get the iterator for.
shard_iterator_type(ShardIteratorType)
/set_shard_iterator_type(Option<ShardIteratorType>)
:
required: trueDetermines 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>)
:
required: falseThe 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>)
:
required: falseThe 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>)
:
required: falseThe 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>
source§impl Client
impl Client
sourcepub fn increase_stream_retention_period(
&self
) -> IncreaseStreamRetentionPeriodFluentBuilder
pub fn increase_stream_retention_period( &self ) -> IncreaseStreamRetentionPeriodFluentBuilder
Constructs a fluent builder for the IncreaseStreamRetentionPeriod
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:
required: falseThe name of the stream to modify.
retention_period_hours(i32)
/set_retention_period_hours(Option<i32>)
:
required: trueThe 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>)
:
required: falseThe ARN of the stream.
- On success, responds with
IncreaseStreamRetentionPeriodOutput
- On failure, responds with
SdkError<IncreaseStreamRetentionPeriodError>
source§impl Client
impl Client
sourcepub fn list_shards(&self) -> ListShardsFluentBuilder
pub fn list_shards(&self) -> ListShardsFluentBuilder
Constructs a fluent builder for the ListShards
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:
required: falseThe 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>)
:
required: falseWhen 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>)
:
required: falseSpecify 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>)
:
required: falseThe 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>)
:
required: falseSpecify 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>)
:
required: falseEnables 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>)
:
required: falseThe 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>
source§impl Client
impl Client
sourcepub fn list_stream_consumers(&self) -> ListStreamConsumersFluentBuilder
pub fn list_stream_consumers(&self) -> ListStreamConsumersFluentBuilder
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>)
:
required: trueThe 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>)
:
required: falseWhen 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>)
:
required: falseThe 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>)
:
required: falseSpecify 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>
source§impl Client
impl Client
sourcepub fn list_streams(&self) -> ListStreamsFluentBuilder
pub fn list_streams(&self) -> ListStreamsFluentBuilder
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>)
:
required: falseThe 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>)
:
required: falseThe name of the stream to start the list with.
next_token(impl Into<String>)
/set_next_token(Option<String>)
:
required: false
- On success, responds with
ListStreamsOutput
with field(s):stream_names(Vec::<String>)
:The names of the streams that are associated with the Amazon Web Services account making the
ListStreams
request.has_more_streams(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>
source§impl Client
impl Client
Constructs a fluent builder for the ListTagsForStream
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:
required: falseThe name of the stream.
exclusive_start_tag_key(impl Into<String>)
/set_exclusive_start_tag_key(Option<String>)
:
required: falseThe 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>)
:
required: falseThe 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>)
:
required: falseThe ARN of the stream.
- On success, responds with
ListTagsForStreamOutput
with field(s):tags(Vec::<Tag>)
:A list of tags associated with
StreamName
, starting with the first tag afterExclusiveStartTagKey
and up to the specifiedLimit
.has_more_tags(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>
source§impl Client
impl Client
sourcepub fn merge_shards(&self) -> MergeShardsFluentBuilder
pub fn merge_shards(&self) -> MergeShardsFluentBuilder
Constructs a fluent builder for the MergeShards
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:
required: falseThe name of the stream for the merge.
shard_to_merge(impl Into<String>)
/set_shard_to_merge(Option<String>)
:
required: trueThe 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>)
:
required: trueThe shard ID of the adjacent shard for the merge.
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:
required: falseThe ARN of the stream.
- On success, responds with
MergeShardsOutput
- On failure, responds with
SdkError<MergeShardsError>
source§impl Client
impl Client
sourcepub fn put_record(&self) -> PutRecordFluentBuilder
pub fn put_record(&self) -> PutRecordFluentBuilder
Constructs a fluent builder for the PutRecord
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:
required: falseThe name of the stream to put the data record into.
data(Blob)
/set_data(Option<Blob>)
:
required: trueThe 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>)
:
required: trueDetermines 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>)
:
required: falseThe 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>)
:
required: falseGuarantees 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>)
:
required: falseThe ARN of the stream.
- On success, responds with
PutRecordOutput
with field(s):shard_id(String)
:The shard ID of the shard where the data record was placed.
sequence_number(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>
source§impl Client
impl Client
sourcepub fn put_records(&self) -> PutRecordsFluentBuilder
pub fn put_records(&self) -> PutRecordsFluentBuilder
Constructs a fluent builder for the PutRecords
operation.
- The fluent builder is configurable:
records(PutRecordsRequestEntry)
/set_records(Option<Vec::<PutRecordsRequestEntry>>)
:
required: trueThe records associated with the request.
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:
required: falseThe stream name associated with the request.
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:
required: falseThe 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(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>
source§impl Client
impl Client
sourcepub fn put_resource_policy(&self) -> PutResourcePolicyFluentBuilder
pub fn put_resource_policy(&self) -> PutResourcePolicyFluentBuilder
Constructs a fluent builder for the PutResourcePolicy
operation.
- The fluent builder is configurable:
resource_arn(impl Into<String>)
/set_resource_arn(Option<String>)
:
required: trueThe Amazon Resource Name (ARN) of the data stream or consumer.
policy(impl Into<String>)
/set_policy(Option<String>)
:
required: trueDetails of the resource policy. It must include the identity of the principal and the actions allowed on this resource. This is formatted as a JSON string.
- On success, responds with
PutResourcePolicyOutput
- On failure, responds with
SdkError<PutResourcePolicyError>
source§impl Client
impl Client
sourcepub fn register_stream_consumer(&self) -> RegisterStreamConsumerFluentBuilder
pub fn register_stream_consumer(&self) -> RegisterStreamConsumerFluentBuilder
Constructs a fluent builder for the RegisterStreamConsumer
operation.
- The fluent builder is configurable:
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:
required: trueThe 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>)
:
required: trueFor 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>
source§impl Client
impl Client
Constructs a fluent builder for the RemoveTagsFromStream
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:
required: falseThe name of the stream.
tag_keys(impl Into<String>)
/set_tag_keys(Option<Vec::<String>>)
:
required: trueA list of tag keys. Each corresponding tag is removed from the stream.
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:
required: falseThe ARN of the stream.
- On success, responds with
RemoveTagsFromStreamOutput
- On failure, responds with
SdkError<RemoveTagsFromStreamError>
source§impl Client
impl Client
sourcepub fn split_shard(&self) -> SplitShardFluentBuilder
pub fn split_shard(&self) -> SplitShardFluentBuilder
Constructs a fluent builder for the SplitShard
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:
required: falseThe name of the stream for the shard split.
shard_to_split(impl Into<String>)
/set_shard_to_split(Option<String>)
:
required: trueThe shard ID of the shard to split.
new_starting_hash_key(impl Into<String>)
/set_new_starting_hash_key(Option<String>)
:
required: trueA 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>)
:
required: falseThe ARN of the stream.
- On success, responds with
SplitShardOutput
- On failure, responds with
SdkError<SplitShardError>
source§impl Client
impl Client
sourcepub fn start_stream_encryption(&self) -> StartStreamEncryptionFluentBuilder
pub fn start_stream_encryption(&self) -> StartStreamEncryptionFluentBuilder
Constructs a fluent builder for the StartStreamEncryption
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:
required: falseThe name of the stream for which to start encrypting records.
encryption_type(EncryptionType)
/set_encryption_type(Option<EncryptionType>)
:
required: trueThe encryption type to use. The only valid value is
KMS
.key_id(impl Into<String>)
/set_key_id(Option<String>)
:
required: trueThe 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>)
:
required: falseThe ARN of the stream.
- On success, responds with
StartStreamEncryptionOutput
- On failure, responds with
SdkError<StartStreamEncryptionError>
source§impl Client
impl Client
sourcepub fn stop_stream_encryption(&self) -> StopStreamEncryptionFluentBuilder
pub fn stop_stream_encryption(&self) -> StopStreamEncryptionFluentBuilder
Constructs a fluent builder for the StopStreamEncryption
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:
required: falseThe name of the stream on which to stop encrypting records.
encryption_type(EncryptionType)
/set_encryption_type(Option<EncryptionType>)
:
required: trueThe encryption type. The only valid value is
KMS
.key_id(impl Into<String>)
/set_key_id(Option<String>)
:
required: trueThe 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>)
:
required: falseThe ARN of the stream.
- On success, responds with
StopStreamEncryptionOutput
- On failure, responds with
SdkError<StopStreamEncryptionError>
source§impl Client
impl Client
sourcepub fn update_shard_count(&self) -> UpdateShardCountFluentBuilder
pub fn update_shard_count(&self) -> UpdateShardCountFluentBuilder
Constructs a fluent builder for the UpdateShardCount
operation.
- The fluent builder is configurable:
stream_name(impl Into<String>)
/set_stream_name(Option<String>)
:
required: falseThe name of the stream.
target_shard_count(i32)
/set_target_shard_count(Option<i32>)
:
required: trueThe 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>)
:
required: trueThe scaling type. Uniform scaling creates shards of equal size.
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:
required: falseThe 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>
source§impl Client
impl Client
sourcepub fn update_stream_mode(&self) -> UpdateStreamModeFluentBuilder
pub fn update_stream_mode(&self) -> UpdateStreamModeFluentBuilder
Constructs a fluent builder for the UpdateStreamMode
operation.
- The fluent builder is configurable:
stream_arn(impl Into<String>)
/set_stream_arn(Option<String>)
:
required: trueSpecifies the ARN of the data stream whose capacity mode you want to update.
stream_mode_details(StreamModeDetails)
/set_stream_mode_details(Option<StreamModeDetails>)
:
required: trueSpecifies 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 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 in the following cases:
- Retries or timeouts are enabled without a
sleep_impl
configured. - Identity caching is enabled without a
sleep_impl
andtime_source
configured. - No
behavior_version
is provided.
The panic message for each of these will have instructions on how to resolve them.
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. - This method will panic if no
BehaviorVersion
is provided. If you experience this panic, setbehavior_version
on the Config or enable thebehavior-version-latest
Cargo feature.