Obtaining Storage Information About a Bucket
If you have any questions during development, post them on the Issues page of GitHub. For details about parameters and usage of each API, see the API Reference
The storage information about a bucket includes the used capacity of and the number of objects in the bucket. You can call ObsClient.getBucketStorageInfo to obtain the bucket storage information. Sample code is as follows:
String endPoint = "https://your-endpoint";
String ak = "*** Provide your Access Key ***";
String sk = "*** Provide your Secret Key ***";
// Create an instance of ObsClient.
ObsClient obsClient = new ObsClient(ak, sk, endPoint);
BucketStorageInfo storageInfo = obsClient.getBucketStorageInfo("bucketname");
System.out.println("\t" + storageInfo.getObjectNumber());
System.out.println("\t" + storageInfo.getSize());
Last Article: Obtaining a Bucket Location
Next Article: Setting or Obtaining a Bucket Quota
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.