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
| Parameter | Type | Description |
|---|---|---|
--bucket | string | The name of the bucket. |
--inventory-id | string | The ID of the inventory to retrieve. |
--output-format | string | The 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 report1Retrieve the inventory and display the output in JSON format:
ossutil api get-bucket-inventory --bucket examplebucket --inventory-id report1 --output-format jsonRetrieve the inventory and display the output in YAML format:
ossutil api get-bucket-inventory --bucket examplebucket --inventory-id report1 --output-format yamlWhat's next
list-bucket-inventory — List all inventories in a bucket
put-bucket-inventory — Create or update an inventory
delete-bucket-inventory — Delete an inventory