5 .. versionadded:: Nautilus
9 Bucket notifications provide a mechanism for sending information out of the radosgw when certain events are happening on the bucket.
10 Currently, notifications could be sent to HTTP and AMQP0.9.1 endpoints.
12 Note, that if the events should be stored in Ceph, in addition, or instead of being pushed to an endpoint,
13 the `PubSub Module`_ should be used instead of the bucket notification mechanism.
15 A user can create different topics. A topic entity is defined by its user and its name. A
16 user can only manage its own topics, and can only associate them with buckets it owns.
18 In order to send notifications for events for a specific bucket, a notification entity needs to be created. A
19 notification can be created on a subset of event types, or for all event types (default).
20 The notification may also filter out events based on preffix/suffix and/or regular expression matching of the keys. As well as,
21 on the metadata attributes attached to the object.
22 There can be multiple notifications for any specific topic, and the same topic could be used for multiple notifications.
24 REST API has been defined to provide configuration and control interfaces for the bucket notification
25 mechanism. This API is similar to the one defined as S3-compatible API of the pubsub sync module.
30 S3 Bucket Notification Compatibility <s3-notification-compatibility>
32 Notificatios Performance Stats
33 ------------------------------
34 Same counters are shared between the pubsub sync module and the bucket notification mechanism.
36 - ``pubsub_event_triggered``: running counter of events with at lease one topic associated with them
37 - ``pubsub_event_lost``: running counter of events that had topics associated with them but that were not pushed to any of the endpoints
38 - ``pubsub_push_ok``: running counter, for all notifications, of events successfully pushed to their endpoint
39 - ``pubsub_push_fail``: running counter, for all notifications, of events failed to be pushed to their endpoint
40 - ``pubsub_push_pending``: gauge value of events pushed to an endpoint but not acked or nacked yet
44 ``pubsub_event_triggered`` and ``pubsub_event_lost`` are incremented per event, while:
45 ``pubsub_push_ok``, ``pubsub_push_fail``, are incremented per push action on each notification.
47 Bucket Notification REST API
48 ----------------------------
56 This will create a new topic. The topic should be provided with push endpoint parameters that would be used later
57 when a notification is created.
58 Upon successful request, the response will include the topic ARN that could be later used to reference this topic in the notification request.
59 To update a topic, use the same command used for topic creation, with the topic name of an existing topic and different endpoint values.
61 .. tip:: Any notification already associated with the topic needs to be re-created for the topic update to take effect
68 &push-endpoint=<endpoint>
69 [&Attributes.entry.1.key=amqp-exchange&Attributes.entry.1.value=<exchange>]
70 [&Attributes.entry.2.key=amqp-sck-level&Attributes.entry.2.value=ack-level]
71 &Attributes.entry.3.key=verify-sll&Attributes.entry.3.value=true|false]
75 - push-endpoint: URI of endpoint to send push notification to
77 - URI schema is: ``http[s]|amqp://[<user>:<password>@]<fqdn>[:<port>][/<amqp-vhost>]``
78 - Same schema is used for HTTP and AMQP endpoints (except amqp-vhost which is specific to AMQP)
79 - Default values for HTTP/S: no user/password, port 80/443
80 - Default values for AMQP: user/password=guest/guest, port 5672, amqp-vhost is "/"
82 - verify-ssl: can be used with https endpoints (ignored for other endpoints), indicate whether the server certificate is validated or not ("true" by default)
83 - amqp-exchange: mandatory parameter for AMQP endpoint. The exchanges must exist and be able to route messages based on topics
84 - amqp-ack-level: No end2end acking is required, as messages may persist in the broker before delivered into their final destination. 2 ack methods exist:
86 - "none" - message is considered "delivered" if sent to broker
87 - "broker" message is considered "delivered" if acked by broker
91 - The key/value of a specific parameter does not have to reside in the same line, or in any specific order, but must use the same index
92 - Attribute indexing does not need to be sequntial or start from any specific value
93 - `AWS Create Topic`_ has detailed explanation on endpoint attributes format. However, in our case different keys and values are used
95 The response will have the following format:
99 <CreateTopicResponse xmlns="https://sns.amazonaws.com/doc/2010-03-31/">
101 <TopicArn></TopicArn>
104 <RequestId></RequestId>
106 </CreateTopicResponse>
108 The topic ARN in the response will have the following format:
112 arn:aws:sns:<zone-group>:<tenant>:<topic>
114 Get Topic Information
115 `````````````````````
117 Returns information about specific topic. This includes push-endpoint information, if provided.
122 Action=GetTopic&TopicArn=<topic-arn>
124 Response will have the following format:
134 <EndpointAddress></EndpointAddress>
135 <EndpointArgs></EndpointArgs>
136 <EndpointTopic></EndpointTopic>
138 <TopicArn></TopicArn>
142 <RequestId></RequestId>
146 - User: name of the user that created the topic
147 - Name: name of the topic
148 - EndPoinjtAddress: the push-endpoint URL
149 - EndPointArgs: the push-endpoint args
150 - EndpointTopic: the topic name that should be sent to the endpoint (mat be different than the above topic name)
151 - TopicArn: topic ARN
159 Action=DeleteTopic&TopicArn=<topic-arn>
161 Delete the specified topic. Note that deleting a deleted topic should result with no-op and not a failure.
163 The response will have the following format:
167 <DeleteTopicResponse xmlns="https://sns.amazonaws.com/doc/2010-03-31/">
169 <RequestId></RequestId>
171 </DeleteTopicResponse>
176 List all topics that user defined.
183 Response will have the following format:
187 <ListTopicdResponse xmlns="https://sns.amazonaws.com/doc/2010-03-31/">
194 <EndpointAddress></EndpointAddress>
195 <EndpointArgs></EndpointArgs>
196 <EndpointTopic></EndpointTopic>
198 <TopicArn></TopicArn>
203 <RequestId></RequestId>
205 </ListTopicsResponse>
210 Detailed under: `Bucket Operations`_.
214 - "Abort Multipart Upload" request does not emit a notification
215 - "Delete Multiple Objects" request does not emit a notification
216 - Both "Initiate Multipart Upload" and "POST Object" requests will emit an ``s3:ObjectCreated:Post`` notification
222 The events are in JSON format (regardless of the actual endpoint), and share the same structure as the S3-compatible events
223 pushed or pulled using the pubsub sync module.
230 "eventSource":"aws:s3",
237 "requestParameters":{
241 "x-amz-request-id":"",
245 "s3SchemaVersion":"1.0",
246 "configurationId":"",
268 - awsRegion: zonegroup
269 - eventTime: timestamp indicating when the event was triggered
270 - eventName: for list of supported events see: `S3 Notification Compatibility`_
271 - userIdentity.principalId: user that triggered the change
272 - requestParameters.sourceIPAddress: not supported
273 - responseElements.x-amz-request-id: request ID of the original change
274 - responseElements.x_amz_id_2: RGW on which the change was made
275 - s3.configurationId: notification ID that created the event
276 - s3.bucket.name: name of the bucket
277 - s3.bucket.ownerIdentity.principalId: owner of the bucket
278 - s3.bucket.arn: ARN of the bucket
279 - s3.bucket.id: Id of the bucket (an extension to the S3 notification API)
280 - s3.object.key: object key
281 - s3.object.size: object size
282 - s3.object.eTag: object etag
283 - s3.object.version: object version in case of versioned bucket
284 - s3.object.sequencer: monotonically increasing identifier of the change per object (hexadecimal format)
285 - s3.object.metadata: any metadata set on the object sent as: ``x-amz-meta-`` (an extension to the S3 notification API)
286 - s3.eventId: not supported (an extension to the S3 notification API)
288 .. _PubSub Module : ../pubsub-module
289 .. _S3 Notification Compatibility: ../s3-notification-compatibility
290 .. _AWS Create Topic: https://docs.aws.amazon.com/sns/latest/api/API_CreateTopic.html
291 .. _Bucket Operations: ../s3/bucketops