updateStreamWarmThroughput method
Updates the warm throughput configuration for the specified Amazon Kinesis
Data Streams on-demand data stream. This operation allows you to
proactively scale your on-demand data stream to a specified throughput
level, enabling better performance for sudden traffic spikes.
Updating the warm throughput is an asynchronous operation. Upon receiving
the request, Kinesis Data Streams returns immediately and sets the status
of the stream to UPDATING. After the update is complete,
Kinesis Data Streams sets the status of the stream back to
ACTIVE. Depending on the size of the stream, the scaling
action could take a few minutes to complete. You can continue to read and
write data to your stream while its status is UPDATING.
This operation is only supported for data streams with the on-demand
capacity mode in accounts that have
MinimumThroughputBillingCommitment enabled. Provisioned
capacity mode streams do not support warm throughput configuration.
This operation has the following default limits. By default, you cannot do the following:
- Scale to more than 10 GiBps for an on-demand stream.
-
This API has a call limit of 5 transactions per second (TPS) for each
Amazon Web Services account. TPS over 5 will initiate the
LimitExceededException.
May throw AccessDeniedException.
May throw InvalidArgumentException.
May throw LimitExceededException.
May throw ResourceInUseException.
May throw ResourceNotFoundException.
May throw ValidationException.
Parameter warmThroughputMiBps :
The target warm throughput in MB/s that the stream should be scaled to
handle. This represents the throughput capacity that will be immediately
available for write operations.
Parameter streamARN :
The ARN of the stream to be updated.
Parameter streamId :
Not Implemented. Reserved for future use.
Parameter streamName :
The name of the stream to be updated.
Implementation
Future<UpdateStreamWarmThroughputOutput> updateStreamWarmThroughput({
required int warmThroughputMiBps,
String? streamARN,
String? streamId,
String? streamName,
}) async {
_s.validateNumRange(
'warmThroughputMiBps',
warmThroughputMiBps,
0,
1152921504606846976,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'Kinesis_20131202.UpdateStreamWarmThroughput'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'WarmThroughputMiBps': warmThroughputMiBps,
if (streamARN != null) 'StreamARN': streamARN,
if (streamId != null) 'StreamId': streamId,
if (streamName != null) 'StreamName': streamName,
},
);
return UpdateStreamWarmThroughputOutput.fromJson(jsonResponse.body);
}