putBucketIntelligentTieringConfiguration method
The S3 Intelligent-Tiering storage class is designed to optimize storage costs by automatically moving data to the most cost-effective storage access tier, without performance impact or operational overhead. S3 Intelligent-Tiering delivers automatic cost savings in three low latency and high throughput access tiers. To get the lowest storage cost on data that can be accessed in minutes to hours, you can choose to activate additional archiving capabilities.
The S3 Intelligent-Tiering storage class is the ideal storage class for data with unknown, changing, or unpredictable access patterns, independent of object size or retention period. If the size of an object is less than 128 KB, it is not monitored and not eligible for auto-tiering. Smaller objects can be stored, but they are always charged at the Frequent Access tier rates in the S3 Intelligent-Tiering storage class.
For more information, see Storage class for automatically optimizing frequently and infrequently accessed objects.
Operations related to
PutBucketIntelligentTieringConfiguration include:
- DeleteBucketIntelligentTieringConfiguration
- GetBucketIntelligentTieringConfiguration
- ListBucketIntelligentTieringConfigurations
PutBucketIntelligentTieringConfiguration has the following
special errors:
- HTTP 400 Bad Request Error
-
Code: InvalidArgument
Cause: Invalid Argument
- HTTP 400 Bad Request Error
-
Code: TooManyConfigurations
Cause: You are attempting to create a new configuration but have already reached the 1,000-configuration limit.
- HTTP 403 Forbidden Error
-
Cause: You are not the owner of the specified bucket, or you do not
have the
s3:PutIntelligentTieringConfigurationbucket permission to set the configuration on the bucket.
Parameter bucket :
The name of the Amazon S3 bucket whose configuration you want to modify or
retrieve.
Parameter id :
The ID used to identify the S3 Intelligent-Tiering configuration.
Parameter intelligentTieringConfiguration :
Container for S3 Intelligent-Tiering configuration.
Parameter expectedBucketOwner :
The account ID of the expected bucket owner. If the account ID that you
provide does not match the actual owner of the bucket, the request fails
with the HTTP status code 403 Forbidden (access denied).
Implementation
Future<void> putBucketIntelligentTieringConfiguration({
required String bucket,
required String id,
required IntelligentTieringConfiguration intelligentTieringConfiguration,
String? expectedBucketOwner,
}) async {
final headers = <String, String>{
if (expectedBucketOwner != null)
'x-amz-expected-bucket-owner': expectedBucketOwner.toString(),
};
final $query = <String, List<String>>{
'id': [id],
};
await _protocol.send(
method: 'PUT',
requestUri: '/${Uri.encodeComponent(bucket)}?intelligent-tiering',
queryParams: $query,
headers: headers,
payload: intelligentTieringConfiguration
.toXml('IntelligentTieringConfiguration'),
exceptionFnMap: _exceptionFns,
);
}