Transfer acceleration improves the speed of accessing OSS for users across the globe. This feature is suitable for scenarios such as long-distance data transmission and uploading or downloading large files that are gigabytes or terabytes in size.
Precautions
The sample code in this topic uses the China (Hangzhou) region ID (
cn-hangzhou) and a public endpoint. If you want to access OSS from other Alibaba Cloud services in the same region, use an internal endpoint. For more information about OSS regions and their corresponding endpoints, see OSS regions and endpoints.
Method definitions
Enable transfer acceleration
put_bucket_transfer_acceleration(request: PutBucketTransferAccelerationRequest, **kwargs) → PutBucketTransferAccelerationResultQuery the transfer acceleration status
get_bucket_transfer_acceleration(request: GetBucketTransferAccelerationRequest, **kwargs) → GetBucketTransferAccelerationResultRequest parameters
Parameter | Type | Description |
request | PutBucketTransferAccelerationRequest | The request parameters. For more information, see PutBucketTransferAccelerationRequest. |
GetBucketTransferAccelerationRequest | The request parameters. For more information, see GetBucketTransferAccelerationRequest. |
Return values
Type | Description |
PutBucketTransferAccelerationResult | The return value. For more information, see PutBucketTransferAccelerationResult. |
GetBucketTransferAccelerationResult | The return value. For more information, see GetBucketTransferAccelerationResult. |
For more information about the method to enable transfer acceleration, see put_bucket_transfer_acceleration.
For more information about the method to query the transfer acceleration status, see get_bucket_transfer_acceleration.
Sample code
References
For the complete sample code to enable transfer acceleration, see put_bucket_transfer_acceleration.py.
For the complete sample code to query the transfer acceleration status, see get_bucket_transfer_acceleration.py.