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

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

问题描述

除非我遗漏了一些东西,否则我看过的所有 API 似乎都不会告诉您 /<文件夹> 中有多少对象.有什么办法可以计数吗?

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>. 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!

如果您存储了 5000 万个对象,那么简单地下载所有对象的列表实际上需要一些时间和成本.

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天全站免登陆