Amazon Simple Storage Service

2015/07/28 - Amazon Simple Storage Service - 14 updated api methods

CompleteMultipartUpload (updated) Link ¶
Changes (response)
{'ServerSideEncryption': {'aws:kms'}}

Completes a multipart upload by assembling previously uploaded parts.

Request Syntax

client.complete_multipart_upload(
    Bucket='string',
    Key='string',
    MultipartUpload={
        'Parts': [
            {
                'ETag': 'string',
                'PartNumber': 123
            },
        ]
    },
    UploadId='string',
    RequestPayer='requester'
)
type Bucket

string

param Bucket

[REQUIRED]

type Key

string

param Key

[REQUIRED]

type MultipartUpload

dict

param MultipartUpload
  • Parts (list) --

    • (dict) --

      • ETag (string) -- Entity tag returned when the part was uploaded.

      • PartNumber (integer) -- Part number that identifies the part. This is a positive integer between 1 and 10,000.

type UploadId

string

param UploadId

[REQUIRED]

type RequestPayer

string

param RequestPayer

Confirms that the requester knows that she or he will be charged for the request. Bucket owners need not specify this parameter in their requests. Documentation on downloading objects from requester pays buckets can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html

rtype

dict

returns

Response Syntax

{
    'Location': 'string',
    'Bucket': 'string',
    'Key': 'string',
    'Expiration': 'string',
    'ETag': 'string',
    'ServerSideEncryption': 'AES256'|'aws:kms',
    'VersionId': 'string',
    'SSEKMSKeyId': 'string',
    'RequestCharged': 'requester'
}

Response Structure

  • (dict) --

    • Location (string) --

    • Bucket (string) --

    • Key (string) --

    • Expiration (string) -- If the object expiration is configured, this will contain the expiration date (expiry-date) and rule ID (rule-id). The value of rule-id is URL encoded.

    • ETag (string) -- Entity tag of the object.

    • ServerSideEncryption (string) -- The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms).

    • VersionId (string) -- Version of the object.

    • SSEKMSKeyId (string) -- If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used for the object.

    • RequestCharged (string) -- If present, indicates that the requester was successfully charged for the request.

CopyObject (updated) Link ¶
Changes (request, response)
Request
{'ServerSideEncryption': {'aws:kms'}, 'StorageClass': {'LT'}}
Response
{'ServerSideEncryption': {'aws:kms'}}

Creates a copy of an object that is already stored in Amazon S3.

Request Syntax

client.copy_object(
    ACL='private'|'public-read'|'public-read-write'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control',
    Bucket='string',
    CacheControl='string',
    ContentDisposition='string',
    ContentEncoding='string',
    ContentLanguage='string',
    ContentType='string',
    CopySource='string',
    CopySourceIfMatch='string',
    CopySourceIfModifiedSince=datetime(2015, 1, 1),
    CopySourceIfNoneMatch='string',
    CopySourceIfUnmodifiedSince=datetime(2015, 1, 1),
    Expires=datetime(2015, 1, 1),
    GrantFullControl='string',
    GrantRead='string',
    GrantReadACP='string',
    GrantWriteACP='string',
    Key='string',
    Metadata={
        'string': 'string'
    },
    MetadataDirective='COPY'|'REPLACE',
    ServerSideEncryption='AES256'|'aws:kms',
    StorageClass='STANDARD'|'REDUCED_REDUNDANCY'|'LT',
    WebsiteRedirectLocation='string',
    SSECustomerAlgorithm='string',
    SSECustomerKey=b'bytes',
    SSECustomerKeyMD5='string',
    SSEKMSKeyId='string',
    CopySourceSSECustomerAlgorithm='string',
    CopySourceSSECustomerKey=b'bytes',
    CopySourceSSECustomerKeyMD5='string',
    RequestPayer='requester'
)
type ACL

string

param ACL

The canned ACL to apply to the object.

type Bucket

string

param Bucket

[REQUIRED]

type CacheControl

string

param CacheControl

Specifies caching behavior along the request/reply chain.

type ContentDisposition

string

param ContentDisposition

Specifies presentational information for the object.

type ContentEncoding

string

param ContentEncoding

Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.

type ContentLanguage

string

param ContentLanguage

The language the content is in.

type ContentType

string

param ContentType

A standard MIME type describing the format of the object data.

type CopySource

string

param CopySource

[REQUIRED] The name of the source bucket and key name of the source object, separated by a slash (/). Must be URL-encoded.

type CopySourceIfMatch

string

param CopySourceIfMatch

Copies the object if its entity tag (ETag) matches the specified tag.

type CopySourceIfModifiedSince

datetime

param CopySourceIfModifiedSince

Copies the object if it has been modified since the specified time.

type CopySourceIfNoneMatch

string

param CopySourceIfNoneMatch

Copies the object if its entity tag (ETag) is different than the specified ETag.

type CopySourceIfUnmodifiedSince

datetime

param CopySourceIfUnmodifiedSince

Copies the object if it hasn't been modified since the specified time.

type Expires

datetime

param Expires

The date and time at which the object is no longer cacheable.

type GrantFullControl

string

param GrantFullControl

Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object.

type GrantRead

string

param GrantRead

Allows grantee to read the object data and its metadata.

type GrantReadACP

string

param GrantReadACP

Allows grantee to read the object ACL.

type GrantWriteACP

string

param GrantWriteACP

Allows grantee to write the ACL for the applicable object.

type Key

string

param Key

[REQUIRED]

type Metadata

dict

param Metadata

A map of metadata to store with the object in S3.

  • (string) --

    • (string) --

type MetadataDirective

string

param MetadataDirective

Specifies whether the metadata is copied from the source object or replaced with metadata provided in the request.

type ServerSideEncryption

string

param ServerSideEncryption

The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms).

type StorageClass

string

param StorageClass

The type of storage to use for the object. Defaults to 'STANDARD'.

type WebsiteRedirectLocation

string

param WebsiteRedirectLocation

If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.

type SSECustomerAlgorithm

string

param SSECustomerAlgorithm

Specifies the algorithm to use to when encrypting the object (e.g., AES256).

type SSECustomerKey

bytes

param SSECustomerKey

Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm header.

type SSECustomerKeyMD5

string

param SSECustomerKeyMD5

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.

type SSEKMSKeyId

string

param SSEKMSKeyId

Specifies the AWS KMS key ID to use for object encryption. All GET and PUT requests for an object protected by AWS KMS will fail if not made via SSL or using SigV4. Documentation on configuring any of the officially supported AWS SDKs and CLI can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version

type CopySourceSSECustomerAlgorithm

string

param CopySourceSSECustomerAlgorithm

Specifies the algorithm to use when decrypting the source object (e.g., AES256).

type CopySourceSSECustomerKey

bytes

param CopySourceSSECustomerKey

Specifies the customer-provided encryption key for Amazon S3 to use to decrypt the source object. The encryption key provided in this header must be one that was used when the source object was created.

type CopySourceSSECustomerKeyMD5

string

param CopySourceSSECustomerKeyMD5

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.

type RequestPayer

string

param RequestPayer

