Skip to content

Commit 52e12c8

Browse files
vadmesteharshavardhana
authored andcommitted
listen: Add support for HEAD/GET bucket events (minio#634)
1 parent 29b0515 commit 52e12c8

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

bucket-notification.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@ type NotificationEventType string
2828
// http://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html#notification-how-to-event-types-and-destinations
2929
const (
3030
ObjectCreatedAll NotificationEventType = "s3:ObjectCreated:*"
31-
ObjectCreatePut = "s3:ObjectCreated:Put"
31+
ObjectCreatedPut = "s3:ObjectCreated:Put"
3232
ObjectCreatedPost = "s3:ObjectCreated:Post"
3333
ObjectCreatedCopy = "s3:ObjectCreated:Copy"
34-
ObjectCreatedCompleteMultipartUpload = "sh:ObjectCreated:CompleteMultipartUpload"
34+
ObjectCreatedCompleteMultipartUpload = "s3:ObjectCreated:CompleteMultipartUpload"
35+
ObjectAccessedGet = "s3:ObjectAccessed:Get"
36+
ObjectAccessedHead = "s3:ObjectAccessed:Head"
37+
ObjectAccessedAll = "s3:ObjectAccessed:*"
3538
ObjectRemovedAll = "s3:ObjectRemoved:*"
3639
ObjectRemovedDelete = "s3:ObjectRemoved:Delete"
3740
ObjectRemovedDeleteMarkerCreated = "s3:ObjectRemoved:DeleteMarkerCreated"

docs/API.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,7 @@ defer close(doneCh)
12291229
// Listen for bucket notifications on "mybucket" filtered by prefix, suffix and events.
12301230
for notificationInfo := range minioClient.ListenBucketNotification("YOUR-BUCKET", "PREFIX", "SUFFIX", []string{
12311231
"s3:ObjectCreated:*",
1232+
"s3:ObjectAccessed:*",
12321233
"s3:ObjectRemoved:*",
12331234
}, doneCh) {
12341235
if notificationInfo.Err != nil {

examples/minio/listenbucketnotification.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ func main() {
4949
// Listen for bucket notifications on "mybucket" filtered by prefix, suffix and events.
5050
for notificationInfo := range minioClient.ListenBucketNotification("YOUR-BUCKET", "PREFIX", "SUFFIX", []string{
5151
"s3:ObjectCreated:*",
52+
"s3:ObjectAccessed:*",
5253
"s3:ObjectRemoved:*",
5354
}, doneCh) {
5455
if notificationInfo.Err != nil {

0 commit comments

Comments
 (0)