/
。如您指定了Prefix
作为前缀,则 COS 后端投递的清单报告路径为Prefix/inventory_report
。PUT /?inventory&id=inventory-configuration-ID HTTP/1.1Host: <BucketName-APPID>.cos.<Region>.myqcloud.comDate: GMT DateAuthorization: Auth StringContent-MD5: MD5
参数 | 描述 | 类型 | 是否必选 |
id | 清单任务的名称。缺省值:None 合法字符: a-z,A-Z,0-9,-,_,. | String | 是 |
<InventoryConfiguration><Id>list1</Id><IsEnabled>true</IsEnabled><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><Schedule><Frequency>Daily</Frequency></Schedule><Filter><Prefix>myPrefix</Prefix></Filter><IncludedObjectVersions>All</IncludedObjectVersions><OptionalFields><Field>Size</Field><Field>LastModifiedDate</Field><Field>ETag</Field><Field>StorageClass</Field><Field>IsMultipartUploaded</Field><Field>ReplicationStatus</Field><Field>Tag</Field><Field>Crc64</Field><Field>x-cos-meta-*</Field></OptionalFields></InventoryConfiguration>
节点名 | 父节点 | 描述 | 类型 | 是否必选 |
InventoryConfiguration | 无 | 包含清单的配置参数 | Container | 是 |
Id | InventoryConfiguration | 清单的名称,与请求参数中的 id 对应 | Container | 是 |
IsEnabled | InventoryConfiguration | 清单是否启用的标识: 如果设置为 true,清单功能将生效 如果设置为 false,将不生成任何清单 | String | 是 |
IncludedObjectVersions | InventoryConfiguration | 是否在清单中包含对象版本: 如果设置为 All,清单中将会包含所有对象版本,并在清单中增加 VersionId,IsLatest,DeleteMarker 这几个字段 如果设置为 Current,则清单中不包含对象版本信息 | String | 是 |
Filter | InventoryConfiguration | 筛选待分析对象。清单功能将分析符合 Filter 中设置的前缀的对象 | Container | 否 |
And | Filter | 筛选待分析对象时,如果同时需要前缀与对象标签条件,需要用 And 包装 | Container | 否 |
Prefix | And | 需要分析的对象的前缀 | String | 否 |
Tag | And | 筛选待分析对象时,可以用对象标签(支持多个)作为过滤条件 | Container | 否 |
Period | Filter | 需要分析的对象的创建时间范围 | Container | 否 |
StartTime | Period | 需要分析的对象创建的起始时间,参数为秒级时间戳,如1568688761 | String | 否 |
EndTime | Period | 需要分析的对象创建的结束时间,参数为秒级时间戳,如1568688762 | String | 否 |
OptionalFields | InventoryConfiguration | 设置清单结果中应包含的分析项目 | Container | 否 |
Field | OptionalFields | 清单结果中可选包含的分析项目名称,可选字段包括: Size ,LastModifiedDate ,StorageClass ,ETag ,IsMultipartUploaded ,ReplicationStatus ,Tag ,Crc64 ,x-cos-meta-* 注意,如果筛选条件里使用了对象标签,在这里也必须添加 Tag 此外,也支持用户填写 x-cos-meta-* 形式的自定义头部,如x-cos-meta-testheader 。清单会将相应的对象元数据输出,若对象不包含该元数据,则为空。 | String | 否 |
Schedule | InventoryConfiguration | 配置清单任务周期 | Container | 是 |
Frequency | Schedule | 清单任务周期,可选项为按日或者按周,枚举值:Daily、Weekly | String | 是 |
Destination | InventoryConfiguration | 描述存放清单结果的信息 | Container | 是 |
COSBucketDestination | Destination | 清单结果导出后存放的存储桶信息 | Container | 是 |
Bucket | COSBucketDestination | 清单分析结果的存储桶名 | String | 是 |
AccountId | COSBucketDestination | 存储桶的所有者 ID,例如100000000001 | String | 否 |
Prefix | COSBucketDestination | 清单分析结果的前缀 | String | 否 |
Format | COSBucketDestination | 清单分析结果的文件形式,可选项为 CSV 格式 | String | 是 |
Encryption | COSBucketDestination | 为清单结果提供服务端加密的选项 | Container | 否 |
SSE-COS | Encryption | COS 托管密钥的加密方式,无需填充 | Container | 否 |
examplebucket-1250000000
中添加一条名为 list1 的清单任务。PUT /?inventory&id=list1 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>list1</Id><IsEnabled>true</IsEnabled><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><Schedule><Frequency>Daily</Frequency></Schedule><Filter><Prefix>myPrefix</Prefix><Period><StartTime>1568688761</StartTime><EndTime>1568688762</EndTime></Period></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>
HTTP/1.1 200 OKContent-Type: application/xmlContent-Length: 0Date: Mon, 28 Aug 2018 02:53:38 GMTServer: tencent-cosx-cos-request-id: NTlhMzg1ZWVfMjQ4OGY3MGFfMWE1NF8****
examplebucket-1250000000
中添加一条名为 list2 的清单任务。PUT /?inventory&id=list2 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>list2</Id><IsEnabled>true</IsEnabled><Destination><COSBucketDestination><Format>CSV</Format><AccountId>100000000001</AccountId><Bucket>qcs::cos:ap-guangzhou::inventorybucket-1250000000</Bucket></COSBucketDestination></Destination><Schedule><Frequency>Daily</Frequency></Schedule><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****
examplebucket-1250000000
中添加一条名为 list3 的清单任务。PUT /?inventory&id=list2 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>list3</Id><IsEnabled>true</IsEnabled><Destination><COSBucketDestination><Format>CSV</Format><AccountId>100000000001</AccountId><Bucket>qcs::cos:ap-guangzhou::inventorybucket-1250000000</Bucket></COSBucketDestination></Destination><Schedule><Frequency>Daily</Frequency></Schedule><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><Field>Crc64</Field><Field>x-cos-meta-myheader</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****
本页内容是否解决了您的问题?