ListBucketInventory
Updated at:2025-11-03
API description
ListBucketInventory is designed to retrieve all inventory configurations of a specified bucket through the GET operation without requiring an inventory ID. All retrieved configurations are returned at once without pagination.
Request
-
Request syntax
Plain Text1GET /?inventory HTTP/1.1 2Host: <BucketName>.bj.bcebos.com 3x-bce-date: date 4Content-Length: 0 -
Request headers
No request headers
-
Request parameters
No special request parameters
Response
| Name | Types | Description | Required or not |
|---|---|---|---|
| inventoryRuleList | list | List of all inventory task information in the bucket | Yes |
| +id | string | Rule name of inventory. Specification: Maximum 64 bytes. Valid characters: "a-z", "A-Z", "0-9", "-", "_", and ".". | Yes |
| +status | string | Identifier indicating whether the inventory is effective. If it is set to be "enabled", the inventory function will take effect; if it is set to be "disabled", no inventory will be generated. | Yes |
| +resource | List, with the sub-element being string. | Effective prefix. The resource configuration format is bucket_name/<Effective Object Prefix>, and must start with bucket_name/. To apply to the entire bucket, use bucket_name/*. |
Yes |
| +schedule | string | The inventory task schedule. Allowed values: ThreeDaily, Weekly, and Monthly, corresponding to every three days, weekly, and monthly respectively. | Yes |
| +monthlyDate | int | If the inventory task is scheduled monthly, specify the inventory output date. Accepts integers ranging from 1 to 28. | No |
| +destination | object | Details the storage information for the inventory results. | Yes |
| ++targetBucket | string | Specifies the bucket where inventory files will be stored. | Yes |
| ++targetPrefix | string | Defines the prefix for the final saved inventory file. | No |
| ++format | string | The format of the inventory analysis results. Currently supported format: CSV. | Yes |
Example
-
Request example
Plain Text1GET /?inventory HTTP/1.1 2Host:<BucketName>.bj.bcebos.com 3x-bce-date: date 4Content-Length: 0 -
Response example
Plain Text1HTTP/1.1 200 OK 2x-bce-request-id: 4db4b34d-653d-4d9a-b49b-3049ca786409 3Date: Wed, 31 May 2018 08:34:40 GMT 4Server: BceBos 5Authorization: AuthorizationString 6{ 7 "inventoryRuleList":[ 8 { 9 "id": "inventory-configuration-ID1", 10 "status": "enabled", 11 "resource": [ 12 "bucket/prefix/*" 13 ], 14 "schedule": "Weekly", 15 "destination": { 16 "targetBucket": "destBucketName", 17 "targetPrefix": "destination-prefix", 18 "format": "CSV" 19 } 20 }, 21 { 22 "id": "inventory-configuration-ID2", 23 "status": "enabled", 24 "resource": [ 25 "bucket/prefix2/*" 26 ], 27 "schedule": "Monthly", 28 "monthlyDate": 15, 29 "destination": { 30 "targetBucket": "destBucketName", 31 "targetPrefix": "destination-prefix-another", 32 "format": "CSV" 33 } 34 } 35 ] 36}
