Allow fetching bucket usage via API
We use JetBackup Storage to host offsite backups for our customers' servers, one bucket per server (70+ buckets on a Pay as You Go account). We need to monitor each bucket's size from our billing system: to warn customers near their quota, block writes when they exceed it and bill upgrades.
The Storage Console already shows the size and object count of every bucket (objectsSize), refreshed about hourly, but none of this is reachable with access keys. The only way through the S3 API is to list every object and sum the sizes: at roughly 1,000 objects every 2 seconds, our largest buckets (10-15 million objects) take up to 9 hours to measure, every time.
Request: an endpoint authenticated with the account's access keys (or IAM) that returns, per bucket, the stored bytes and the object count, i.e. the same figures the Storage Console shows. For example:
- an extension on HeadBucket returning size and object count headers, or
- a JSON endpoint listing all buckets of the account with their stats.
Nice to have: a hard storage quota per bucket or per IAM user, so that writes are refused once the limit is reached.
I like this idea
Replies have been locked on this page!