All Products
Search
Document Center

Object Storage Service:GetBucketStat

Last Updated:Apr 29, 2024

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 HTTP headers.

Response headers

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

Response elements

Element

Type

Example

Description

BucketStat

Container

N/A

The container that stores all elements returned for the GetBucketStat request.

Storage

Positive integer

1600

The storage capacity of the bucket. Unit: bytes.

Parent node: BucketStat

Child nodes: none

ObjectCount

Positive integer

230

The total number of objects that are stored in the bucket.

Parent node: BucketStat

Child nodes: none

MultipartUploadCount

Positive integer

40

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

Parent node: BucketStat

Child nodes: none

LiveChannelCount

Positive integer

4

The number of LiveChannels in the bucket.

Parent node: BucketStat

Child nodes: none

LastModifiedTime

Positive integer

1643341269

The 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

StandardStorage

Positive integer

430

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

Parent node: BucketStat

Child nodes: none

StandardObjectCount

Positive integer

66

The number of Standard objects in the bucket.

Parent node: BucketStat

Child nodes: none

InfrequentAccessStorage

Positive integer

2359296

The 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

InfrequentAccessRealStorage

Positive integer

360

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

Parent node: BucketStat

Child nodes: none

InfrequentAccessObjectCount

Positive integer

54

The number of IA objects in the bucket.

Parent node: BucketStat

Child nodes: none

ArchiveStorage

Positive integer

2949120

The 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

ArchiveRealStorage

Positive integer

450

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

Parent node: BucketStat

Child nodes: none

ArchiveObjectCount

Positive integer

74

The number of Archive objects in the bucket.

Parent node: BucketStat

Child nodes: none

ColdArchiveStorage

Positive integer

2359296

The 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

ColdArchiveRealStorage

Positive integer

360

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

Parent node: BucketStat

Child nodes: none

ColdArchiveObjectCount

Positive integer

36

The 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 qn6q**************:77Dv****************
  • 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>