Confirms that the requester knows that she or he will be charged for the request. Bucket owners need not specify this parameter in their requests. Documentation on downloading objects from requester pays buckets can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html

rtype

dict

returns

Response Syntax

{
    'CopyObjectResult': {
        'ETag': 'string',
        'LastModified': datetime(2015, 1, 1)
    },
    'Expiration': 'string',
    'CopySourceVersionId': 'string',
    'ServerSideEncryption': 'AES256'|'aws:kms',
    'SSECustomerAlgorithm': 'string',
    'SSECustomerKeyMD5': 'string',
    'SSEKMSKeyId': 'string',
    'RequestCharged': 'requester'
}

Response Structure

  • (dict) --

    • CopyObjectResult (dict) --

      • ETag (string) --

      • LastModified (datetime) --

    • Expiration (string) -- If the object expiration is configured, the response includes this header.

    • CopySourceVersionId (string) --

    • ServerSideEncryption (string) -- The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms).

    • SSECustomerAlgorithm (string) -- If server-side encryption with a customer-provided encryption key was requested, the response will include this header confirming the encryption algorithm used.

    • SSECustomerKeyMD5 (string) -- If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide round trip message integrity verification of the customer-provided encryption key.

    • SSEKMSKeyId (string) -- If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used for the object.

    • RequestCharged (string) -- If present, indicates that the requester was successfully charged for the request.

CreateMultipartUpload (updated) Link ¶
Changes (request, response)
Request
{'ServerSideEncryption': {'aws:kms'}, 'StorageClass': {'LT'}}
Response
{'ServerSideEncryption': {'aws:kms'}}

Initiates a multipart upload and returns an upload ID.

Note: After you initiate multipart upload and upload one or more parts, you must either complete or abort multipart upload in order to stop getting charged for storage of the uploaded parts. Only after you either complete or abort multipart upload, Amazon S3 frees up the parts storage and stops charging you for the parts storage.

Request Syntax

client.create_multipart_upload(
    ACL='private'|'public-read'|'public-read-write'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control',
    Bucket='string',
    CacheControl='string',
    ContentDisposition='string',
    ContentEncoding='string',
    ContentLanguage='string',
    ContentType='string',
    Expires=datetime(2015, 1, 1),
    GrantFullControl='string',
    GrantRead='string',
    GrantReadACP='string',
    GrantWriteACP='string',
    Key='string',
    Metadata={
        'string': 'string'
    },
    ServerSideEncryption='AES256'|'aws:kms',
    StorageClass='STANDARD'|'REDUCED_REDUNDANCY'|'LT',
    WebsiteRedirectLocation='string',
    SSECustomerAlgorithm='string',
    SSECustomerKey=b'bytes',
    SSECustomerKeyMD5='string',
    SSEKMSKeyId='string',
    RequestPayer='requester'
)
type ACL

string

param ACL

The canned ACL to apply to the object.

type Bucket

string

param Bucket

[REQUIRED]

type CacheControl

string

param CacheControl

Specifies caching behavior along the request/reply chain.

type ContentDisposition

string

param ContentDisposition

Specifies presentational information for the object.

type ContentEncoding

string

param ContentEncoding

Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.

type ContentLanguage

string

param ContentLanguage

The language the content is in.

type ContentType

string

param ContentType

A standard MIME type describing the format of the object data.

type Expires

datetime

param Expires

The date and time at which the object is no longer cacheable.

type GrantFullControl

string

param GrantFullControl

Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object.

type GrantRead

string

param GrantRead

Allows grantee to read the object data and its metadata.

type GrantReadACP

string

param GrantReadACP

Allows grantee to read the object ACL.

type GrantWriteACP

string

param GrantWriteACP

Allows grantee to write the ACL for the applicable object.

type Key

string

param Key

[REQUIRED]

type Metadata

dict

param Metadata

A map of metadata to store with the object in S3.

  • (string) --

    • (string) --

type ServerSideEncryption

string

param ServerSideEncryption

The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms).

type StorageClass

string

param StorageClass

The type of storage to use for the object. Defaults to 'STANDARD'.

type WebsiteRedirectLocation

string

param WebsiteRedirectLocation

If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.

type SSECustomerAlgorithm

string

param SSECustomerAlgorithm

Specifies the algorithm to use to when encrypting the object (e.g., AES256).

type SSECustomerKey

bytes

param SSECustomerKey

Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm header.

type SSECustomerKeyMD5

string

param SSECustomerKeyMD5

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.

type SSEKMSKeyId

string

param SSEKMSKeyId

Specifies the AWS KMS key ID to use for object encryption. All GET and PUT requests for an object protected by AWS KMS will fail if not made via SSL or using SigV4. Documentation on configuring any of the officially supported AWS SDKs and CLI can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version

type RequestPayer

string

param RequestPayer

Confirms that the requester knows that she or he will be charged for the request. Bucket owners need not specify this parameter in their requests. Documentation on downloading objects from requester pays buckets can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html

rtype

dict

returns

Response Syntax

{
    'Bucket': 'string',
    'Key': 'string',
    'UploadId': 'string',
    'ServerSideEncryption': 'AES256'|'aws:kms',
    'SSECustomerAlgorithm': 'string',
    'SSECustomerKeyMD5': 'string',
    'SSEKMSKeyId': 'string',
    'RequestCharged': 'requester'
}

Response Structure

  • (dict) --

    • Bucket (string) -- Name of the bucket to which the multipart upload was initiated.

    • Key (string) -- Object key for which the multipart upload was initiated.

    • UploadId (string) -- ID for the initiated multipart upload.

    • ServerSideEncryption (string) -- The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms).

    • SSECustomerAlgorithm (string) -- If server-side encryption with a customer-provided encryption key was requested, the response will include this header confirming the encryption algorithm used.

    • SSECustomerKeyMD5 (string) -- If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide round trip message integrity verification of the customer-provided encryption key.

    • SSEKMSKeyId (string) -- If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used for the object.

    • RequestCharged (string) -- If present, indicates that the requester was successfully charged for the request.

GetBucketNotification (updated) Link ¶
Changes (response)
{'CloudFunctionConfiguration': {'Event': {'s3:ObjectRemoved:*',
                                          's3:ObjectRemoved:Delete',
                                          's3:ObjectRemoved:DeleteMarkerCreated'},
                                'Events': {'s3:ObjectRemoved:*',
                                           's3:ObjectRemoved:Delete',
                                           's3:ObjectRemoved:DeleteMarkerCreated'}},
 'QueueConfiguration': {'Event': {'s3:ObjectRemoved:*',
                                  's3:ObjectRemoved:Delete',
                                  's3:ObjectRemoved:DeleteMarkerCreated'},
                        'Events': {'s3:ObjectRemoved:*',
                                   's3:ObjectRemoved:Delete',
                                   's3:ObjectRemoved:DeleteMarkerCreated'}},
 'TopicConfiguration': {'Event': {'s3:ObjectRemoved:*',
                                  's3:ObjectRemoved:Delete',
                                  's3:ObjectRemoved:DeleteMarkerCreated'},
                        'Events': {'s3:ObjectRemoved:*',
                                   's3:ObjectRemoved:Delete',
                                   's3:ObjectRemoved:DeleteMarkerCreated'}}}

