如何知道我在S3存储桶中存储了多少对象? [英] How can I tell how many objects I've stored in an S3 bucket?

查看:1598
本文介绍了如何知道我在S3存储桶中存储了多少对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除非我缺少一些东西,似乎没有一个我看过的API会告诉你有多少对象在一个S3桶/文件夹(前缀)。

Unless I'm missing something, it seems that none of the APIs I've looked at will tell you how many objects are in an S3 bucket / folder(prefix). Is there any way to get a count?

推荐答案

没有办法,除非你


  1. 全部以1000个批次列出(这可能很慢,吸引带宽 - 亚马逊似乎从不压缩XML响应),或

  1. list them all in batches of 1000 (which can be slow and suck bandwidth - amazon seems to never compress the XML responses), or

在S3上登录您的帐户,然后转到帐户 - 使用。看来,帐单部门知道您已经存储了多少对象!

log into your account on S3, and go Account - Usage. It seems the billing dept knows exactly how many objects you have stored!

只需下载所有对象的列表

Simply downloading the list of all your objects will actually take some time and cost some money if you have 50 million objects stored.

另请参阅关于StorageObjectCount的此主题 - 在使用数据中。

Also see this thread about StorageObjectCount - which is in the usage data.

S3 API来获得至少的基础知识,即使它是小时,将是巨大的。

An S3 API to get at least the basics, even if it was hours old, would be great.

这篇关于如何知道我在S3存储桶中存储了多少对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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