Modifies the following configuration parameters of the Amazon S3 transfer location that you're using with DataSync.
Before you begin, make sure that you read the following topics:
Parameters:
-
location_arn
(LocationArn)
–
Specifies the Amazon Resource Name (ARN) of the Amazon S3 transfer location that you're updating.
-
subdirectory
(Optional[S3Subdirectory], default:
None
)
–
Specifies a prefix in the S3 bucket that DataSync reads from or writes to (depending on whether the bucket is a source or destination location).
DataSync can't transfer objects with a prefix that begins with a slash (/) or includes //, /./, or /../ patterns. For example:
-
/photos
-
photos//2006/January
-
photos/./2006/February
-
photos/../2006/March
-
s3_storage_class
(Optional[S3StorageClass], default:
None
)
–
Specifies the storage class that you want your objects to use when Amazon S3 is a transfer destination.
For buckets in Amazon Web Services Regions, the storage class defaults to STANDARD. For buckets on Outposts, the storage class defaults to OUTPOSTS.
For more information, see Storage class considerations with Amazon S3 transfers.
Raises:
Source code in docs_src/capo_datasync/_services/data_sync.py
| def update_location_s3(
self,
location_arn: "capo_datasync.types.location_arn.LocationArn",
*,
config_overrides: Optional[DataSyncClientConfig] = None,
subdirectory: Optional[
"capo_datasync.types.s3_subdirectory.S3Subdirectory"
] = None,
s3_storage_class: Optional[
"capo_datasync.types.s3_storage_class.S3StorageClass"
] = None,
s3_config: Optional["capo_datasync.types.s3_config.S3Config"] = None,
) -> "capo_datasync.types.update_location_s3_response.UpdateLocationS3Response":
"""<p>Modifies the following configuration parameters of the Amazon S3 transfer location that you're using with DataSync.</p> <important> <p>Before you begin, make sure that you read the following topics:</p> <ul> <li> <p> <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#using-storage-classes">Storage class considerations with Amazon S3 locations</a> </p> </li> <li> <p> <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#create-s3-location-s3-requests">Evaluating S3 request costs when using DataSync</a> </p> </li> </ul> </important>
Args:
location_arn: <p>Specifies the Amazon Resource Name (ARN) of the Amazon S3 transfer location that you're updating.</p>
subdirectory: <p>Specifies a prefix in the S3 bucket that DataSync reads from or writes to (depending on whether the bucket is a source or destination location).</p> <note> <p>DataSync can't transfer objects with a prefix that begins with a slash (<code>/</code>) or includes <code>//</code>, <code>/./</code>, or <code>/../</code> patterns. For example:</p> <ul> <li> <p> <code>/photos</code> </p> </li> <li> <p> <code>photos//2006/January</code> </p> </li> <li> <p> <code>photos/./2006/February</code> </p> </li> <li> <p> <code>photos/../2006/March</code> </p> </li> </ul> </note>
s3_storage_class: <p>Specifies the storage class that you want your objects to use when Amazon S3 is a transfer destination.</p> <p>For buckets in Amazon Web Services Regions, the storage class defaults to <code>STANDARD</code>. For buckets on Outposts, the storage class defaults to <code>OUTPOSTS</code>.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-s3-location.html#using-storage-classes">Storage class considerations with Amazon S3 transfers</a>.</p>
Raises:
capo_datasync.errors.internal_exception.InternalException: <p>This exception is thrown when an error occurs in the DataSync service.</p>
capo_datasync.errors.invalid_request_exception.InvalidRequestException: <p>This exception is thrown when the client submits a malformed request.</p>
capo_datasync.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_datasync.types.update_location_s3_request.UpdateLocationS3Request]",
) -> OperationResponse[
"capo_datasync.types.update_location_s3_response.UpdateLocationS3Response"
]:
import capo_datasync._operations.fmrs_service.update_location_s3
output, http_response = (
capo_datasync._operations.fmrs_service.update_location_s3.update_location_s3(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateLocationS3")
)
input_: capo_datasync.types.update_location_s3_request.UpdateLocationS3Request = {
"location_arn": location_arn
}
if subdirectory is not None:
input_["subdirectory"] = subdirectory
if s3_storage_class is not None:
input_["s3_storage_class"] = s3_storage_class
if s3_config is not None:
input_["s3_config"] = s3_config
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|