Deprecated, see the GetBucketNotificationConfiguration operation.

!DANGER!

This operation is deprecated and may not function as expected. This operation should not be used going forward and is only kept for the purpose of backwards compatiblity.

Request Syntax

client.get_bucket_notification(
    Bucket='string'
)
type Bucket

string

param Bucket

[REQUIRED] Name of the buket to get the notification configuration for.

rtype

dict

returns

Response Syntax

{
    'TopicConfiguration': {
        'Id': 'string',
        'Events': [
            's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated',
        ],
        'Event': 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated',
        'Topic': 'string'
    },
    'QueueConfiguration': {
        'Id': 'string',
        'Event': 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated',
        'Events': [
            's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated',
        ],
        'Queue': 'string'
    },
    'CloudFunctionConfiguration': {
        'Id': 'string',
        'Event': 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated',
        'Events': [
            's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated',
        ],
        'CloudFunction': 'string',
        'InvocationRole': 'string'
    }
}

Response Structure

  • (dict) --

    • TopicConfiguration (dict) --

      • Id (string) -- Optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID.

      • Events (list) --

        • (string) -- Bucket event for which to send notifications.

      • Event (string) -- Bucket event for which to send notifications.

      • Topic (string) -- Amazon SNS topic to which Amazon S3 will publish a message to report the specified events for the bucket.

    • QueueConfiguration (dict) --

      • Id (string) -- Optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID.

      • Event (string) -- Bucket event for which to send notifications.

      • Events (list) --

        • (string) -- Bucket event for which to send notifications.

      • Queue (string) --

    • CloudFunctionConfiguration (dict) --

      • Id (string) -- Optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID.

      • Event (string) -- Bucket event for which to send notifications.

      • Events (list) --

        • (string) -- Bucket event for which to send notifications.

      • CloudFunction (string) --

      • InvocationRole (string) --

GetBucketNotificationConfiguration (updated) Link ¶
Changes (response)
{'LambdaFunctionConfigurations': {'Events': {'s3:ObjectRemoved:*',
                                             's3:ObjectRemoved:Delete',
                                             's3:ObjectRemoved:DeleteMarkerCreated'}},
 'QueueConfigurations': {'Events': {'s3:ObjectRemoved:*',
                                    's3:ObjectRemoved:Delete',
                                    's3:ObjectRemoved:DeleteMarkerCreated'}},
 'TopicConfigurations': {'Events': {'s3:ObjectRemoved:*',
                                    's3:ObjectRemoved:Delete',
                                    's3:ObjectRemoved:DeleteMarkerCreated'}}}

Returns the notification configuration of a bucket.

Request Syntax

client.get_bucket_notification_configuration(
    Bucket='string'
)
type Bucket

string

param Bucket

[REQUIRED] Name of the buket to get the notification configuration for.

rtype

dict

returns

Response Syntax

{
    'TopicConfigurations': [
        {
            'Id': 'string',
            'TopicArn': 'string',
            'Events': [
                's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated',
            ]
        },
    ],
    'QueueConfigurations': [
        {
            'Id': 'string',
            'QueueArn': 'string',
            'Events': [
                's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated',
            ]
        },
    ],
    'LambdaFunctionConfigurations': [
        {
            'Id': 'string',
            'LambdaFunctionArn': 'string',
            'Events': [
                's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated',
            ]
        },
    ]
}

Response Structure

  • (dict) -- Container for specifying the notification configuration of the bucket. If this element is empty, notifications are turned off on the bucket.

    • TopicConfigurations (list) --

      • (dict) -- Container for specifying the configuration when you want Amazon S3 to publish events to an Amazon Simple Notification Service (Amazon SNS) topic.

        • Id (string) -- Optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID.

        • TopicArn (string) -- Amazon SNS topic ARN to which Amazon S3 will publish a message when it detects events of specified type.

        • Events (list) --

          • (string) -- Bucket event for which to send notifications.

    • QueueConfigurations (list) --

      • (dict) -- Container for specifying an configuration when you want Amazon S3 to publish events to an Amazon Simple Queue Service (Amazon SQS) queue.

        • Id (string) -- Optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID.

        • QueueArn (string) -- Amazon SQS queue ARN to which Amazon S3 will publish a message when it detects events of specified type.

        • Events (list) --

          • (string) -- Bucket event for which to send notifications.

    • LambdaFunctionConfigurations (list) --

      • (dict) -- Container for specifying the AWS Lambda notification configuration.

        • Id (string) -- Optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID.

        • LambdaFunctionArn (string) -- Lambda cloud function ARN that Amazon S3 can invoke when it detects events of the specified type.

        • Events (list) --

          • (string) -- Bucket event for which to send notifications.

GetObject (updated) Link ¶
Changes (response)
{'ServerSideEncryption': {'aws:kms'},
 'StorageClass': 'STANDARD | REDUCED_REDUNDANCY | LT'}

Retrieves objects from Amazon S3.

Request Syntax

client.get_object(
    Bucket='string',
    IfMatch='string',
    IfModifiedSince=datetime(2015, 1, 1),
    IfNoneMatch='string',
    IfUnmodifiedSince=datetime(2015, 1, 1),
    Key='string',
    Range='string',
    ResponseCacheControl='string',
    ResponseContentDisposition='string',
    ResponseContentEncoding='string',
    ResponseContentLanguage='string',
    ResponseContentType='string',
    ResponseExpires=datetime(2015, 1, 1),
    VersionId='string',
    SSECustomerAlgorithm='string',
    SSECustomerKey=b'bytes',
    SSECustomerKeyMD5='string',
    RequestPayer='requester'
)
type Bucket

string

param Bucket

[REQUIRED]

type IfMatch

string

param IfMatch

Return the object only if its entity tag (ETag) is the same as the one specified, otherwise return a 412 (precondition failed).

type IfModifiedSince

datetime

param IfModifiedSince

Return the object only if it has been modified since the specified time, otherwise return a 304 (not modified).

type IfNoneMatch

string

param IfNoneMatch

Return the object only if its entity tag (ETag) is different from the one specified, otherwise return a 304 (not modified).

type IfUnmodifiedSince

datetime

param IfUnmodifiedSince

Return the object only if it has not been modified since the specified time, otherwise return a 412 (precondition failed).

type Key

string

param Key

[REQUIRED]

type Range

string

param Range

Downloads the specified range bytes of an object. For more information about the HTTP Range header, go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.

type ResponseCacheControl

string

param ResponseCacheControl

Sets the Cache-Control header of the response.

type ResponseContentDisposition

string

param ResponseContentDisposition

Sets the Content-Disposition header of the response

type ResponseContentEncoding

string

param ResponseContentEncoding

Sets the Content-Encoding header of the response.

type ResponseContentLanguage

string

param ResponseContentLanguage

Sets the Content-Language header of the response.

type ResponseContentType

string

param ResponseContentType

Sets the Content-Type header of the response.

type ResponseExpires

datetime

param ResponseExpires

Sets the Expires header of the response.

type VersionId

string

param VersionId

