>=16.0.0
--------
-* RGW: S3 bucket notification events now contain `eTag` instead of `etag`, fixing
- a deviation from the message format observed on AWS.
+* RGW: S3 bucket notification events now contain an `eTag` key instead of `etag`,
+ and eventName values no longer carry the `s3:` prefix, fixing deviations from
+ the message format observed on AWS.
* `ceph-mgr-modules-core` debian package does not recommend `ceph-mgr-rook`
anymore. As the latter depends on `python3-numpy` which cannot be imported in
different Python sub-interpreters multi-times if the version of
"eventSource":"ceph:s3",
"awsRegion":"us-east-1",
"eventTime":"2019-11-22T13:47:35.124724Z",
- "eventName":"s3:ObjectCreated:Put",
+ "eventName":"ObjectCreated:Put",
"userIdentity":{
"principalId":"tester"
},
- awsRegion: zonegroup
- eventTime: timestamp indicating when the event was triggered
-- eventName: for list of supported events see: `S3 Notification Compatibility`_
+- eventName: for list of supported events see: `S3 Notification Compatibility`_. Note that the eventName values do not start with the `s3:` prefix.
- userIdentity.principalId: user that triggered the change
- requestParameters.sourceIPAddress: not supported
- responseElements.x-amz-request-id: request ID of the original change
rgw_pubsub_s3_event& event) {
const auto s = res.s;
event.eventTime = mtime;
- event.eventName = to_string(event_type);
+ event.eventName = to_event_string(event_type);
event.userIdentity = s->user->get_id().id; // user that triggered the change
event.x_amz_request_id = s->req_id; // request ID of the original change
event.x_amz_id_2 = s->host_id; // RGW on which the change was made
return "UNKNOWN_EVENT";
}
+ std::string to_event_string(EventType t) {
+ return to_string(t).substr(3);
+ }
+
EventType from_string(const std::string& s) {
if (s == "s3:ObjectCreated:*" || s == "OBJECT_CREATE")
return ObjectCreated;
std::string to_ceph_string(EventType t);
+ std::string to_event_string(EventType t);
+
EventType from_string(const std::string& s);
// create a vector of event types from comma separated list of event types
EventRef<rgw_pubsub_s3_event>& e = *event;
e->eventTime = mtime;
- e->eventName = rgw::notify::to_string(event_type);
+ e->eventName = rgw::notify::to_event_string(event_type);
// userIdentity: not supported in sync module
// x_amz_request_id: not supported in sync module
// x_amz_id_2: not supported in sync module
for record in record_list['Records']:
if record['s3']['bucket']['name'] == key.bucket.name and \
record['s3']['object']['key'] == key.name:
- if deletions and 'ObjectRemoved' in record['eventName']:
+ if deletions and record['eventName'].startswith('ObjectRemoved'):
key_found = True
object_size = record['s3']['object']['size']
break
- elif not deletions and 'ObjectCreated' in record['eventName']:
+ elif not deletions and record['eventName'].startswith('ObjectCreated'):
key_found = True
object_size = record['s3']['object']['size']
break
for record in records['Records']:
if record['s3']['bucket']['name'] == key.bucket.name and \
record['s3']['object']['key'] == key.name:
- if deletions and 'ObjectRemoved' in record['eventName']:
+ if deletions and record['eventName'].startswith('ObjectRemoved'):
key_found = True
object_size = record['s3']['object']['size']
break
- elif not deletions and 'ObjectCreated' in record['eventName']:
+ elif not deletions and record['eventName'].startswith('ObjectCreated'):
key_found = True
object_size = record['s3']['object']['size']
break