Skip to content
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

[QUERY] How to get total count of blobs size in a container? #40089

Closed
kirankumar994 opened this issue May 9, 2024 · 3 comments
Closed

[QUERY] How to get total count of blobs size in a container? #40089

kirankumar994 opened this issue May 9, 2024 · 3 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage Storage Service (Queues, Blobs, Files)

Comments

@kirankumar994
Copy link

Hi,

I have a requirement to get the sum of all blobs size for each container. I know I can calculate the size by listing all blobs and summing up all of them to get the container size, but that is too complex on the code level as each blob can have lot of versions and soft deleted blobs within the container etc. I would like to know if there is any way, where in i can just make one api call per container to get the total size of the container (sum of all blobs size)?

Thanks in advance.

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage Storage Service (Queues, Blobs, Files) labels May 9, 2024
Copy link

github-actions bot commented May 9, 2024

Copy link

github-actions bot commented May 9, 2024

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@ibrahimrabab
Copy link
Contributor

Hi @kirankumar994
There isn't an API available today that you can use to get a total count of all blobs in the container. You can specify whether you want to include deleted blobs or versioned blobs when calling listBlobs(ListBlobsOptions, String, Duration). Please take a look at ListBlobsOptions and BlobListDetails,

https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/ListBlobsOptions.java

https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/models/BlobListDetails.java

Let me know if this helps or if you have any further questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

2 participants