[英]Google storage bucket stats using Cloud Storage Client Libraries
I have a web application that creates/deletes buckets, uploads/downloads objects from google storage and I am successfully using Google Apis Storage v1 and v1.Data in C#. 我有一个Web应用程序,可以创建/删除存储桶,从Google存储空间上载/下载对象,并且我已经在C#中成功使用Google Apis Storage v1和v1.Data。
I would like to know if there is a way to find out how much space a bucket has used using the Google Apis. 我想知道是否有一种方法可以找出使用Google Apis的存储桶已使用了多少空间。 I was thinking something like StorageClient.GetBucket would return this information but it doesn't seem to.
我在想像StorageClient.GetBucket这样的东西会返回此信息,但似乎没有。
All the help documentation seems to point to the gsutil but I can't use that as this is for a web application. 所有帮助文档似乎都指向gsutil,但我不能使用它,因为这是针对Web应用程序的。 So to clarify I am using Cloud Storage Client Libraries
因此要澄清一下,我正在使用云存储客户端库
I want to be able to look at any given moment how much space has been used for a particular bucket, using the Google.Storage.Apis (which isn't the XML API or JSON API) 我希望能够在任何时候使用Google.Storage.Apis(不是XML API或JSON API)查看特定存储桶已使用了多少空间。
Any help would be very much appreciated. 任何帮助将不胜感激。
You can set up bucket logging per Bucket Logging Doc , which will generate a file once a day with the total size (in bytes) of the buckets you defined. 您可以为每个“ 存储桶日志记录文档”设置存储桶日志记录 ,这将每天生成一次文件,其中包含您定义的存储桶的总大小(以字节为单位)。
And you've created a feature request as FR/37237171 at the issue tracker. 您已经在问题跟踪器中创建了功能请求FR / 37237171 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.