All Products
Search
Document Center

Object Storage Service:ListBucketInventory

Last Updated:Jun 11, 2026

ListBucketInventory lists all inventory configurations for a bucket.

Usage notes

Calling the ListBucketInventory operation requires the oss:GetBucketInventory permission. For more information, see Grant custom permission policies to a RAM user.

Note
  • A single request can retrieve a maximum of 100 inventory configurations. If a response is truncated, use the NextContinuationToken value from the response as the continuation-token in your next request to retrieve the next page of results.

  • Ensure you have permission to manage inventory configurations for the bucket. By default, only the bucket owner has this permission. If you are not the owner, request the necessary permission.

Request syntax

  • With continuation-token

    GET /?inventory&continuation-token=xxx HTTP/1.1
  • Without continuation-token

    GET /?inventory HTTP/1.1

Response elements

Parameter

Type

Description

InventoryConfiguration

container

A container for inventory configuration parameters.

IsTruncated

Boolean

Indicates whether the list of inventory configurations is truncated.

Valid values: true or false

  • If false, all inventory configurations for the bucket are listed.

  • If true, the list is truncated. Use NextContinuationToken to retrieve the next page of results.

NextContinuationToken

String

If the response is truncated (IsTruncated is true), use this token in the continuation-token parameter of your next request to get the next page of results.

Id

String

The user-specified name for the inventory configuration. The name must be unique within the bucket.

IsEnabled

Boolean

Specifies whether the inventory is enabled.

Valid values: true or false

  • If true, the inventory is enabled.

  • If false, no inventory is generated.

Filter

container

A container for the filter rules. The inventory includes only objects that match the filter.

Prefix

String

The object prefix to use for filtering.

Parent node: Filter

Destination

container

A container for information about where to publish the inventory results.

OSSBucketDestination

container

Contains details about the destination bucket where the inventory report is stored.

Parent node: Destination

Format

String

The file format of the exported inventory.

Valid value: CSV

Parent node: OSSBucketDestination

AccountId

String

The ID of the account granted permission to write the inventory report to the destination bucket.

Parent node: OSSBucketDestination

RoleArn

String

The ARN of the role granted permission to write the inventory report to the destination bucket.

Format: acs:ram::uid:role/rolename

Parent node: OSSBucketDestination

Bucket

String

The destination bucket for the inventory report.

Parent node: OSSBucketDestination

Prefix

String

The prefix within the destination bucket where the inventory report is stored.

Parent node: OSSBucketDestination

Encryption

container

The server-side encryption method for the inventory report.

Valid values: SSE-OSS, SSE-KMS, or Null

Parent node: OSSBucketDestination

SSE-OSS

container

A container for SSE-OSS encryption.

Parent node: Encryption

SSE-KMS

container

A container for the key used for SSE-KMS encryption.

Parent node: Encryption

KeyId

String

The KMS key ID.

Parent node: SSE-KMS

Schedule

container

A container for the inventory export schedule.

Frequency

String

The export frequency of the inventory.

Valid values: Daily, Weekly, Monthly, or Once

Parent node: Schedule

DayOfMonth

Integer

The day of the month on which to export the inventory when Frequency is set to Monthly. Valid values: 1 to 31.

Parent node: Schedule

AutoDelete

Boolean

Specifies whether to automatically delete the inventory configuration after exporting a one-time inventory. This element is valid only when Frequency is set to Once.

Valid values: true, false

Parent node: Schedule

IncludedObjectVersions

String

Specifies which object versions to include in the inventory.

Valid values: All or Current

  • If the value is All, all versions of objects are exported.

  • If the value is Current, only the current versions of objects are exported.

OptionalFields

container

A container for the optional fields to include in the inventory.

Field

container

The optional fields to include in the inventory.

Optional fields include: Size, LastModifiedDate, TransitionTime, ETag, StorageClass, IsMultipartUploaded, EncryptionStatus, ObjectAcl, TaggingCount, ObjectType, and Crc64

Parent node: OptionalFields

IncrementalInventory

container

A container for the incremental inventory configuration.

IsEnabled

Boolean

Indicates whether to enable incremental inventory.

Valid values:

  • true: enabled

  • false: disabled

If true, incremental inventory is enabled even if the parent IsEnabled is false.

Parent node: IncrementalInventory

Schedule

container

A container for the incremental inventory export schedule.

Parent node: IncrementalInventory

Frequency

Integer

The export frequency of the incremental inventory, in seconds.

The system exports incremental inventories at a fixed interval of 600 seconds. In each interval, the system automatically creates a directory prefix and generates a manifest file and multiple CSV files. Custom frequencies are not supported.

Parent node: Schedule

OptionalFields

container

A container for the optional fields to include in the incremental inventory.

Parent node: IncrementalInventory

Field

String

The fields that are included in the incremental inventory.

