Baidu AI Cloud
中国站

百度智能云

Object Storage

ListBucketInventory

Interface Description

With the ListBucketInventory interface, you can get all inventory configurations of the specified bucket through the GET operation without inventory ID. The got inventory configurations are returned at one time without paging.

Request

  • Request syntax

    GET /?inventory HTTP/1.1
    Host: <BucketName>.bj.bcebos.com
    x-bce-date: date
    Content-Length: 0
  • Request header field

    No request header field

  • Request parameters

    No special request parameters

Response

  • Response header field

    No special header field.

  • Response element

Name Type Description Required?
inventoryRuleList list List of all inventory task information in the bucket Yes
+id string Inventory rule name. Specification: Maximum length of 64 bytes. Valid character: "a-z", "A-Z", "0-9", "-", "_" and ".". Yes
+status string Identify whether the inventory takes effect. If it is set to "Enabled", the inventory feature takes effect. If it is set to "Disabled", no inventory is generated. Yes
+resource List, whose sub-element is a string. Effective prefix. The configuration form of resource is bucket_name/<Effective object prefix>, which must start with bucket_name/. When it is effective for the entire bucket, bucket_name/* is used. Yes
+schedule string Inventory task cycle, whose enumeration values include ThreeDaily and Weekly. Yes
+destination object Describe the information on the storage of inventory results. Yes
++targetBucket string Specify the bucket for storing the inventory file. Yes
++targetPrefix string Specify the prefix of inventory file saved finally. No
++format string File form of inventory analysis results, whose current supporting format is CSV. Yes

Example

  • Request example

    GET /?inventory HTTP/1.1
    Host:<BucketName>.bj.bcebos.com
    x-bce-date: date
    Content-Length: 0
  • Response example

    HTTP/1.1 200 OK
    x-bce-request-id: 4db4b34d-653d-4d9a-b49b-3049ca786409
    Date: Wed, 31 May 2018 08:34:40 GMT
    Server: BceBos
    Authorization: AuthorizationString
    {
        "inventoryRuleList":[
            {
                "id": "inventory-configuration-ID1", 
                "status": "enabled", 
                "resource": [
                    "bucket/prefix/*"
                ], 
                "schedule": "Weekly", 
                "destination": {
                    "targetBucket": "destBucketName", 
                    "targetPrefix": "destination-prefix", 
                    "format": "CSV"
                }
            }, 
            {
                "id": "inventory-configuration-ID2", 
                "status": "enabled", 
                "resource": [
                    "bucket/prefix2/*"
                ], 
                "schedule": "Weekly", 
                "destination": {
                    "targetBucket": "destBucketName", 
                    "targetPrefix": "destination-prefix-another", 
                    "format": "CSV"
                }
            }
        ]
    }
Previous
Static Website
Next
PutBucketInventory