新S3对象的通知 [英] Notification of new S3 objects

查看:258
本文介绍了新S3对象的通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个塞纳里奥,我们有许多客户端上传到S3。我的问题是什么是要知道,有一个新的文件的最佳方法。它是现实/好主意,让我永远轮询斗几秒钟?

I have a senario where we have many clients uploading to s3. My question is what is the best approach to knowing that there is a new file. Is it realistic/good idea, for me to poll the bucket ever few seconds?

推荐答案

更新:

自2014年十一月,S3支持以​​下事件通知:

Since November 2014, S3 supports the following event notifications:

  • S3:ObjectCreated:把 - 一个对象是由一个HTTP PUT操作创建
  • S3:ObjectCreated:帖子 - 一个对象是由HTTP POST操作创建
  • S3:ObjectCreated:复制 - 一个对象被创建的S3复制操作
  • S3:ObjectCreated:CompleteMultipartUpload - 一个对象由完成S3多部分上传的创建
  • S3:ObjectCreated:* - 一个对象已经由以上或在未来增加了一个类似的对象创建事件中列出的事件类型之一创建
  • S3:ReducedRedundancyObjectLost - 存储的精简冗余的S3对象已丢失
  • s3:ObjectCreated:Put – An object was created by an HTTP PUT operation.
  • s3:ObjectCreated:Post – An object was created by HTTP POST operation.
  • s3:ObjectCreated:Copy – An object was created an S3 copy operation.
  • s3:ObjectCreated:CompleteMultipartUpload – An object was created by the completion of a S3 multi-part upload.
  • s3:ObjectCreated:* – An object was created by one of the event types listed above or by a similar object creation event added in the future.
  • s3:ReducedRedundancyObjectLost – An S3 object stored with Reduced Redundancy has been lost.

这些通知可以发给亚马逊SNS ,的 SQS LAMBDA 。检查出在阿兰的回答链接了解关于这些新通知的详细信息,博客帖子。

These notifications can be issued to Amazon SNS, SQS or Lambda. Check out the blog post that's linked in Alan's answer for more information on these new notifications.

原来的答案:

尽管亚马逊S3有一个桶的通知制度,它不支持通知的任何东西,但 S3:ReducedRedundancyLostObject 的事件(见的获取桶的通知的在他们的API部分)。

Although Amazon S3 has a bucket notifications system in place it does not support notifications for anything but the s3:ReducedRedundancyLostObject event (see the GET Bucket notification section in their API).

目前,以检查是否有新对象的唯一方法是轮询桶在preset的时间间隔,或建立自己的通知逻辑上传客户端(可能基于亚马逊SNS)。

Currently the only way to check for new objects is to poll the bucket at a preset time interval or build your own notification logic in the upload clients (possibly based on Amazon SNS).

这篇关于新S3对象的通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