VersionId used to reference a specific version of the object.

type SSECustomerAlgorithm

string

param SSECustomerAlgorithm

Specifies the algorithm to use to when encrypting the object (e.g., AES256).

type SSECustomerKey

bytes

param SSECustomerKey

Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm header.

type SSECustomerKeyMD5

string

param SSECustomerKeyMD5

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.

type RequestPayer

string

param RequestPayer

Confirms that the requester knows that she or he will be charged for the request. Bucket owners need not specify this parameter in their requests. Documentation on downloading objects from requester pays buckets can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html

rtype

dict

returns

Response Syntax

{
    'Body': StreamingBody(),
    'DeleteMarker': True|False,
    'AcceptRanges': 'string',
    'Expiration': 'string',
    'Restore': 'string',
    'LastModified': datetime(2015, 1, 1),
    'ContentLength': 123,
    'ETag': 'string',
    'MissingMeta': 123,
    'VersionId': 'string',
    'CacheControl': 'string',
    'ContentDisposition': 'string',
    'ContentEncoding': 'string',
    'ContentLanguage': 'string',
    'ContentRange': 'string',
    'ContentType': 'string',
    'Expires': datetime(2015, 1, 1),
    'WebsiteRedirectLocation': 'string',
    'ServerSideEncryption': 'AES256'|'aws:kms',
    'Metadata': {
        'string': 'string'
    },
    'SSECustomerAlgorithm': 'string',
    'SSECustomerKeyMD5': 'string',
    'SSEKMSKeyId': 'string',
    'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'LT',
    'RequestCharged': 'requester',
    'ReplicationStatus': 'COMPLETE'|'PENDING'|'FAILED'|'REPLICA'
}

Response Structure

  • (dict) --

    • Body (:class:`.StreamingBody`) -- Object data.

    • DeleteMarker (boolean) -- Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this response header does not appear in the response.

    • AcceptRanges (string) --

    • Expiration (string) -- If the object expiration is configured (see PUT Bucket lifecycle), the response includes this header. It includes the expiry-date and rule-id key value pairs providing object expiration information. The value of the rule-id is URL encoded.

    • Restore (string) -- Provides information about object restoration operation and expiration time of the restored object copy.

    • LastModified (datetime) -- Last modified date of the object

    • ContentLength (integer) -- Size of the body in bytes.

    • ETag (string) -- An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a URL

    • MissingMeta (integer) -- This is set to the number of metadata entries not returned in x-amz-meta headers. This can happen if you create metadata using an API like SOAP that supports more flexible metadata than the REST API. For example, using SOAP, you can create metadata whose values are not legal HTTP headers.

    • VersionId (string) -- Version of the object.

    • CacheControl (string) -- Specifies caching behavior along the request/reply chain.

    • ContentDisposition (string) -- Specifies presentational information for the object.

    • ContentEncoding (string) -- Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.

    • ContentLanguage (string) -- The language the content is in.

    • ContentRange (string) -- The portion of the object returned in the response.

    • ContentType (string) -- A standard MIME type describing the format of the object data.

    • Expires (datetime) -- The date and time at which the object is no longer cacheable.

    • WebsiteRedirectLocation (string) -- If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.

    • ServerSideEncryption (string) -- The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms).

    • Metadata (dict) -- A map of metadata to store with the object in S3.

      • (string) --

        • (string) --

    • SSECustomerAlgorithm (string) -- If server-side encryption with a customer-provided encryption key was requested, the response will include this header confirming the encryption algorithm used.

    • SSECustomerKeyMD5 (string) -- If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide round trip message integrity verification of the customer-provided encryption key.

    • SSEKMSKeyId (string) -- If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used for the object.

    • StorageClass (string) --

    • RequestCharged (string) -- If present, indicates that the requester was successfully charged for the request.

    • ReplicationStatus (string) --

HeadObject (updated) Link ¶
Changes (response)
{'ServerSideEncryption': {'aws:kms'},
 'StorageClass': 'STANDARD | REDUCED_REDUNDANCY | LT'}

The HEAD operation retrieves metadata from an object without returning the object itself. This operation is useful if you're only interested in an object's metadata. To use HEAD, you must have READ access to the object.

Request Syntax

client.head_object(
    Bucket='string',
    IfMatch='string',
    IfModifiedSince=datetime(2015, 1, 1),
    IfNoneMatch='string',
    IfUnmodifiedSince=datetime(2015, 1, 1),
    Key='string',
    Range='string',
    VersionId='string',
    SSECustomerAlgorithm='string',
    SSECustomerKey=b'bytes',
    SSECustomerKeyMD5='string',
    RequestPayer='requester'
)
type Bucket

string

param Bucket

[REQUIRED]

type IfMatch

string

param IfMatch

Return the object only if its entity tag (ETag) is the same as the one specified, otherwise return a 412 (precondition failed).

type IfModifiedSince

datetime

param IfModifiedSince

Return the object only if it has been modified since the specified time, otherwise return a 304 (not modified).

type IfNoneMatch

string

param IfNoneMatch

Return the object only if its entity tag (ETag) is different from the one specified, otherwise return a 304 (not modified).

type IfUnmodifiedSince

datetime

param IfUnmodifiedSince

Return the object only if it has not been modified since the specified time, otherwise return a 412 (precondition failed).

type Key

string

param Key

[REQUIRED]

type Range

string

param Range

Downloads the specified range bytes of an object. For more information about the HTTP Range header, go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.

type VersionId

string

param VersionId

VersionId used to reference a specific version of the object.

type SSECustomerAlgorithm

string

param SSECustomerAlgorithm

Specifies the algorithm to use to when encrypting the object (e.g., AES256).

type SSECustomerKey

bytes

param SSECustomerKey

Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm header.

type SSECustomerKeyMD5

string

param SSECustomerKeyMD5

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.

type RequestPayer

string

param RequestPayer

Confirms that the requester knows that she or he will be charged for the request. Bucket owners need not specify this parameter in their requests. Documentation on downloading objects from requester pays buckets can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html

rtype

dict

returns

Response Syntax

{
    'DeleteMarker': True|False,
    'AcceptRanges': 'string',
    'Expiration': 'string',
    'Restore': 'string',
    'LastModified': datetime(2015, 1, 1),
    'ContentLength': 123,
    'ETag': 'string',
    'MissingMeta': 123,
    'VersionId': 'string',
    'CacheControl': 'string',
    'ContentDisposition': 'string',
    'ContentEncoding': 'string',
    'ContentLanguage': 'string',
    'ContentType': 'string',
    'Expires': datetime(2015, 1, 1),
    'WebsiteRedirectLocation': 'string',
    'ServerSideEncryption': 'AES256'|'aws:kms',
    'Metadata': {
        'string': 'string'
    },
    'SSECustomerAlgorithm': 'string',
    'SSECustomerKeyMD5': 'string',
    'SSEKMSKeyId': 'string',
    'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'LT',
    'RequestCharged': 'requester',
    'ReplicationStatus': 'COMPLETE'|'PENDING'|'FAILED'|'REPLICA'
}

