-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Space size #49
Comments
Hey, $my_space = Spaces("ACCESS KEY", "SECRET KEY")->space("my_space", "nyc3");
$size = 0;
foreach ($my_space->listFiles() as $file) {
$size += $file["Size"];
}
//$size should hold the total bucket total size. |
Thanks for the quick reply. The way you mentioned will do the job but if I have huge objects in the space, it will be a pain. Anyway, thanks again. I will make a cron/queue process to maintain space size. |
Yes, I know. Unfortunately, this is the only method possible because I don't think there is a general object that lets you know the total size of a Space, and DigitalOcean's own API has no references to it either. Another thing you could do is keep a tally of total size in your own database (Increased whenever you upload an object, decreased whenever you delete one). |
Is there any way to get total space used in a space using your API?
The text was updated successfully, but these errors were encountered: