Queries all inventories of a bucket.
Usage notes
By default, an Alibaba Cloud account has the permissions to list specific inventories of a bucket. If you want to use a RAM user or Security Token Service (STS) to query the inventories of a bucket, you must have the
oss:ListBucketInventory
permission. For more information, see Attach a custom policy to a RAM user.You can query up to 100 inventories in a single request. To query more than 100 inventories, you must send multiple requests and use the token returned for each request as the parameter for the next request.
Command syntax
ossutil api list-bucket-inventory --bucket value [flags]
Parameter | Type | Description |
--bucket | string | The name of the bucket whose inventory you want to query. |
--continuation-token | string | The token from which the list operation starts. |
The list-bucket-inventory command corresponds to the ListBucketInventory operation. For more information about the parameters in the ListBucketInventory operation, see ListBucketInventory.
For more information about supported global command-line options, see Global command-line options.
Examples
Run the following command to query all inventories in a bucket named examplebucket:
ossutil api list-bucket-inventory --bucket examplebucket
Run the following command to query all inventories in a bucket named examplebucket and display the inventories in the JSON format:
ossutil api list-bucket-inventory --bucket examplebucket --output-format json
Run the following command to query all inventories in a bucket named examplebucket and display the inventories in the YAML format:
ossutil api list-bucket-inventory --bucket examplebucket --output-format yaml
Run the following command to query all inventories whose names are alphabetically after CgJiYw123 in a bucket named examplebucket:
ossutil api list-bucket-inventory --bucket examplebucket --continuation-token CgJiYw123