Response Structure

  • (dict) --

    • DeleteMarker (boolean) -- Specifies whether the object retrieved was (true) or was not (false) a Delete Marker. If false, this response header does not appear in the response.

    • AcceptRanges (string) --

    • Expiration (string) -- If the object expiration is configured (see PUT Bucket lifecycle), the response includes this header. It includes the expiry-date and rule-id key value pairs providing object expiration information. The value of the rule-id is URL encoded.

    • Restore (string) -- Provides information about object restoration operation and expiration time of the restored object copy.

    • LastModified (datetime) -- Last modified date of the object

    • ContentLength (integer) -- Size of the body in bytes.

    • ETag (string) -- An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a URL

    • MissingMeta (integer) -- This is set to the number of metadata entries not returned in x-amz-meta headers. This can happen if you create metadata using an API like SOAP that supports more flexible metadata than the REST API. For example, using SOAP, you can create metadata whose values are not legal HTTP headers.

    • VersionId (string) -- Version of the object.

    • CacheControl (string) -- Specifies caching behavior along the request/reply chain.

    • ContentDisposition (string) -- Specifies presentational information for the object.

    • ContentEncoding (string) -- Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.

    • ContentLanguage (string) -- The language the content is in.

    • ContentType (string) -- A standard MIME type describing the format of the object data.

    • Expires (datetime) -- The date and time at which the object is no longer cacheable.

    • WebsiteRedirectLocation (string) -- If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.

    • ServerSideEncryption (string) -- The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms).

    • Metadata (dict) -- A map of metadata to store with the object in S3.

      • (string) --

        • (string) --

    • SSECustomerAlgorithm (string) -- If server-side encryption with a customer-provided encryption key was requested, the response will include this header confirming the encryption algorithm used.

    • SSECustomerKeyMD5 (string) -- If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide round trip message integrity verification of the customer-provided encryption key.

    • SSEKMSKeyId (string) -- If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used for the object.

    • StorageClass (string) --

    • RequestCharged (string) -- If present, indicates that the requester was successfully charged for the request.

    • ReplicationStatus (string) --

ListMultipartUploads (updated) Link ¶
Changes (response)
{'Uploads': {'StorageClass': {'LT'}}}

This operation lists in-progress multipart uploads.

Request Syntax

client.list_multipart_uploads(
    Bucket='string',
    Delimiter='string',
    EncodingType='url',
    KeyMarker='string',
    MaxUploads=123,
    Prefix='string',
    UploadIdMarker='string'
)
type Bucket

string

param Bucket

[REQUIRED]

type Delimiter

string

param Delimiter

Character you use to group keys.

type EncodingType

string

param EncodingType

Requests Amazon S3 to encode the object keys in the response and specifies the encoding method to use. An object key may contain any Unicode character; however, XML 1.0 parser cannot parse some characters, such as characters with an ASCII value from 0 to 10. For characters that are not supported in XML 1.0, you can add this parameter to request that Amazon S3 encode the keys in the response.

type KeyMarker

string

param KeyMarker

Together with upload-id-marker, this parameter specifies the multipart upload after which listing should begin.

type MaxUploads

integer

param MaxUploads

Sets the maximum number of multipart uploads, from 1 to 1,000, to return in the response body. 1,000 is the maximum number of uploads that can be returned in a response.

type Prefix

string

param Prefix

Lists in-progress uploads only for those keys that begin with the specified prefix.

type UploadIdMarker

string

param UploadIdMarker

Together with key-marker, specifies the multipart upload after which listing should begin. If key-marker is not specified, the upload-id-marker parameter is ignored.

rtype

dict

returns

Response Syntax

{
    'Bucket': 'string',
    'KeyMarker': 'string',
    'UploadIdMarker': 'string',
    'NextKeyMarker': 'string',
    'Prefix': 'string',
    'Delimiter': 'string',
    'NextUploadIdMarker': 'string',
    'MaxUploads': 123,
    'IsTruncated': True|False,
    'Uploads': [
        {
            'UploadId': 'string',
            'Key': 'string',
            'Initiated': datetime(2015, 1, 1),
            'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'LT',
            'Owner': {
                'DisplayName': 'string',
                'ID': 'string'
            },
            'Initiator': {
                'ID': 'string',
                'DisplayName': 'string'
            }
        },
    ],
    'CommonPrefixes': [
        {
            'Prefix': 'string'
        },
    ],
    'EncodingType': 'url'
}

Response Structure

  • (dict) --

    • Bucket (string) -- Name of the bucket to which the multipart upload was initiated.

    • KeyMarker (string) -- The key at or after which the listing began.

    • UploadIdMarker (string) -- Upload ID after which listing began.

    • NextKeyMarker (string) -- When a list is truncated, this element specifies the value that should be used for the key-marker request parameter in a subsequent request.

    • Prefix (string) -- When a prefix is provided in the request, this field contains the specified prefix. The result contains only keys starting with the specified prefix.

    • Delimiter (string) --

    • NextUploadIdMarker (string) -- When a list is truncated, this element specifies the value that should be used for the upload-id-marker request parameter in a subsequent request.

    • MaxUploads (integer) -- Maximum number of multipart uploads that could have been included in the response.

    • IsTruncated (boolean) -- Indicates whether the returned list of multipart uploads is truncated. A value of true indicates that the list was truncated. The list can be truncated if the number of multipart uploads exceeds the limit allowed or specified by max uploads.

    • Uploads (list) --

      • (dict) --

        • UploadId (string) -- Upload ID that identifies the multipart upload.

        • Key (string) -- Key of the object for which the multipart upload was initiated.

        • Initiated (datetime) -- Date and time at which the multipart upload was initiated.

        • StorageClass (string) -- The class of storage used to store the object.

        • Owner (dict) --

          • DisplayName (string) --

          • ID (string) --

        • Initiator (dict) -- Identifies who initiated the multipart upload.

          • ID (string) -- If the principal is an AWS account, it provides the Canonical User ID. If the principal is an IAM User, it provides a user ARN value.

          • DisplayName (string) -- Name of the Principal.

    • CommonPrefixes (list) --

      • (dict) --

        • Prefix (string) --

    • EncodingType (string) -- Encoding type used by Amazon S3 to encode object keys in the response.

ListParts (updated) Link ¶
Changes (response)
{'StorageClass': {'LT'}}

Lists the parts that have been uploaded for a specific multipart upload.

Request Syntax

client.list_parts(
    Bucket='string',
    Key='string',
    MaxParts=123,
    PartNumberMarker=123,
    UploadId='string',
    RequestPayer='requester'
)
type Bucket

string

param Bucket

[REQUIRED]

type Key

string

param Key

[REQUIRED]

type MaxParts

integer

param MaxParts

Sets the maximum number of parts to return.

type PartNumberMarker

integer

param PartNumberMarker

Specifies the part after which listing should begin. Only parts with higher part numbers will be listed.

type UploadId

string

param UploadId

[REQUIRED] Upload ID identifying the multipart upload whose parts are being listed.

type RequestPayer

string

param RequestPayer

Confirms that the requester knows that she or he will be charged for the request. Bucket owners need not specify this parameter in their requests. Documentation on downloading objects from requester pays buckets can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html

rtype

dict

returns

