GetBucketInventory
Updated at:2025-11-03
API description
GetBucketInventory is used to retrieve a specific inventory configuration for a designated bucket using the GET operation. The user must provide the inventory task name when making this request.
Request
-
Request syntax
Plain Text1GET /?inventory&id=inventory-configuration-ID HTTP/1.1 2Host: <BucketName>.bj.bcebos.com 3x-bce-date: date 4Content-Length: 0 -
Request headers
No special request headers
-
Request query parameters
| Name | Types | Description | Required or not |
|---|---|---|---|
| id | string | Rule name of inventory | Yes |
Response
| Name | Types | Description | Required or not |
|---|---|---|---|
| id | string | The inventory rule name. Specification: Maximum 64 bytes. Accepted characters: "a-z", "A-Z", "0-9", "-", "_", and ".". | Yes |
| status | string | An indicator specifying whether the inventory is active. Setting it to "enabled" activates the inventory function, while setting it to "disabled" means 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&id=inventory-configuration-ID 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 "id": "inventory-configuration-ID", 8 "status": "enabled", 9 "resource": [ 10 "bucket/prefix/*" 11 ], 12 "schedule": "Weekly", 13 "destination": { 14 "targetBucket": "destBucketName", 15 "targetPrefix": "destination-prefix", 16 "format": "CSV" 17 } 18}
