S3 create bucket notifications
Create bucket notifications at the bucket level. The notification configuration has the IBM Storage
Ceph Object Gateway S3 events,
ObjectCreated, ObjectRemoved, and
ObjectLifecycle:Expiration.
These need to be published and the destination to send the bucket notifications. Bucket notifications are S3 operations.
To create a bucket notification for s3:objectCreate,
s3:objectRemove, and s3:ObjectLifecycle:Expiration events, use
PUT:
Example
client.put_bucket_notification_configuration(
Bucket=bucket_name,
NotificationConfiguration={
'TopicConfigurations': [
{
'Id': notification_name,
'TopicArn': topic_arn,
'Events': ['s3:ObjectCreated:*', 's3:ObjectRemoved:*', 's3:ObjectLifecycle:Expiration:*']
}]})
ObjectCreate events, such as put,
post, multipartUpload, and copy are supported.
ObjectRemove events, such as object_delete and
s3_multi_object_delete are also supported.Request Entities
NotificationConfiguration
- Description
-
list of
TopicConfigurationentities. - Type
-
Container
- Required
-
Yes
TopicConfiguration
- Description
-
Id,Topic, andlistof Event entities. - Type
-
Container
- Required
-
Yes
id
- Description
-
Name of the notification.
- Type
-
String
- Required
-
Yes
Topic
- Description
-
Topic Amazon Resource Name(ARN)Note: The topic must be created beforehand.
- Type
-
String
- Required
-
Yes
Event
- Description
-
List of supported events. Multiple event entities can be used. If omitted, all events are handled.
- Type
-
String
- Required
-
No
Filter
- Description
-
S3Key,S3MetadataandS3Tagsentities. - Type
-
Container
- Required
-
No
S3Key
- Description
-
A list of
FilterRuleentities, for filtering based on the object key. At most, 3 entities may be in the list, for exampleNamewould beprefix,suffix, orregex. All filter rules in the list must match for the filter to match. - Type
-
Container
- Required
-
No
S3Metadata
- Description
-
A list of
FilterRuleentities, for filtering based on object metadata. All filter rules in the list must match the metadata defined on the object. However, the object still matches if it has other metadata entries not listed in the filter. - Type
-
Container
- Required
-
No
S3Tags
- Description
-
A list of
FilterRuleentities, for filtering based on object tags. All filter rules in the list must match the tags defined on the object. However, the object still matches if it has other tags not listed in the filter. - Type
-
Container
- Required
-
No
S3Key.FilterRule
- Description
-
NameandValueentities. Name is :prefix,suffix, orregex. TheValuewould hold the key prefix, key suffix, or a regular expression for matching the key, accordingly. - Type
-
Container
- Required
-
Yes
S3Metadata.FilterRule
- Description
-
NameandValueentities. Name is the name of the metadata attribute for examplex-amz-meta-xxx. The value is the expected value for this attribute. - Type
-
Container
- Required
-
Yes
S3Tags.FilterRule
- Description
-
NameandValueentities. Name is the tag key, and the value is the tag value. - Type
-
Container
- Required
-
Yes
HTTP response
400
- Status Code
-
MalformedXML - Description
-
The XML is not well-formed.
400
- Status Code
-
InvalidArgument - Description
-
Missing Id or missing or invalid topic ARN or invalid event.
404
- Status Code
-
NoSuchBucket - Description
-
The bucket does not exist.
404
- Status Code
-
NoSuchKey - Description
-
The topic does not exist.