Parent node: OptionalFields

  • SequenceNumber: The sequence number. Each record has a unique sequence number. Records for the same object in the same bucket can be sorted by SequenceNumber. The sorted records typically follow a chronological order.

  • RecordType: The event type. Valid values: CREATE, UPDATE_METADATA, and DELETE.

    • CREATE: All upload operations, such as PutObject, PostObject, AppendObject, multipart upload, and CopyObject, that occur for objects with the specified prefix.

    • UPDATE_METADATA: All metadata updates for objects with the specified prefix are recorded as this event type.

    • DELETE: All delete operations for objects with the specified prefix, such as DeleteObject, DeleteMultipleObjects, creating a delete marker after versioning is enabled, and lifecycle-based deletions. Deletions include creating a delete marker and permanent deletions. For permanent deletions, only the core fields Bucket, Key, SequenceNumber, RecordType, RecordTimestamp, and VersionId are retained. Other columns are empty (null).

  • RecordTimestamp: The UTC timestamp of the event. Example: "2024-08-25 18:08:01.024". The timestamp is accurate to the millisecond.

  • Requester: The Alibaba Cloud ID or principal ID of the requester.

  • RequestId: The unique ID of the request.

  • SourceIp: The source IP address of the requester.

  • Key: The name of the object in the bucket. The key is URL-encoded.

  • VersionId: The version ID of the object. This field appears only when the inventory configuration is set to include all versions.

    • If versioning is not enabled for the bucket, this field is empty.

    • If versioning is enabled for the bucket, this field displays the version ID of the object.

  • IsDeleteMarker: Indicates whether the object version is a delete marker. This field appears only when the inventory configuration is set to include all versions.

    • If versioning is not enabled for the bucket, this field defaults to false.

    • If versioning is enabled and the object version is a delete marker, this field is true. Otherwise, it is false.

  • Size: The size of the object.

  • StorageClass: The storage class of the object.

  • LastModifiedDate: The last modified time of the object.

  • ETag: When an object is created, an ETag is generated to identify its content.

    • For an object created by calling the PutObject operation, the ETag is the MD5 hash of its content.

    • For an object created by other methods, the ETag is a unique value calculated based on specific rules, but it is not the MD5 hash of its content.

  • IsMultipartUploaded: Indicates whether the object was uploaded using a multipart upload.

  • ObjectType: The type of the object.

  • ObjectAcl: The access control list (ACL) of the object.

  • Crc64: The CRC-64 value of the object.

  • EncryptionStatus: Indicates whether the object is encrypted.

Examples

  • Sample request

      GET /?inventory HTTP/1.1
      Host: BucketName.oss.aliyuncs.com
      Date: Fri, 24 Feb 2012 03:55:00 GMT
      Authorization: authorization string
      Content-Type: text/plain
  • Sample response

      HTTP/1.1 200 OK
      x-oss-request-id: 56594298207FB304438516F9
      Date: Sat, 30 Apr 2016 23:29:37 GMT
      Content-Type: application/xml
      Content-Length: length
      Connection: close
      Server: AliyunOSS
    
      <?xml version="1.0" encoding="UTF-8"?>
      <ListInventoryConfigurationsResult>
         <InventoryConfiguration>
            <Id>report1</Id>
            <IsEnabled>true</IsEnabled>
            <Destination>
               <OSSBucketDestination>
                  <Format>CSV</Format>
                  <AccountId>1000000000000000</AccountId>
                  <RoleArn>acs:ram::1000000000000000:role/AliyunOSSRole</RoleArn>
                  <Bucket>acs:oss:::destination-bucket</Bucket>
                  <Prefix>prefix1</Prefix>
               </OSSBucketDestination>
            </Destination>
            <Schedule>
               <Frequency>Daily</Frequency>
            </Schedule>
            <Filter>
               <Prefix>prefix/One</Prefix>
            </Filter>
            <IncludedObjectVersions>All</IncludedObjectVersions>
            <OptionalFields>
               <Field>Size</Field>
               <Field>LastModifiedDate</Field>
               <Field>ETag</Field>
               <Field>StorageClass</Field>
               <Field>IsMultipartUploaded</Field>
               <Field>EncryptionStatus</Field>
            </OptionalFields>
         </InventoryConfiguration>
         <InventoryConfiguration>
            <Id>report2</Id>
            <IsEnabled>true</IsEnabled>
            <Destination>
               <OSSBucketDestination>
                  <Format>CSV</Format>
                  <AccountId>1000000000000000</AccountId>
                  <RoleArn>acs:ram::1000000000000000:role/AliyunOSSRole</RoleArn>
                  <Bucket>acs:oss:::destination-bucket</Bucket>
                  <Prefix>prefix2</Prefix>
               </OSSBucketDestination>
            </Destination>
            <Schedule>
               <Frequency>Daily</Frequency>
            </Schedule>
            <Filter>
               <Prefix>prefix/Two</Prefix>
            </Filter>
            <IncludedObjectVersions>All</IncludedObjectVersions>
            <OptionalFields>
               <Field>Size</Field>
               <Field>LastModifiedDate</Field>
               <Field>ETag</Field>
               <Field>StorageClass</Field>
               <Field>IsMultipartUploaded</Field>
               <Field>EncryptionStatus</Field>
            </OptionalFields>
         </InventoryConfiguration>
         <InventoryConfiguration>
            <Id>report3</Id>
            <IsEnabled>true</IsEnabled>
            <Destination>
               <OSSBucketDestination>
                  <Format>CSV</Format>
                  <AccountId>1000000000000000</AccountId>
                  <RoleArn>acs:ram::1000000000000000:role/AliyunOSSRole</RoleArn>
                  <Bucket>acs:oss:::destination-bucket</Bucket>
                  <Prefix>prefix3</Prefix>
               </OSSBucketDestination>
            </Destination>
            <Schedule>
               <Frequency>Daily</Frequency>
            </Schedule>
            <Filter>
               <Prefix>prefix/Three</Prefix>
            </Filter>
            <IncludedObjectVersions>All</IncludedObjectVersions>
            <OptionalFields>
               <Field>Size</Field>
               <Field>LastModifiedDate</Field>
               <Field>ETag</Field>
               <Field>StorageClass</Field>
               <Field>IsMultipartUploaded</Field>
               <Field>EncryptionStatus</Field>
            </OptionalFields>
         </InventoryConfiguration>
          ...
         <IsTruncated>true</IsTruncated>
         <NextContinuationToken>...</NextContinuationToken> 
      </ListInventoryConfigurationsResult>

SDKs

You can call this operation by using the following SDKs:

Ossutil CLI

To perform this operation using ossutil, see the list-bucket-inventory command.