Queries the storage capacity of a specified bucket and the number of objects that are stored in the bucket.

Usage notes

  • To call the GetBucketStat operation, you must have the oss:GetBucketStat permission.
  • Data obtained by calling this operation is not real-time data and may have a latency of over 1 hour.
  • The time information obtained by calling this operation may not be up-to-date. For example, the value of the LastModifiedTime field obtained by the current GetBucketStat operation may be earlier than the value of this field obtained by the previous GetBucketStat operation.

Request syntax

GET /?stat HTTP/1.1
Host: BucketName.oss-cn-hangzhou.aliyuncs.com
Date: GMT Date
Authorization: SignatureValue

Request headers

This request contains only common request headers. For more information, see Common request headers.

Response headers

This request contains only common response headers. For more information, see Common response headers.

Response elements

ElementTypeExampleDescription
BucketStatContainerN/AThe container that stores all elements returned for the GetBucketStat request.
StoragePositive integer1600The storage capacity of the bucket. Unit: bytes.

Parent node: BucketStat

Child nodes: none

ObjectCountPositive integer230The total number of objects that are stored in the bucket.

Parent node: BucketStat

Child nodes: none

MultipartUploadCountPositive integer40The number of multipart upload tasks that have been initiated but are not completed or canceled.

Parent node: BucketStat

Child nodes: none

LiveChannelCountPositive integer4The number of LiveChannels in the bucket.

Parent node: BucketStat

Child nodes: none

LastModifiedTimePositive integer1643341269The time when the obtained information is last modified. The value of this element is a UNIX timestamp. Unit: seconds.

Parent node: BucketStat

Child nodes: none

StandardStoragePositive integer430The storage usage of Standard objects in the bucket. Unit: bytes.

Parent node: BucketStat

Child nodes: none

StandardObjectCountPositive integer66The number of Standard objects in the bucket.

Parent node: BucketStat

Child nodes: none

InfrequentAccessStoragePositive integer2359296The billed storage usage of Infrequent Access (IA) objects in the bucket. Unit: bytes.
Important IA objects that are smaller than 64 KB in size are billed as 64 KB. For more information about billing details, see Storage fees.

Parent node: BucketStat

Child nodes: none

InfrequentAccessRealStoragePositive integer360The actual storage usage of IA objects in the bucket. Unit: bytes.

Parent node: BucketStat

Child nodes: none

InfrequentAccessObjectCountPositive integer54The number of IA objects in the bucket.

Parent node: BucketStat

Child nodes: none

ArchiveStoragePositive integer2949120The billed storage usage of Archive objects in the bucket. Unit: bytes.
Important Archive objects that are smaller than 64 KB in size are billed as 64 KB. For more information about billing details, see Storage fees.

Parent node: BucketStat

Child nodes: none

ArchiveRealStoragePositive integer450The actual storage usage of Archive objects in the bucket. Unit: bytes.

Parent node: BucketStat

Child nodes: none

ArchiveObjectCountPositive integer74The number of Archive objects in the bucket.

Parent node: BucketStat

Child nodes: none

ColdArchiveStoragePositive integer2359296The billed storage usage of Cold Archive objects in the bucket. Unit: bytes.
Important Cold Archive objects that are smaller than 64 KB in size are billed as 64 KB. For more information about billing details, see Storage fees.

Parent node: BucketStat

Child nodes: none

ColdArchiveRealStoragePositive integer360The actual storage usage of Cold Archive objects in the bucket. Unit: bytes.

Parent node: BucketStat

Child nodes: none

ColdArchiveObjectCountPositive integer36The number of Cold Archive objects in the bucket.

Parent node: BucketStat

Child nodes: none

Examples

  • Sample requests
    GET /?stat HTTP/1.1
    Host: BucketName.oss-cn-hangzhou.aliyuncs.com
    Date: Tue, 28 Dec 2021 01:17:29 GMT
    Authorization: OSS qn6qrrqxo2oawuk53otfjbyc:ceOEyZavKY4QcjoUWYSpYbJ3****
  • Sample responses
    <?xml version="1.0" encoding="UTF-8"?>
    <BucketStat>
      <Storage>1600</Storage>
      <ObjectCount>230</ObjectCount>
      <MultipartUploadCount>40</MultipartUploadCount>
      <LiveChannelCount>4</LiveChannelCount>
      <LastModifiedTime>1643341269</LastModifiedTime>
      <StandardStorage>430</StandardStorage>
      <StandardObjectCount>66</StandardObjectCount>
      <InfrequentAccessStorage>2359296</InfrequentAccessStorage>
      <InfrequentAccessRealStorage>360</InfrequentAccessRealStorage>
      <InfrequentAccessObjectCount>54</InfrequentAccessObjectCount>
      <ArchiveStorage>2949120</ArchiveStorage>
      <ArchiveRealStorage>450</ArchiveRealStorage>
      <ArchiveObjectCount>74</ArchiveObjectCount>
      <ColdArchiveStorage>2359296</ColdArchiveStorage>
      <ColdArchiveRealStorage>360</ColdArchiveRealStorage>
      <ColdArchiveObjectCount>36</ColdArchiveObjectCount>
    </BucketStat>