Amazon Simple Storage Service

2015/06/04 - Amazon Simple Storage Service - 5 updated api methods

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

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',
        ],
        'Event': 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload',
        'Topic': 'string'
    },
    'QueueConfiguration': {
        'Id': 'string',
        'Event': 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload',
        'Events': [
            's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload',
        ],
        'Queue': 'string'
    },
    'CloudFunctionConfiguration': {
        'Id': 'string',
        'Event': 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload',
        'Events': [
            's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload',
        ],
        '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:ObjectCreated:*'}},
 'QueueConfigurations': {'Events': {'s3:ObjectCreated:*'}},
 'TopicConfigurations': {'Events': {'s3:ObjectCreated:*'}}}

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',
            ]
        },
    ],
    'QueueConfigurations': [
        {
            'Id': 'string',
            'QueueArn': 'string',
            'Events': [
                's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload',
            ]
        },
    ],
    'LambdaFunctionConfigurations': [
        {
            'Id': 'string',
            'LambdaFunctionArn': 'string',
            'Events': [
                's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload',
            ]
        },
    ]
}

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)
{'ContentRange': 'string'}

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='string',
    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

string

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',
    'Metadata': {
        'string': 'string'
    },
    'SSECustomerAlgorithm': 'string',
    'SSECustomerKeyMD5': 'string',
    'SSEKMSKeyId': 'string',
    '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.

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

    • ReplicationStatus (string) --

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

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',
            ],
            'Event': 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload',
            'Topic': 'string'
        },
        'QueueConfiguration': {
            'Id': 'string',
            'Event': 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload',
            'Events': [
                's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload',
            ],
            'Queue': 'string'
        },
        'CloudFunctionConfiguration': {
            'Id': 'string',
            'Event': 's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload',
            'Events': [
                's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload',
            ],
            '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:ObjectCreated:*'}},
                               'QueueConfigurations': {'Events': {'s3:ObjectCreated:*'}},
                               'TopicConfigurations': {'Events': {'s3:ObjectCreated:*'}}}}

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',
                ]
            },
        ],
        'QueueConfigurations': [
            {
                'Id': 'string',
                'QueueArn': 'string',
                'Events': [
                    's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload',
                ]
            },
        ],
        'LambdaFunctionConfigurations': [
            {
                'Id': 'string',
                'LambdaFunctionArn': 'string',
                'Events': [
                    's3:ReducedRedundancyLostObject'|'s3:ObjectCreated:*'|'s3:ObjectCreated:Put'|'s3:ObjectCreated:Post'|'s3:ObjectCreated:Copy'|'s3:ObjectCreated:CompleteMultipartUpload',
                ]
            },
        ]
    }
)
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