All Products
Search
Document Center

Object Storage Service:get-bucket-inventory

Last Updated:Mar 20, 2026

Queries specific inventories of a bucket.

Usage notes

By default, an Alibaba Cloud account has the permission to call this operation. To call this operation as a RAM user or using Security Token Service (STS), you must have the oss:GetBucketInventory permission. For more information, see Attach a custom policy to a RAM user.

Syntax

ossutil api get-bucket-inventory --bucket <value> --inventory-id <value> [flags]

Parameters

ParameterTypeDescription
--bucketstringThe name of the bucket.
--inventory-idstringThe ID of the inventory to retrieve.
--output-formatstringThe output format. Valid values: json, yaml. If not specified, the output uses the default text format.
The get-bucket-inventory command maps to the GetBucketInventory API operation. For all supported global flags, see Global command-line options.

Examples

Retrieve the inventory named report1 from examplebucket:

ossutil api get-bucket-inventory --bucket examplebucket --inventory-id report1

Retrieve the inventory and display the output in JSON format:

ossutil api get-bucket-inventory --bucket examplebucket --inventory-id report1 --output-format json

Retrieve the inventory and display the output in YAML format:

ossutil api get-bucket-inventory --bucket examplebucket --inventory-id report1 --output-format yaml

What's next