Response Syntax

{
    'Bucket': 'string',
    'Key': 'string',
    'UploadId': 'string',
    'PartNumberMarker': 123,
    'NextPartNumberMarker': 123,
    'MaxParts': 123,
    'IsTruncated': True|False,
    'Parts': [
        {
            'PartNumber': 123,
            'LastModified': datetime(2015, 1, 1),
            'ETag': 'string',
            'Size': 123
        },
    ],
    'Initiator': {
        'ID': 'string',
        'DisplayName': 'string'
    },
    'Owner': {
        'DisplayName': 'string',
        'ID': 'string'
    },
    'StorageClass': 'STANDARD'|'REDUCED_REDUNDANCY'|'LT',
    'RequestCharged': 'requester'
}

Response Structure

  • (dict) --

    • Bucket (string) -- Name of the bucket to which the multipart upload was initiated.

    • Key (string) -- Object key for which the multipart upload was initiated.

    • UploadId (string) -- Upload ID identifying the multipart upload whose parts are being listed.

    • PartNumberMarker (integer) -- Part number after which listing begins.

    • NextPartNumberMarker (integer) -- When a list is truncated, this element specifies the last part in the list, as well as the value to use for the part-number-marker request parameter in a subsequent request.

    • MaxParts (integer) -- Maximum number of parts that were allowed in the response.

    • IsTruncated (boolean) -- Indicates whether the returned list of parts is truncated.

    • Parts (list) --

      • (dict) --

        • PartNumber (integer) -- Part number identifying the part. This is a positive integer between 1 and 10,000.

        • LastModified (datetime) -- Date and time at which the part was uploaded.

        • ETag (string) -- Entity tag returned when the part was uploaded.

        • Size (integer) -- Size of the uploaded part data.

    • Initiator (dict) -- Identifies who initiated the multipart upload.

      • ID (string) -- If the principal is an AWS account, it provides the Canonical User ID. If the principal is an IAM User, it provides a user ARN value.

      • DisplayName (string) -- Name of the Principal.

    • Owner (dict) --

      • DisplayName (string) --

      • ID (string) --

    • StorageClass (string) -- The class of storage used to store the object.

    • RequestCharged (string) -- If present, indicates that the requester was successfully charged for the request.

PutBucketNotification (updated) Link ¶
Changes (request)
{'NotificationConfiguration': {'CloudFunctionConfiguration': {'Event': {'s3:ObjectRemoved:*',
                                                                        's3:ObjectRemoved:Delete',
                                                                        's3:ObjectRemoved:DeleteMarkerCreated'},
                                                              'Events': {'s3:ObjectRemoved:*',
                                                                         's3:ObjectRemoved:Delete',
                                                                         's3:ObjectRemoved:DeleteMarkerCreated'}},
                               'QueueConfiguration': {'Event': {'s3:ObjectRemoved:*',
                                                                's3:ObjectRemoved:Delete',
                                                                's3:ObjectRemoved:DeleteMarkerCreated'},
                                                      'Events': {'s3:ObjectRemoved:*',
                                                                 's3:ObjectRemoved:Delete',
                                                                 's3:ObjectRemoved:DeleteMarkerCreated'}},
                               'TopicConfiguration': {'Event': {'s3:ObjectRemoved:*',
                                                                's3:ObjectRemoved:Delete',
                                                                's3:ObjectRemoved:DeleteMarkerCreated'},
                                                      'Events': {'s3:ObjectRemoved:*',
                                                                 's3:ObjectRemoved:Delete',
                                                                 's3:ObjectRemoved:DeleteMarkerCreated'}}}}

Deprecated, see the PutBucketNotificationConfiguraiton operation.

!DANGER!

This operation is deprecated and may not function as expected. This operation should not be used going forward and is only kept for the purpose of backwards compatiblity.

Request Syntax

client.put_bucket_notification(
    Bucket='string',
    ContentMD5='string',
    NotificationConfiguration={
        'TopicConfiguration': {
            'Id': 'string',
            'Events': [
                's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated',
            ],
            'Event': 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated',
            'Topic': 'string'
        },
        'QueueConfiguration': {
            'Id': 'string',
            'Event': 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated',
            'Events': [
                's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated',
            ],
            'Queue': 'string'
        },
        'CloudFunctionConfiguration': {
            'Id': 'string',
            'Event': 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated',
            'Events': [
                's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated',
            ],
            'CloudFunction': 'string',
            'InvocationRole': 'string'
        }
    }
)
type Bucket

string

param Bucket

[REQUIRED]

type ContentMD5

string

param ContentMD5

type NotificationConfiguration

dict

param NotificationConfiguration

[REQUIRED]

  • TopicConfiguration (dict) --

    • Id (string) -- Optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID.

    • Events (list) --

      • (string) -- Bucket event for which to send notifications.

    • Event (string) -- Bucket event for which to send notifications.

    • Topic (string) -- Amazon SNS topic to which Amazon S3 will publish a message to report the specified events for the bucket.

  • QueueConfiguration (dict) --

    • Id (string) -- Optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID.

    • Event (string) -- Bucket event for which to send notifications.

    • Events (list) --

      • (string) -- Bucket event for which to send notifications.

    • Queue (string) --

  • CloudFunctionConfiguration (dict) --

    • Id (string) -- Optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID.

    • Event (string) -- Bucket event for which to send notifications.

    • Events (list) --

      • (string) -- Bucket event for which to send notifications.

    • CloudFunction (string) --

    • InvocationRole (string) --

returns

None

PutBucketNotificationConfiguration (updated) Link ¶
Changes (request)
{'NotificationConfiguration': {'LambdaFunctionConfigurations': {'Events': {'s3:ObjectRemoved:*',
                                                                           's3:ObjectRemoved:Delete',
                                                                           's3:ObjectRemoved:DeleteMarkerCreated'}},
                               'QueueConfigurations': {'Events': {'s3:ObjectRemoved:*',
                                                                  's3:ObjectRemoved:Delete',
                                                                  's3:ObjectRemoved:DeleteMarkerCreated'}},
                               'TopicConfigurations': {'Events': {'s3:ObjectRemoved:*',
                                                                  's3:ObjectRemoved:Delete',
                                                                  's3:ObjectRemoved:DeleteMarkerCreated'}}}}

Enables notifications of specified events for a bucket.

Request Syntax

client.put_bucket_notification_configuration(
    Bucket='string',
    NotificationConfiguration={
        'TopicConfigurations': [
            {
                'Id': 'string',
                'TopicArn': 'string',
                'Events': [
                    's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated',
                ]
            },
        ],
        'QueueConfigurations': [
            {
                'Id': 'string',
                'QueueArn': 'string',
                'Events': [
                    's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated',
                ]
            },
        ],
        'LambdaFunctionConfigurations': [
            {
                'Id': 'string',
                'LambdaFunctionArn': 'string',
                'Events': [
                    's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload'|'s3:ObjectRemoved:*'|'s3:ObjectRemoved:Delete'|'s3:ObjectRemoved:DeleteMarkerCreated',
                ]
            },
        ]
    }
)
type Bucket

string

param Bucket

