简体   繁体   English

有没有办法使用boto3获得总的AWS S3存储桶PUT成本?

[英]Is there a way to get total AWS S3 bucket PUT costs using boto3?

I am trying to calculate the costs of a S3 bucket using boto3. 我正在尝试使用boto3计算S3存储桶的成本。 For the size, I am using list_objects(bucketname)['contents']. 对于大小,我使用list_objects(bucketname)['contents']。

Is there a way I can get the total PUT costs or total PUT requests for the bucket? 有没有办法可以获得桶的总PUT成本或总PUT请求? Any API's that support this? 任何API支持这个?

Thanks 谢谢

You should be using cloudwatch metrics for identifying put requests. 您应该使用cloudwatch指标来识别放置请求。 for details refer cloudwatch for S3 有关详细信息,请参阅cloudwatch for S3

aws cloudwatch list-metrics --namespace "AWS/S3"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM