PUT Bucket inventory
. Once created, the inventory job will be executed, and each job will be executed only once instead of repeated execution. You can use this API to get the object inventory of a bucket and manage objects in a refined way.Prefix
, COS will deliver the inventory report to Prefix/inventory_report
.POST /?inventory&id=inventory-configuration-ID HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateAuthorization: Auth StringContent-MD5: MD5
POST Bucket inventory
, specify the following parameter:Parameter | Description | Type | Required |
id | Inventory job name. Default value: None Valid character: a-z, A-Z, 0-9, -, _, . Note: We recommend that you should not use the same ID as the periodic inventory job or submit duplicate IDs within one day. Otherwise, errors will be returned. | String | Yes |
IsEnabled
or Schedule
parameter.<InventoryConfiguration><Id>list1</Id><Destination><COSBucketDestination><Format>CSV</Format><AccountId>100000000001</AccountId><Bucket>qcs::cos:ap-guangzhou::examplebucket-1250000000</Bucket><Prefix>list1</Prefix><Encryption><SSE-COS></SSE-COS></Encryption></COSBucketDestination></Destination><Filter><And><Prefix>myPrefix</Prefix><Tag><Key>string</Key><Value>string</Value></Tag></And></Filter><IncludedObjectVersions>All</IncludedObjectVersions><OptionalFields><Field>Size</Field><Field>LastModifiedDate</Field><Field>ETag</Field><Field>StorageClass</Field><Field>IsMultipartUploaded</Field><Field>ReplicationStatus</Field></OptionalFields></InventoryConfiguration>
examplebucket-1250000000
.myPrefix
and tagged with {age:18} in the bucket will be analyzed.Size
; LastModifiedDate
; StorageClass
; ETag
; Tag
.examplebucket-1250000000
.POST /?inventory&id=disposable HTTP/1.1Date: Mon, 28 Aug 2018 02:53:38 GMTAuthorization: q-sign-algorithm=sha1&q-ak=AKIDZfbOAo7cllgPvF9cXFrJD0a1ICvR****&q-sign-time=1503888878;1503889238&q-key-time=1503888878;1503889238&q-header-list=host&q-url-param-list=inventory&q-signature=254bf9cd3d6615e89a36ab652437f9d45c5f****Content-MD5: AAq9nzrpsz5LJ4UEe1f6Q==Host: examplebucket-1250000000.cos.ap-guangzhou.myqcloud.comContent-Length: 1024<?xml version = "1.0" encoding = "UTF-8"><InventoryConfiguration xmlns = "http://...."><Id>disposable</Id><Destination><COSBucketDestination><Format>CSV</Format><AccountId>100000000001</AccountId><Bucket>qcs::cos:ap-guangzhou::inventorybucket-1250000000</Bucket></COSBucketDestination></Destination><Filter><And><Prefix>myPrefix</Prefix><Tag><Key>age</Key><Value>18</Value></Tag></And></Filter><IncludedObjectVersions>All</IncludedObjectVersions><OptionalFields><Field>Size</Field><Field>LastModifiedDate</Field><Field>StorageClass</Field><Field>ETag</Field><Field>Tag</Field></OptionalFields></InventoryConfiguration>
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 0Date: Mon, 28 Aug 2018 02:53:38 GMTServer: tencent-cosx-cos-request-id: NTlhMzg1ZWVfMjQ4OGY3MGFfMWE1NF8****
Was this page helpful?