[REQUIRED]

type NotificationConfiguration

dict

param NotificationConfiguration

[REQUIRED] Container for specifying the notification configuration of the bucket. If this element is empty, notifications are turned off on the bucket.

  • TopicConfigurations (list) --

    • (dict) -- Container for specifying the configuration when you want Amazon S3 to publish events to an Amazon Simple Notification Service (Amazon SNS) topic.

      • Id (string) -- Optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID.

      • TopicArn (string) -- [REQUIRED] Amazon SNS topic ARN to which Amazon S3 will publish a message when it detects events of specified type.

      • Events (list) -- [REQUIRED]

        • (string) -- Bucket event for which to send notifications.

  • QueueConfigurations (list) --

    • (dict) -- Container for specifying an configuration when you want Amazon S3 to publish events to an Amazon Simple Queue Service (Amazon SQS) queue.

      • Id (string) -- Optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID.

      • QueueArn (string) -- [REQUIRED] Amazon SQS queue ARN to which Amazon S3 will publish a message when it detects events of specified type.

      • Events (list) -- [REQUIRED]

        • (string) -- Bucket event for which to send notifications.

  • LambdaFunctionConfigurations (list) --

    • (dict) -- Container for specifying the AWS Lambda notification configuration.

      • Id (string) -- Optional unique identifier for configurations in a notification configuration. If you don't provide one, Amazon S3 will assign an ID.

      • LambdaFunctionArn (string) -- [REQUIRED] Lambda cloud function ARN that Amazon S3 can invoke when it detects events of the specified type.

      • Events (list) -- [REQUIRED]

        • (string) -- Bucket event for which to send notifications.

returns

None

PutObject (updated) Link ¶
Changes (request, response)
Request
{'ServerSideEncryption': {'aws:kms'}, 'StorageClass': {'LT'}}
Response
{'ServerSideEncryption': {'aws:kms'}}

Adds an object to a bucket.

Request Syntax

client.put_object(
    ACL='private'|'public-read'|'public-read-write'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control',
    Body=b'bytes'|file,
    Bucket='string',
    CacheControl='string',
    ContentDisposition='string',
    ContentEncoding='string',
    ContentLanguage='string',
    ContentLength=123,
    ContentMD5='string',
    ContentType='string',
    Expires=datetime(2015, 1, 1),
    GrantFullControl='string',
    GrantRead='string',
    GrantReadACP='string',
    GrantWriteACP='string',
    Key='string',
    Metadata={
        'string': 'string'
    },
    ServerSideEncryption='AES256'|'aws:kms',
    StorageClass='STANDARD'|'REDUCED_REDUNDANCY'|'LT',
    WebsiteRedirectLocation='string',
    SSECustomerAlgorithm='string',
    SSECustomerKey=b'bytes',
    SSECustomerKeyMD5='string',
    SSEKMSKeyId='string',
    RequestPayer='requester'
)
type ACL

string

param ACL

The canned ACL to apply to the object.

type Body

bytes or seekable file-like object

param Body

Object data.

type Bucket

string

param Bucket

[REQUIRED]

type CacheControl

string

param CacheControl

Specifies caching behavior along the request/reply chain.

type ContentDisposition

string

param ContentDisposition

Specifies presentational information for the object.

type ContentEncoding

string

param ContentEncoding

Specifies what content encodings have been applied to the object and thus what decoding mechanisms must be applied to obtain the media-type referenced by the Content-Type header field.

type ContentLanguage

string

param ContentLanguage

The language the content is in.

type ContentLength

integer

param ContentLength

Size of the body in bytes. This parameter is useful when the size of the body cannot be determined automatically.

type ContentMD5

string

param ContentMD5

type ContentType

string

param ContentType

A standard MIME type describing the format of the object data.

type Expires

datetime

param Expires

The date and time at which the object is no longer cacheable.

type GrantFullControl

string

param GrantFullControl

Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object.

type GrantRead

string

param GrantRead

Allows grantee to read the object data and its metadata.

type GrantReadACP

string

param GrantReadACP

Allows grantee to read the object ACL.

type GrantWriteACP

string

param GrantWriteACP

Allows grantee to write the ACL for the applicable object.

type Key

string

param Key

[REQUIRED]

type Metadata

dict

param Metadata

A map of metadata to store with the object in S3.

  • (string) --

    • (string) --

type ServerSideEncryption

string

param ServerSideEncryption

The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms).

type StorageClass

string

param StorageClass

The type of storage to use for the object. Defaults to 'STANDARD'.

type WebsiteRedirectLocation

string

param WebsiteRedirectLocation

If the bucket is configured as a website, redirects requests for this object to another object in the same bucket or to an external URL. Amazon S3 stores the value of this header in the object metadata.

type SSECustomerAlgorithm

string

param SSECustomerAlgorithm

Specifies the algorithm to use to when encrypting the object (e.g., AES256).

type SSECustomerKey

bytes

param SSECustomerKey

Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm header.

type SSECustomerKeyMD5

string

param SSECustomerKeyMD5

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.

type SSEKMSKeyId

string

param SSEKMSKeyId

Specifies the AWS KMS key ID to use for object encryption. All GET and PUT requests for an object protected by AWS KMS will fail if not made via SSL or using SigV4. Documentation on configuring any of the officially supported AWS SDKs and CLI can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version

type RequestPayer

string

param RequestPayer

Confirms that the requester knows that she or he will be charged for the request. Bucket owners need not specify this parameter in their requests. Documentation on downloading objects from requester pays buckets can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html

rtype

dict

returns

Response Syntax

{
    'Expiration': 'string',
    'ETag': 'string',
    'ServerSideEncryption': 'AES256'|'aws:kms',
    'VersionId': 'string',
    'SSECustomerAlgorithm': 'string',
    'SSECustomerKeyMD5': 'string',
    'SSEKMSKeyId': 'string',
    'RequestCharged': 'requester'
}

Response Structure

  • (dict) --

    • Expiration (string) -- If the object expiration is configured, this will contain the expiration date (expiry-date) and rule ID (rule-id). The value of rule-id is URL encoded.

    • ETag (string) -- Entity tag for the uploaded object.

    • ServerSideEncryption (string) -- The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms).

    • VersionId (string) -- Version of the object.

    • SSECustomerAlgorithm (string) -- If server-side encryption with a customer-provided encryption key was requested, the response will include this header confirming the encryption algorithm used.

    • SSECustomerKeyMD5 (string) -- If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide round trip message integrity verification of the customer-provided encryption key.

    • SSEKMSKeyId (string) -- If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used for the object.

    • RequestCharged (string) -- If present, indicates that the requester was successfully charged for the request.

UploadPart (updated) Link ¶
Changes (response)
{'ServerSideEncryption': {'aws:kms'}}

Uploads a part in a multipart upload.

Note: After you initiate multipart upload and upload one or more parts, you must either complete or abort multipart upload in order to stop getting charged for storage of the uploaded parts. Only after you either complete or abort multipart upload, Amazon S3 frees up the parts storage and stops charging you for the parts storage.

Request Syntax

