Hitachi Content Platform​

 View Only

 Bucket size via API call

Torbjorn Migchelsen's profile image
Torbjorn Migchelsen posted 02-22-2023 04:45

In the GUI, "S3 Console", of the HCP for Cloud Scale the total size of a bucket is show (i.e. including all versions). Is there a way to obtain this information with an API call?

I know you can do this with an aws s3api call listing the content and adding it upp with jq but since the data is already there it seems like a roundabout way of getting it and can be rather time consuming if it is a large bucket.

Bernard Lam's profile image
Bernard Lam

You can get this via management api get chargeback report:
https://knowledge.hitachivantara.com/Documents/Storage/HCP_for_Cloud_Scale/2.2.x/Management_API_Reference/04_Administrative_management_methods
or Grafana:
sum by (bucket)(metadata_total_bytes_per_bucket{})