S3Client#
Auto-generated documentation for S3 type annotations stubs module mypy-boto3-s3.
S3Client#
Type annotations and code completion for boto3.client("s3")
.
boto3 documentation
# S3Client usage example
from boto3.session import Session
from mypy_boto3_s3.client import S3Client
def get_s3_client() -> S3Client:
return Session().client("s3")
Exceptions#
boto3
client exceptions are generated in runtime.
This class provides code completion for boto3.client("s3").exceptions
structure.
# Exceptions.exceptions usage example
client = boto3.client("s3")
try:
do_something(client)
except (
client.exceptions.BucketAlreadyExists,
client.exceptions.BucketAlreadyOwnedByYou,
client.exceptions.ClientError,
client.exceptions.InvalidObjectState,
client.exceptions.NoSuchBucket,
client.exceptions.NoSuchKey,
client.exceptions.NoSuchUpload,
client.exceptions.ObjectAlreadyInActiveTierError,
client.exceptions.ObjectNotInActiveTierError,
) as e:
print(e)
# Exceptions.exceptions type checking example
from mypy_boto3_s3.client import Exceptions
def handle_error(exc: Exceptions.BucketAlreadyExists) -> None:
...
Methods#
abort_multipart_upload#
This action aborts a multipart upload.
Type annotations and code completion for boto3.client("s3").abort_multipart_upload
method.
boto3 documentation
# abort_multipart_upload method definition
def abort_multipart_upload(
self,
*,
Bucket: str,
Key: str,
UploadId: str,
RequestPayer: RequestPayerType = ..., # (1)
ExpectedBucketOwner: str = ...,
) -> AbortMultipartUploadOutputTypeDef: # (2)
...
# abort_multipart_upload method usage example with argument unpacking
kwargs: AbortMultipartUploadRequestRequestTypeDef = { # (1)
"Bucket": ...,
"Key": ...,
"UploadId": ...,
}
parent.abort_multipart_upload(**kwargs)
can_paginate#
Check if an operation can be paginated.
Type annotations and code completion for boto3.client("s3").can_paginate
method.
boto3 documentation
# can_paginate method definition
def can_paginate(
self,
operation_name: str,
) -> bool:
...
close#
Closes underlying endpoint connections.
Type annotations and code completion for boto3.client("s3").close
method.
boto3 documentation
# close method definition
def close(
self,
) -> None:
...
complete_multipart_upload#
Completes a multipart upload by assembling previously uploaded parts.
Type annotations and code completion for boto3.client("s3").complete_multipart_upload
method.
boto3 documentation
# complete_multipart_upload method definition
def complete_multipart_upload(
self,
*,
Bucket: str,
Key: str,
UploadId: str,
MultipartUpload: CompletedMultipartUploadTypeDef = ..., # (1)
ChecksumCRC32: str = ...,
ChecksumCRC32C: str = ...,
ChecksumSHA1: str = ...,
ChecksumSHA256: str = ...,
RequestPayer: RequestPayerType = ..., # (2)
ExpectedBucketOwner: str = ...,
SSECustomerAlgorithm: str = ...,
SSECustomerKey: str = ...,
SSECustomerKeyMD5: str = ...,
) -> CompleteMultipartUploadOutputTypeDef: # (3)
...
# complete_multipart_upload method usage example with argument unpacking
kwargs: CompleteMultipartUploadRequestRequestTypeDef = { # (1)
"Bucket": ...,
"Key": ...,
"UploadId": ...,
}
parent.complete_multipart_upload(**kwargs)
copy#
Copy an object from one S3 location to another.
Type annotations and code completion for boto3.client("s3").copy
method.
boto3 documentation
# copy method definition
def copy(
self,
CopySource: CopySourceTypeDef, # (1)
Bucket: str,
Key: str,
ExtraArgs: Dict[str, Any] = ...,
Callback: Callable[..., Any] = ...,
SourceClient: BaseClient = ...,
Config: TransferConfig = ...,
) -> None:
...
# copy method usage example with argument unpacking
kwargs: ClientCopyRequestTypeDef = { # (1)
"CopySource": ...,
"Bucket": ...,
"Key": ...,
}
parent.copy(**kwargs)
copy_object#
Creates a copy of an object that is already stored in Amazon S3.
Type annotations and code completion for boto3.client("s3").copy_object
method.
boto3 documentation
# copy_object method definition
def copy_object(
self,
*,
Bucket: str,
CopySource: Union[str, CopySourceTypeDef], # (1)
Key: str,
ACL: ObjectCannedACLType = ..., # (2)
CacheControl: str = ...,
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (3)
ContentDisposition: str = ...,
ContentEncoding: str = ...,
ContentLanguage: str = ...,
ContentType: str = ...,
CopySourceIfMatch: str = ...,
CopySourceIfModifiedSince: Union[datetime, str] = ...,
CopySourceIfNoneMatch: str = ...,
CopySourceIfUnmodifiedSince: Union[datetime, str] = ...,
Expires: Union[datetime, str] = ...,
GrantFullControl: str = ...,
GrantRead: str = ...,
GrantReadACP: str = ...,
GrantWriteACP: str = ...,
Metadata: Mapping[str, str] = ...,
MetadataDirective: MetadataDirectiveType = ..., # (4)
TaggingDirective: TaggingDirectiveType = ..., # (5)
ServerSideEncryption: ServerSideEncryptionType = ..., # (6)
StorageClass: StorageClassType = ..., # (7)
WebsiteRedirectLocation: str = ...,
SSECustomerAlgorithm: str = ...,
SSECustomerKey: str = ...,
SSECustomerKeyMD5: str = ...,
SSEKMSKeyId: str = ...,
SSEKMSEncryptionContext: str = ...,
BucketKeyEnabled: bool = ...,
CopySourceSSECustomerAlgorithm: str = ...,
CopySourceSSECustomerKey: str = ...,
CopySourceSSECustomerKeyMD5: str = ...,
RequestPayer: RequestPayerType = ..., # (8)
Tagging: str = ...,
ObjectLockMode: ObjectLockModeType = ..., # (9)
ObjectLockRetainUntilDate: Union[datetime, str] = ...,
ObjectLockLegalHoldStatus: ObjectLockLegalHoldStatusType = ..., # (10)
ExpectedBucketOwner: str = ...,
ExpectedSourceBucketOwner: str = ...,
) -> CopyObjectOutputTypeDef: # (11)
...
- See CopySourceTypeDef
- See ObjectCannedACLType
- See ChecksumAlgorithmType
- See MetadataDirectiveType
- See TaggingDirectiveType
- See ServerSideEncryptionType
- See StorageClassType
- See RequestPayerType
- See ObjectLockModeType
- See ObjectLockLegalHoldStatusType
- See CopyObjectOutputTypeDef
# copy_object method usage example with argument unpacking
kwargs: CopyObjectRequestRequestTypeDef = { # (1)
"Bucket": ...,
"CopySource": ...,
"Key": ...,
}
parent.copy_object(**kwargs)
create_bucket#
Creates a new S3 bucket.
Type annotations and code completion for boto3.client("s3").create_bucket
method.
boto3 documentation
# create_bucket method definition
def create_bucket(
self,
*,
Bucket: str,
ACL: BucketCannedACLType = ..., # (1)
CreateBucketConfiguration: CreateBucketConfigurationTypeDef = ..., # (2)
GrantFullControl: str = ...,
GrantRead: str = ...,
GrantReadACP: str = ...,
GrantWrite: str = ...,
GrantWriteACP: str = ...,
ObjectLockEnabledForBucket: bool = ...,
ObjectOwnership: ObjectOwnershipType = ..., # (3)
) -> CreateBucketOutputTypeDef: # (4)
...
- See BucketCannedACLType
- See CreateBucketConfigurationTypeDef
- See ObjectOwnershipType
- See CreateBucketOutputTypeDef
# create_bucket method usage example with argument unpacking
kwargs: CreateBucketRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.create_bucket(**kwargs)
create_multipart_upload#
This action initiates a multipart upload and returns an upload ID.
Type annotations and code completion for boto3.client("s3").create_multipart_upload
method.
boto3 documentation
# create_multipart_upload method definition
def create_multipart_upload(
self,
*,
Bucket: str,
Key: str,
ACL: ObjectCannedACLType = ..., # (1)
CacheControl: str = ...,
ContentDisposition: str = ...,
ContentEncoding: str = ...,
ContentLanguage: str = ...,
ContentType: str = ...,
Expires: Union[datetime, str] = ...,
GrantFullControl: str = ...,
GrantRead: str = ...,
GrantReadACP: str = ...,
GrantWriteACP: str = ...,
Metadata: Mapping[str, str] = ...,
ServerSideEncryption: ServerSideEncryptionType = ..., # (2)
StorageClass: StorageClassType = ..., # (3)
WebsiteRedirectLocation: str = ...,
SSECustomerAlgorithm: str = ...,
SSECustomerKey: str = ...,
SSECustomerKeyMD5: str = ...,
SSEKMSKeyId: str = ...,
SSEKMSEncryptionContext: str = ...,
BucketKeyEnabled: bool = ...,
RequestPayer: RequestPayerType = ..., # (4)
Tagging: str = ...,
ObjectLockMode: ObjectLockModeType = ..., # (5)
ObjectLockRetainUntilDate: Union[datetime, str] = ...,
ObjectLockLegalHoldStatus: ObjectLockLegalHoldStatusType = ..., # (6)
ExpectedBucketOwner: str = ...,
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (7)
) -> CreateMultipartUploadOutputTypeDef: # (8)
...
- See ObjectCannedACLType
- See ServerSideEncryptionType
- See StorageClassType
- See RequestPayerType
- See ObjectLockModeType
- See ObjectLockLegalHoldStatusType
- See ChecksumAlgorithmType
- See CreateMultipartUploadOutputTypeDef
# create_multipart_upload method usage example with argument unpacking
kwargs: CreateMultipartUploadRequestRequestTypeDef = { # (1)
"Bucket": ...,
"Key": ...,
}
parent.create_multipart_upload(**kwargs)
delete_bucket#
Deletes the S3 bucket.
Type annotations and code completion for boto3.client("s3").delete_bucket
method.
boto3 documentation
# delete_bucket method definition
def delete_bucket(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef: # (1)
...
# delete_bucket method usage example with argument unpacking
kwargs: DeleteBucketRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.delete_bucket(**kwargs)
delete_bucket_analytics_configuration#
Deletes an analytics configuration for the bucket (specified by the analytics configuration ID).
Type annotations and code completion for boto3.client("s3").delete_bucket_analytics_configuration
method.
boto3 documentation
# delete_bucket_analytics_configuration method definition
def delete_bucket_analytics_configuration(
self,
*,
Bucket: str,
Id: str,
ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef: # (1)
...
# delete_bucket_analytics_configuration method usage example with argument unpacking
kwargs: DeleteBucketAnalyticsConfigurationRequestRequestTypeDef = { # (1)
"Bucket": ...,
"Id": ...,
}
parent.delete_bucket_analytics_configuration(**kwargs)
delete_bucket_cors#
Deletes the cors
configuration information set for the bucket.
Type annotations and code completion for boto3.client("s3").delete_bucket_cors
method.
boto3 documentation
# delete_bucket_cors method definition
def delete_bucket_cors(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef: # (1)
...
# delete_bucket_cors method usage example with argument unpacking
kwargs: DeleteBucketCorsRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.delete_bucket_cors(**kwargs)
delete_bucket_encryption#
This implementation of the DELETE action resets the default encryption for the bucket as server-side encryption with Amazon S3 managed keys (SSE-S3).
Type annotations and code completion for boto3.client("s3").delete_bucket_encryption
method.
boto3 documentation
# delete_bucket_encryption method definition
def delete_bucket_encryption(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef: # (1)
...
# delete_bucket_encryption method usage example with argument unpacking
kwargs: DeleteBucketEncryptionRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.delete_bucket_encryption(**kwargs)
delete_bucket_intelligent_tiering_configuration#
Deletes the S3 Intelligent-Tiering configuration from the specified bucket.
Type annotations and code completion for boto3.client("s3").delete_bucket_intelligent_tiering_configuration
method.
boto3 documentation
# delete_bucket_intelligent_tiering_configuration method definition
def delete_bucket_intelligent_tiering_configuration(
self,
*,
Bucket: str,
Id: str,
) -> EmptyResponseMetadataTypeDef: # (1)
...
# delete_bucket_intelligent_tiering_configuration method usage example with argument unpacking
kwargs: DeleteBucketIntelligentTieringConfigurationRequestRequestTypeDef = { # (1)
"Bucket": ...,
"Id": ...,
}
parent.delete_bucket_intelligent_tiering_configuration(**kwargs)
delete_bucket_inventory_configuration#
Deletes an inventory configuration (identified by the inventory ID) from the bucket.
Type annotations and code completion for boto3.client("s3").delete_bucket_inventory_configuration
method.
boto3 documentation
# delete_bucket_inventory_configuration method definition
def delete_bucket_inventory_configuration(
self,
*,
Bucket: str,
Id: str,
ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef: # (1)
...
# delete_bucket_inventory_configuration method usage example with argument unpacking
kwargs: DeleteBucketInventoryConfigurationRequestRequestTypeDef = { # (1)
"Bucket": ...,
"Id": ...,
}
parent.delete_bucket_inventory_configuration(**kwargs)
delete_bucket_lifecycle#
Deletes the lifecycle configuration from the specified bucket.
Type annotations and code completion for boto3.client("s3").delete_bucket_lifecycle
method.
boto3 documentation
# delete_bucket_lifecycle method definition
def delete_bucket_lifecycle(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef: # (1)
...
# delete_bucket_lifecycle method usage example with argument unpacking
kwargs: DeleteBucketLifecycleRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.delete_bucket_lifecycle(**kwargs)
delete_bucket_metrics_configuration#
Deletes a metrics configuration for the Amazon CloudWatch request metrics (specified by the metrics configuration ID) from the bucket.
Type annotations and code completion for boto3.client("s3").delete_bucket_metrics_configuration
method.
boto3 documentation
# delete_bucket_metrics_configuration method definition
def delete_bucket_metrics_configuration(
self,
*,
Bucket: str,
Id: str,
ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef: # (1)
...
# delete_bucket_metrics_configuration method usage example with argument unpacking
kwargs: DeleteBucketMetricsConfigurationRequestRequestTypeDef = { # (1)
"Bucket": ...,
"Id": ...,
}
parent.delete_bucket_metrics_configuration(**kwargs)
delete_bucket_ownership_controls#
Removes OwnershipControls
for an Amazon S3 bucket.
Type annotations and code completion for boto3.client("s3").delete_bucket_ownership_controls
method.
boto3 documentation
# delete_bucket_ownership_controls method definition
def delete_bucket_ownership_controls(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef: # (1)
...
# delete_bucket_ownership_controls method usage example with argument unpacking
kwargs: DeleteBucketOwnershipControlsRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.delete_bucket_ownership_controls(**kwargs)
delete_bucket_policy#
This implementation of the DELETE action uses the policy subresource to delete the policy of a specified bucket.
Type annotations and code completion for boto3.client("s3").delete_bucket_policy
method.
boto3 documentation
# delete_bucket_policy method definition
def delete_bucket_policy(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef: # (1)
...
# delete_bucket_policy method usage example with argument unpacking
kwargs: DeleteBucketPolicyRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.delete_bucket_policy(**kwargs)
delete_bucket_replication#
Deletes the replication configuration from the bucket.
Type annotations and code completion for boto3.client("s3").delete_bucket_replication
method.
boto3 documentation
# delete_bucket_replication method definition
def delete_bucket_replication(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef: # (1)
...
# delete_bucket_replication method usage example with argument unpacking
kwargs: DeleteBucketReplicationRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.delete_bucket_replication(**kwargs)
delete_bucket_tagging#
Deletes the tags from the bucket.
Type annotations and code completion for boto3.client("s3").delete_bucket_tagging
method.
boto3 documentation
# delete_bucket_tagging method definition
def delete_bucket_tagging(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef: # (1)
...
# delete_bucket_tagging method usage example with argument unpacking
kwargs: DeleteBucketTaggingRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.delete_bucket_tagging(**kwargs)
delete_bucket_website#
This action removes the website configuration for a bucket.
Type annotations and code completion for boto3.client("s3").delete_bucket_website
method.
boto3 documentation
# delete_bucket_website method definition
def delete_bucket_website(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef: # (1)
...
# delete_bucket_website method usage example with argument unpacking
kwargs: DeleteBucketWebsiteRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.delete_bucket_website(**kwargs)
delete_object#
Removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object.
Type annotations and code completion for boto3.client("s3").delete_object
method.
boto3 documentation
# delete_object method definition
def delete_object(
self,
*,
Bucket: str,
Key: str,
MFA: str = ...,
VersionId: str = ...,
RequestPayer: RequestPayerType = ..., # (1)
BypassGovernanceRetention: bool = ...,
ExpectedBucketOwner: str = ...,
) -> DeleteObjectOutputTypeDef: # (2)
...
# delete_object method usage example with argument unpacking
kwargs: DeleteObjectRequestRequestTypeDef = { # (1)
"Bucket": ...,
"Key": ...,
}
parent.delete_object(**kwargs)
delete_object_tagging#
Removes the entire tag set from the specified object.
Type annotations and code completion for boto3.client("s3").delete_object_tagging
method.
boto3 documentation
# delete_object_tagging method definition
def delete_object_tagging(
self,
*,
Bucket: str,
Key: str,
VersionId: str = ...,
ExpectedBucketOwner: str = ...,
) -> DeleteObjectTaggingOutputTypeDef: # (1)
...
# delete_object_tagging method usage example with argument unpacking
kwargs: DeleteObjectTaggingRequestRequestTypeDef = { # (1)
"Bucket": ...,
"Key": ...,
}
parent.delete_object_tagging(**kwargs)
delete_objects#
This action enables you to delete multiple objects from a bucket using a single HTTP request.
Type annotations and code completion for boto3.client("s3").delete_objects
method.
boto3 documentation
# delete_objects method definition
def delete_objects(
self,
*,
Bucket: str,
Delete: DeleteTypeDef, # (1)
MFA: str = ...,
RequestPayer: RequestPayerType = ..., # (2)
BypassGovernanceRetention: bool = ...,
ExpectedBucketOwner: str = ...,
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (3)
) -> DeleteObjectsOutputTypeDef: # (4)
...
- See DeleteTypeDef
- See RequestPayerType
- See ChecksumAlgorithmType
- See DeleteObjectsOutputTypeDef
# delete_objects method usage example with argument unpacking
kwargs: DeleteObjectsRequestRequestTypeDef = { # (1)
"Bucket": ...,
"Delete": ...,
}
parent.delete_objects(**kwargs)
delete_public_access_block#
Removes the PublicAccessBlock
configuration for an Amazon S3 bucket.
Type annotations and code completion for boto3.client("s3").delete_public_access_block
method.
boto3 documentation
# delete_public_access_block method definition
def delete_public_access_block(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef: # (1)
...
# delete_public_access_block method usage example with argument unpacking
kwargs: DeletePublicAccessBlockRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.delete_public_access_block(**kwargs)
download_file#
Download an S3 object to a file.
Type annotations and code completion for boto3.client("s3").download_file
method.
boto3 documentation
# download_file method definition
def download_file(
self,
Bucket: str,
Key: str,
Filename: str,
ExtraArgs: Dict[str, Any] = ...,
Callback: Callable[..., Any] = ...,
Config: TransferConfig = ...,
) -> None:
...
# download_file method usage example with argument unpacking
kwargs: ClientDownloadFileRequestTypeDef = { # (1)
"Bucket": ...,
"Key": ...,
"Filename": ...,
}
parent.download_file(**kwargs)
download_fileobj#
Download an object from S3 to a file-like object.
Type annotations and code completion for boto3.client("s3").download_fileobj
method.
boto3 documentation
# download_fileobj method definition
def download_fileobj(
self,
Bucket: str,
Key: str,
Fileobj: Union[IO[Any], StreamingBody],
ExtraArgs: Dict[str, Any] = ...,
Callback: Callable[..., Any] = ...,
Config: TransferConfig = ...,
) -> None:
...
# download_fileobj method usage example with argument unpacking
kwargs: ClientDownloadFileobjRequestTypeDef = { # (1)
"Bucket": ...,
"Key": ...,
"Fileobj": ...,
}
parent.download_fileobj(**kwargs)
generate_presigned_post#
Builds the url and the form fields used for a presigned s3 post.
Type annotations and code completion for boto3.client("s3").generate_presigned_post
method.
boto3 documentation
# generate_presigned_post method definition
def generate_presigned_post(
self,
Bucket: str,
Key: str,
Fields: Dict[str, Any] = ...,
Conditions: Union[List[Any], Dict[str, Any]] = ...,
ExpiresIn: int = 3600,
) -> Dict[str, Any]:
...
# generate_presigned_post method usage example with argument unpacking
kwargs: ClientGeneratePresignedPostRequestTypeDef = { # (1)
"Bucket": ...,
"Key": ...,
}
parent.generate_presigned_post(**kwargs)
generate_presigned_url#
Generate a presigned url given a client, its method, and arguments.
Type annotations and code completion for boto3.client("s3").generate_presigned_url
method.
boto3 documentation
# generate_presigned_url method definition
def generate_presigned_url(
self,
ClientMethod: str,
Params: Mapping[str, Any] = ...,
ExpiresIn: int = 3600,
HttpMethod: str = ...,
) -> str:
...
get_bucket_accelerate_configuration#
This implementation of the GET action uses the accelerate
subresource to
return the Transfer Acceleration state of a bucket, which is either Enabled
or
Suspended
.
Type annotations and code completion for boto3.client("s3").get_bucket_accelerate_configuration
method.
boto3 documentation
# get_bucket_accelerate_configuration method definition
def get_bucket_accelerate_configuration(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> GetBucketAccelerateConfigurationOutputTypeDef: # (1)
...
# get_bucket_accelerate_configuration method usage example with argument unpacking
kwargs: GetBucketAccelerateConfigurationRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.get_bucket_accelerate_configuration(**kwargs)
get_bucket_acl#
This implementation of the GET
action uses the acl
subresource to return the
access control list (ACL) of a bucket.
Type annotations and code completion for boto3.client("s3").get_bucket_acl
method.
boto3 documentation
# get_bucket_acl method definition
def get_bucket_acl(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> GetBucketAclOutputTypeDef: # (1)
...
# get_bucket_acl method usage example with argument unpacking
kwargs: GetBucketAclRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.get_bucket_acl(**kwargs)
get_bucket_analytics_configuration#
This implementation of the GET action returns an analytics configuration (identified by the analytics configuration ID) from the bucket.
Type annotations and code completion for boto3.client("s3").get_bucket_analytics_configuration
method.
boto3 documentation
# get_bucket_analytics_configuration method definition
def get_bucket_analytics_configuration(
self,
*,
Bucket: str,
Id: str,
ExpectedBucketOwner: str = ...,
) -> GetBucketAnalyticsConfigurationOutputTypeDef: # (1)
...
# get_bucket_analytics_configuration method usage example with argument unpacking
kwargs: GetBucketAnalyticsConfigurationRequestRequestTypeDef = { # (1)
"Bucket": ...,
"Id": ...,
}
parent.get_bucket_analytics_configuration(**kwargs)
get_bucket_cors#
Returns the Cross-Origin Resource Sharing (CORS) configuration information set for the bucket.
Type annotations and code completion for boto3.client("s3").get_bucket_cors
method.
boto3 documentation
# get_bucket_cors method definition
def get_bucket_cors(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> GetBucketCorsOutputTypeDef: # (1)
...
# get_bucket_cors method usage example with argument unpacking
kwargs: GetBucketCorsRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.get_bucket_cors(**kwargs)
get_bucket_encryption#
Returns the default encryption configuration for an Amazon S3 bucket.
Type annotations and code completion for boto3.client("s3").get_bucket_encryption
method.
boto3 documentation
# get_bucket_encryption method definition
def get_bucket_encryption(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> GetBucketEncryptionOutputTypeDef: # (1)
...
# get_bucket_encryption method usage example with argument unpacking
kwargs: GetBucketEncryptionRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.get_bucket_encryption(**kwargs)
get_bucket_intelligent_tiering_configuration#
Gets the S3 Intelligent-Tiering configuration from the specified bucket.
Type annotations and code completion for boto3.client("s3").get_bucket_intelligent_tiering_configuration
method.
boto3 documentation
# get_bucket_intelligent_tiering_configuration method definition
def get_bucket_intelligent_tiering_configuration(
self,
*,
Bucket: str,
Id: str,
) -> GetBucketIntelligentTieringConfigurationOutputTypeDef: # (1)
...
# get_bucket_intelligent_tiering_configuration method usage example with argument unpacking
kwargs: GetBucketIntelligentTieringConfigurationRequestRequestTypeDef = { # (1)
"Bucket": ...,
"Id": ...,
}
parent.get_bucket_intelligent_tiering_configuration(**kwargs)
get_bucket_inventory_configuration#
Returns an inventory configuration (identified by the inventory configuration ID) from the bucket.
Type annotations and code completion for boto3.client("s3").get_bucket_inventory_configuration
method.
boto3 documentation
# get_bucket_inventory_configuration method definition
def get_bucket_inventory_configuration(
self,
*,
Bucket: str,
Id: str,
ExpectedBucketOwner: str = ...,
) -> GetBucketInventoryConfigurationOutputTypeDef: # (1)
...
# get_bucket_inventory_configuration method usage example with argument unpacking
kwargs: GetBucketInventoryConfigurationRequestRequestTypeDef = { # (1)
"Bucket": ...,
"Id": ...,
}
parent.get_bucket_inventory_configuration(**kwargs)
get_bucket_lifecycle#
.
Type annotations and code completion for boto3.client("s3").get_bucket_lifecycle
method.
boto3 documentation
# get_bucket_lifecycle method definition
def get_bucket_lifecycle(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> GetBucketLifecycleOutputTypeDef: # (1)
...
# get_bucket_lifecycle method usage example with argument unpacking
kwargs: GetBucketLifecycleRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.get_bucket_lifecycle(**kwargs)
get_bucket_lifecycle_configuration#
.
Type annotations and code completion for boto3.client("s3").get_bucket_lifecycle_configuration
method.
boto3 documentation
# get_bucket_lifecycle_configuration method definition
def get_bucket_lifecycle_configuration(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> GetBucketLifecycleConfigurationOutputTypeDef: # (1)
...
# get_bucket_lifecycle_configuration method usage example with argument unpacking
kwargs: GetBucketLifecycleConfigurationRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.get_bucket_lifecycle_configuration(**kwargs)
get_bucket_location#
Returns the Region the bucket resides in.
Type annotations and code completion for boto3.client("s3").get_bucket_location
method.
boto3 documentation
# get_bucket_location method definition
def get_bucket_location(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> GetBucketLocationOutputTypeDef: # (1)
...
# get_bucket_location method usage example with argument unpacking
kwargs: GetBucketLocationRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.get_bucket_location(**kwargs)
get_bucket_logging#
Returns the logging status of a bucket and the permissions users have to view and modify that status.
Type annotations and code completion for boto3.client("s3").get_bucket_logging
method.
boto3 documentation
# get_bucket_logging method definition
def get_bucket_logging(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> GetBucketLoggingOutputTypeDef: # (1)
...
# get_bucket_logging method usage example with argument unpacking
kwargs: GetBucketLoggingRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.get_bucket_logging(**kwargs)
get_bucket_metrics_configuration#
Gets a metrics configuration (specified by the metrics configuration ID) from the bucket.
Type annotations and code completion for boto3.client("s3").get_bucket_metrics_configuration
method.
boto3 documentation
# get_bucket_metrics_configuration method definition
def get_bucket_metrics_configuration(
self,
*,
Bucket: str,
Id: str,
ExpectedBucketOwner: str = ...,
) -> GetBucketMetricsConfigurationOutputTypeDef: # (1)
...
# get_bucket_metrics_configuration method usage example with argument unpacking
kwargs: GetBucketMetricsConfigurationRequestRequestTypeDef = { # (1)
"Bucket": ...,
"Id": ...,
}
parent.get_bucket_metrics_configuration(**kwargs)
get_bucket_notification#
No longer used, see GetBucketNotificationConfiguration_.
Type annotations and code completion for boto3.client("s3").get_bucket_notification
method.
boto3 documentation
# get_bucket_notification method definition
def get_bucket_notification(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> NotificationConfigurationDeprecatedResponseMetadataTypeDef: # (1)
...
# get_bucket_notification method usage example with argument unpacking
kwargs: GetBucketNotificationConfigurationRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.get_bucket_notification(**kwargs)
get_bucket_notification_configuration#
Returns the notification configuration of a bucket.
Type annotations and code completion for boto3.client("s3").get_bucket_notification_configuration
method.
boto3 documentation
# get_bucket_notification_configuration method definition
def get_bucket_notification_configuration(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> NotificationConfigurationResponseMetadataTypeDef: # (1)
...
# get_bucket_notification_configuration method usage example with argument unpacking
kwargs: GetBucketNotificationConfigurationRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.get_bucket_notification_configuration(**kwargs)
get_bucket_ownership_controls#
Retrieves OwnershipControls
for an Amazon S3 bucket.
Type annotations and code completion for boto3.client("s3").get_bucket_ownership_controls
method.
boto3 documentation
# get_bucket_ownership_controls method definition
def get_bucket_ownership_controls(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> GetBucketOwnershipControlsOutputTypeDef: # (1)
...
# get_bucket_ownership_controls method usage example with argument unpacking
kwargs: GetBucketOwnershipControlsRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.get_bucket_ownership_controls(**kwargs)
get_bucket_policy#
Returns the policy of a specified bucket.
Type annotations and code completion for boto3.client("s3").get_bucket_policy
method.
boto3 documentation
# get_bucket_policy method definition
def get_bucket_policy(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> GetBucketPolicyOutputTypeDef: # (1)
...
# get_bucket_policy method usage example with argument unpacking
kwargs: GetBucketPolicyRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.get_bucket_policy(**kwargs)
get_bucket_policy_status#
Retrieves the policy status for an Amazon S3 bucket, indicating whether the bucket is public.
Type annotations and code completion for boto3.client("s3").get_bucket_policy_status
method.
boto3 documentation
# get_bucket_policy_status method definition
def get_bucket_policy_status(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> GetBucketPolicyStatusOutputTypeDef: # (1)
...
# get_bucket_policy_status method usage example with argument unpacking
kwargs: GetBucketPolicyStatusRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.get_bucket_policy_status(**kwargs)
get_bucket_replication#
Returns the replication configuration of a bucket.
Type annotations and code completion for boto3.client("s3").get_bucket_replication
method.
boto3 documentation
# get_bucket_replication method definition
def get_bucket_replication(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> GetBucketReplicationOutputTypeDef: # (1)
...
# get_bucket_replication method usage example with argument unpacking
kwargs: GetBucketReplicationRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.get_bucket_replication(**kwargs)
get_bucket_request_payment#
Returns the request payment configuration of a bucket.
Type annotations and code completion for boto3.client("s3").get_bucket_request_payment
method.
boto3 documentation
# get_bucket_request_payment method definition
def get_bucket_request_payment(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> GetBucketRequestPaymentOutputTypeDef: # (1)
...
# get_bucket_request_payment method usage example with argument unpacking
kwargs: GetBucketRequestPaymentRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.get_bucket_request_payment(**kwargs)
get_bucket_tagging#
Returns the tag set associated with the bucket.
Type annotations and code completion for boto3.client("s3").get_bucket_tagging
method.
boto3 documentation
# get_bucket_tagging method definition
def get_bucket_tagging(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> GetBucketTaggingOutputTypeDef: # (1)
...
# get_bucket_tagging method usage example with argument unpacking
kwargs: GetBucketTaggingRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.get_bucket_tagging(**kwargs)
get_bucket_versioning#
Returns the versioning state of a bucket.
Type annotations and code completion for boto3.client("s3").get_bucket_versioning
method.
boto3 documentation
# get_bucket_versioning method definition
def get_bucket_versioning(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> GetBucketVersioningOutputTypeDef: # (1)
...
# get_bucket_versioning method usage example with argument unpacking
kwargs: GetBucketVersioningRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.get_bucket_versioning(**kwargs)
get_bucket_website#
Returns the website configuration for a bucket.
Type annotations and code completion for boto3.client("s3").get_bucket_website
method.
boto3 documentation
# get_bucket_website method definition
def get_bucket_website(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> GetBucketWebsiteOutputTypeDef: # (1)
...
# get_bucket_website method usage example with argument unpacking
kwargs: GetBucketWebsiteRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.get_bucket_website(**kwargs)
get_object#
Retrieves objects from Amazon S3.
Type annotations and code completion for boto3.client("s3").get_object
method.
boto3 documentation
# get_object method definition
def get_object(
self,
*,
Bucket: str,
Key: str,
IfMatch: str = ...,
IfModifiedSince: Union[datetime, str] = ...,
IfNoneMatch: str = ...,
IfUnmodifiedSince: Union[datetime, str] = ...,
Range: str = ...,
ResponseCacheControl: str = ...,
ResponseContentDisposition: str = ...,
ResponseContentEncoding: str = ...,
ResponseContentLanguage: str = ...,
ResponseContentType: str = ...,
ResponseExpires: Union[datetime, str] = ...,
VersionId: str = ...,
SSECustomerAlgorithm: str = ...,
SSECustomerKey: str = ...,
SSECustomerKeyMD5: str = ...,
RequestPayer: RequestPayerType = ..., # (1)
PartNumber: int = ...,
ExpectedBucketOwner: str = ...,
ChecksumMode: ChecksumModeType = ..., # (2)
) -> GetObjectOutputTypeDef: # (3)
...
- See RequestPayerType
- See ChecksumModeType
- See GetObjectOutputTypeDef
# get_object method usage example with argument unpacking
kwargs: GetObjectRequestRequestTypeDef = { # (1)
"Bucket": ...,
"Key": ...,
}
parent.get_object(**kwargs)
get_object_acl#
Returns the access control list (ACL) of an object.
Type annotations and code completion for boto3.client("s3").get_object_acl
method.
boto3 documentation
# get_object_acl method definition
def get_object_acl(
self,
*,
Bucket: str,
Key: str,
VersionId: str = ...,
RequestPayer: RequestPayerType = ..., # (1)
ExpectedBucketOwner: str = ...,
) -> GetObjectAclOutputTypeDef: # (2)
...
# get_object_acl method usage example with argument unpacking
kwargs: GetObjectAclRequestRequestTypeDef = { # (1)
"Bucket": ...,
"Key": ...,
}
parent.get_object_acl(**kwargs)
get_object_attributes#
Retrieves all the metadata from an object without returning the object itself.
Type annotations and code completion for boto3.client("s3").get_object_attributes
method.
boto3 documentation
# get_object_attributes method definition
def get_object_attributes(
self,
*,
Bucket: str,
Key: str,
ObjectAttributes: Sequence[ObjectAttributesType], # (1)
VersionId: str = ...,
MaxParts: int = ...,
PartNumberMarker: int = ...,
SSECustomerAlgorithm: str = ...,
SSECustomerKey: str = ...,
SSECustomerKeyMD5: str = ...,
RequestPayer: RequestPayerType = ..., # (2)
ExpectedBucketOwner: str = ...,
) -> GetObjectAttributesOutputTypeDef: # (3)
...
# get_object_attributes method usage example with argument unpacking
kwargs: GetObjectAttributesRequestRequestTypeDef = { # (1)
"Bucket": ...,
"Key": ...,
"ObjectAttributes": ...,
}
parent.get_object_attributes(**kwargs)
get_object_legal_hold#
Gets an object's current legal hold status.
Type annotations and code completion for boto3.client("s3").get_object_legal_hold
method.
boto3 documentation
# get_object_legal_hold method definition
def get_object_legal_hold(
self,
*,
Bucket: str,
Key: str,
VersionId: str = ...,
RequestPayer: RequestPayerType = ..., # (1)
ExpectedBucketOwner: str = ...,
) -> GetObjectLegalHoldOutputTypeDef: # (2)
...
# get_object_legal_hold method usage example with argument unpacking
kwargs: GetObjectLegalHoldRequestRequestTypeDef = { # (1)
"Bucket": ...,
"Key": ...,
}
parent.get_object_legal_hold(**kwargs)
get_object_lock_configuration#
Gets the Object Lock configuration for a bucket.
Type annotations and code completion for boto3.client("s3").get_object_lock_configuration
method.
boto3 documentation
# get_object_lock_configuration method definition
def get_object_lock_configuration(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> GetObjectLockConfigurationOutputTypeDef: # (1)
...
# get_object_lock_configuration method usage example with argument unpacking
kwargs: GetObjectLockConfigurationRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.get_object_lock_configuration(**kwargs)
get_object_retention#
Retrieves an object's retention settings.
Type annotations and code completion for boto3.client("s3").get_object_retention
method.
boto3 documentation
# get_object_retention method definition
def get_object_retention(
self,
*,
Bucket: str,
Key: str,
VersionId: str = ...,
RequestPayer: RequestPayerType = ..., # (1)
ExpectedBucketOwner: str = ...,
) -> GetObjectRetentionOutputTypeDef: # (2)
...
# get_object_retention method usage example with argument unpacking
kwargs: GetObjectRetentionRequestRequestTypeDef = { # (1)
"Bucket": ...,
"Key": ...,
}
parent.get_object_retention(**kwargs)
get_object_tagging#
Returns the tag-set of an object.
Type annotations and code completion for boto3.client("s3").get_object_tagging
method.
boto3 documentation
# get_object_tagging method definition
def get_object_tagging(
self,
*,
Bucket: str,
Key: str,
VersionId: str = ...,
ExpectedBucketOwner: str = ...,
RequestPayer: RequestPayerType = ..., # (1)
) -> GetObjectTaggingOutputTypeDef: # (2)
...
# get_object_tagging method usage example with argument unpacking
kwargs: GetObjectTaggingRequestRequestTypeDef = { # (1)
"Bucket": ...,
"Key": ...,
}
parent.get_object_tagging(**kwargs)
get_object_torrent#
Returns torrent files from a bucket.
Type annotations and code completion for boto3.client("s3").get_object_torrent
method.
boto3 documentation
# get_object_torrent method definition
def get_object_torrent(
self,
*,
Bucket: str,
Key: str,
RequestPayer: RequestPayerType = ..., # (1)
ExpectedBucketOwner: str = ...,
) -> GetObjectTorrentOutputTypeDef: # (2)
...
# get_object_torrent method usage example with argument unpacking
kwargs: GetObjectTorrentRequestRequestTypeDef = { # (1)
"Bucket": ...,
"Key": ...,
}
parent.get_object_torrent(**kwargs)
get_public_access_block#
Retrieves the PublicAccessBlock
configuration for an Amazon S3 bucket.
Type annotations and code completion for boto3.client("s3").get_public_access_block
method.
boto3 documentation
# get_public_access_block method definition
def get_public_access_block(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> GetPublicAccessBlockOutputTypeDef: # (1)
...
# get_public_access_block method usage example with argument unpacking
kwargs: GetPublicAccessBlockRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.get_public_access_block(**kwargs)
head_bucket#
This action is useful to determine if a bucket exists and you have permission to access it.
Type annotations and code completion for boto3.client("s3").head_bucket
method.
boto3 documentation
# head_bucket method definition
def head_bucket(
self,
*,
Bucket: str,
ExpectedBucketOwner: str = ...,
) -> EmptyResponseMetadataTypeDef: # (1)
...
# head_bucket method usage example with argument unpacking
kwargs: HeadBucketRequestRequestTypeDef = { # (1)
"Bucket": ...,
}
parent.head_bucket(**kwargs)
head_object#
The HEAD action retrieves metadata from an object without returning the object itself.
Type annotations and code completion for boto3.client("s3").head_object
method.
boto3 documentation
# head_object method definition
def head_object(
self,
*,
Bucket: str,
Key: str,
IfMatch: str = ...,
IfModifiedSince: Union[datetime, str] = ...,
IfNoneMatch: str = ...,
IfUnmodifiedSince: Union[datetime, str] = ...,
Range: str = ...,
VersionId: str = ...,
SSECustomerAlgorithm: str = ...,
SSECustomerKey: str = ...,
SSECustomerKeyMD5: str = ...,
RequestPayer: RequestPayerType = ..., # (1)
PartNumber: int = ...,
ExpectedBucketOwner: str = ...,
ChecksumMode: ChecksumModeType = ..., # (2)
) -> HeadObjectOutputTypeDef: # (3)
...
- See RequestPayerType
- See ChecksumModeType
- See HeadObjectOutputTypeDef
# head_object method usage example with argument unpacking
kwargs: HeadObjectRequestRequestTypeDef = { # (1)
"Bucket": ...,
"Key": ...,
}
parent.head_object(**kwargs)
list_bucket_analytics_configurations#
Lists the analytics configurations for the bucket.
Type annotations and code completio