client.upload_part(
    Body=b'bytes'|file,
    Bucket='string',
    ContentLength=123,
    ContentMD5='string',
    Key='string',
    PartNumber=123,
    UploadId='string',
    SSECustomerAlgorithm='string',
    SSECustomerKey=b'bytes',
    SSECustomerKeyMD5='string',
    RequestPayer='requester'
)
type Body

bytes or seekable file-like object

param Body

type Bucket

string

param Bucket

[REQUIRED]

type ContentLength

integer

param ContentLength

Size of the body in bytes. This parameter is useful when the size of the body cannot be determined automatically.

type ContentMD5

string

param ContentMD5

type Key

string

param Key

[REQUIRED]

type PartNumber

integer

param PartNumber

[REQUIRED] Part number of part being uploaded. This is a positive integer between 1 and 10,000.

type UploadId

string

param UploadId

[REQUIRED] Upload ID identifying the multipart upload whose part is being uploaded.

type SSECustomerAlgorithm

string

param SSECustomerAlgorithm

Specifies the algorithm to use to when encrypting the object (e.g., AES256).

type SSECustomerKey

bytes

param SSECustomerKey

Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm header. This must be the same encryption key specified in the initiate multipart upload request.

type SSECustomerKeyMD5

string

param SSECustomerKeyMD5

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.

type RequestPayer

string

param RequestPayer

Confirms that the requester knows that she or he will be charged for the request. Bucket owners need not specify this parameter in their requests. Documentation on downloading objects from requester pays buckets can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html

rtype

dict

returns

Response Syntax

{
    'ServerSideEncryption': 'AES256'|'aws:kms',
    'ETag': 'string',
    'SSECustomerAlgorithm': 'string',
    'SSECustomerKeyMD5': 'string',
    'SSEKMSKeyId': 'string',
    'RequestCharged': 'requester'
}

Response Structure

  • (dict) --

    • ServerSideEncryption (string) -- The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms).

    • ETag (string) -- Entity tag for the uploaded object.

    • SSECustomerAlgorithm (string) -- If server-side encryption with a customer-provided encryption key was requested, the response will include this header confirming the encryption algorithm used.

    • SSECustomerKeyMD5 (string) -- If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide round trip message integrity verification of the customer-provided encryption key.

    • SSEKMSKeyId (string) -- If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used for the object.

    • RequestCharged (string) -- If present, indicates that the requester was successfully charged for the request.

UploadPartCopy (updated) Link ¶
Changes (response)
{'ServerSideEncryption': {'aws:kms'}}

Uploads a part by copying data from an existing object as data source.

Request Syntax

client.upload_part_copy(
    Bucket='string',
    CopySource='string',
    CopySourceIfMatch='string',
    CopySourceIfModifiedSince=datetime(2015, 1, 1),
    CopySourceIfNoneMatch='string',
    CopySourceIfUnmodifiedSince=datetime(2015, 1, 1),
    CopySourceRange='string',
    Key='string',
    PartNumber=123,
    UploadId='string',
    SSECustomerAlgorithm='string',
    SSECustomerKey=b'bytes',
    SSECustomerKeyMD5='string',
    CopySourceSSECustomerAlgorithm='string',
    CopySourceSSECustomerKey=b'bytes',
    CopySourceSSECustomerKeyMD5='string',
    RequestPayer='requester'
)
type Bucket

string

param Bucket

[REQUIRED]

type CopySource

string

param CopySource

[REQUIRED] The name of the source bucket and key name of the source object, separated by a slash (/). Must be URL-encoded.

type CopySourceIfMatch

string

param CopySourceIfMatch

Copies the object if its entity tag (ETag) matches the specified tag.

type CopySourceIfModifiedSince

datetime

param CopySourceIfModifiedSince

Copies the object if it has been modified since the specified time.

type CopySourceIfNoneMatch

string

param CopySourceIfNoneMatch

Copies the object if its entity tag (ETag) is different than the specified ETag.

type CopySourceIfUnmodifiedSince

datetime

param CopySourceIfUnmodifiedSince

Copies the object if it hasn't been modified since the specified time.

type CopySourceRange

string

param CopySourceRange

The range of bytes to copy from the source object. The range value must use the form bytes=first-last, where the first and last are the zero-based byte offsets to copy. For example, bytes=0-9 indicates that you want to copy the first ten bytes of the source. You can copy a range only if the source object is greater than 5 GB.

type Key

string

param Key

[REQUIRED]

type PartNumber

integer

param PartNumber

[REQUIRED] Part number of part being copied. This is a positive integer between 1 and 10,000.

type UploadId

string

param UploadId

[REQUIRED] Upload ID identifying the multipart upload whose part is being copied.

type SSECustomerAlgorithm

string

param SSECustomerAlgorithm

Specifies the algorithm to use to when encrypting the object (e.g., AES256).

type SSECustomerKey

bytes

param SSECustomerKey

Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm header. This must be the same encryption key specified in the initiate multipart upload request.

type SSECustomerKeyMD5

string

param SSECustomerKeyMD5

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.

type CopySourceSSECustomerAlgorithm

string

param CopySourceSSECustomerAlgorithm

Specifies the algorithm to use when decrypting the source object (e.g., AES256).

type CopySourceSSECustomerKey

bytes

param CopySourceSSECustomerKey

Specifies the customer-provided encryption key for Amazon S3 to use to decrypt the source object. The encryption key provided in this header must be one that was used when the source object was created.

type CopySourceSSECustomerKeyMD5

string

param CopySourceSSECustomerKeyMD5

Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure the encryption key was transmitted without error.

type RequestPayer

string

param RequestPayer

Confirms that the requester knows that she or he will be charged for the request. Bucket owners need not specify this parameter in their requests. Documentation on downloading objects from requester pays buckets can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html

rtype

dict

returns

Response Syntax

{
    'CopySourceVersionId': 'string',
    'CopyPartResult': {
        'ETag': 'string',
        'LastModified': datetime(2015, 1, 1)
    },
    'ServerSideEncryption': 'AES256'|'aws:kms',
    'SSECustomerAlgorithm': 'string',
    'SSECustomerKeyMD5': 'string',
    'SSEKMSKeyId': 'string',
    'RequestCharged': 'requester'
}

Response Structure

  • (dict) --

    • CopySourceVersionId (string) -- The version of the source object that was copied, if you have enabled versioning on the source bucket.

    • CopyPartResult (dict) --

      • ETag (string) -- Entity tag of the object.

      • LastModified (datetime) -- Date and time at which the object was uploaded.

    • ServerSideEncryption (string) -- The Server-side encryption algorithm used when storing this object in S3 (e.g., AES256, aws:kms).

    • SSECustomerAlgorithm (string) -- If server-side encryption with a customer-provided encryption key was requested, the response will include this header confirming the encryption algorithm used.

    • SSECustomerKeyMD5 (string) -- If server-side encryption with a customer-provided encryption key was requested, the response will include this header to provide round trip message integrity verification of the customer-provided encryption key.

    • SSEKMSKeyId (string) -- If present, specifies the ID of the AWS Key Management Service (KMS) master encryption key that was used for the object.

    • RequestCharged (string) -- If present, indicates that the requester was successfully charged for the request.