此接口用于为存储桶创建桶清单。创建桶清单后,TOS 将按天或周输出对象的各类信息,包括对象的数量、大小、存储类型等。
PUT /?inventory&id=report HTTP/1.1 Host: BucketName.tos-cn-beijing.volces.com Date: Mon, 31 Oct 2016 12:00:00 GMT Authorization: authorization string Content-Length: length { "InventoryConfiguration": { "Id": "id", "IsEnabled": "true", "Filter": { "Prefix": "Pics/" }, "Destination": { "TOSBucketDestination": { "Format": "CSV", "AccountId": "200000****", "Role": "TosArchiveTOSInventory", "Bucket": "destination-bucket", "Prefix": "prefix1", } }, "Schedule": { "Frequency": "Daily" }, "IncludedObjectVersions": "All", "OptionalFields": { "Field": [ "Size", "LastModifiedDate", "ETag", "StorageClass", "IsMultipartUploaded", "EncryptionStatus", "CRC64", "ReplicationStatus", ] } } }
该请求使用的公共请求消息头,请参见公共参数。
名称 | 位置 | 参数类型 | 是否必选 | 示例值 | 说明 |
---|---|---|---|---|---|
inventory | Query | String | 是 | - | 代表 PutBucketInventory 请求的特殊标识。 |
id | Query | String | 是 | report | 桶清单名称,必须在当前 Bucket 下保持全局唯一。说明如下:
注意 消息头中的 |
名称 | 参数类型 | 是否必填 | 示例值 | 说明 |
---|---|---|---|---|
InventoryConfiguration | Array | 是 | - | 桶清单规则 |
Id | String | 是 | report | 桶清单名称,必须在当前 Bucket 下保持全局唯一。说明如下:
注意 请求元素的 |
IsEnabled | Bool | 是 | true | 是否启用桶清单功能。取值如下:
|
Destination | Array | 是 | - | 清单文件的相关信息。 |
TOSBucketDestination | Array | 是 | - | 清单文件的存储桶相关信息。 |
Format | String | 是 | CSV | 清单文件的格式。取值 |
AccountId | String | 是 | 200000**** | 存储桶所有者的账号 ID。 |
Role | String | 是 | TosArchiveTOSInventory | 角色名称,用于授予对象存储读取源存储桶所有文件和向目标存储桶写入文件的权限。该角色必须具有 TOS 的读写权限及服务访问权限,您也可以使用 TOS 默认角色 |
Bucket | String | 是 | bucket_0001 | 指定保存清单文件的存储桶。 |
Prefix | String | 否 | prefix1 | 清单文件的存储路径前缀。 |
Schedule | Array | 是 | - | 桶清单导出周期信息。 |
Frequency | String | 是 | Daily | 清单文件导出的周期。取值如下:
父节点:Schedule |
IncludedObjectVersions | String | 是 | All | 导出的对象版本,取值如下:
|
Filter | Array | 否 | - | 桶清单筛选的前缀。指定前缀后,桶清单将仅导出符合前缀设置的对象。 |
Prefix | String | 否 | Pics/ | 导出文件前缀匹配信息,如果不设置,默认生成桶中所有对象的清单。 |
OptionalFields | Array | 否 | - | 清单文件导出的信息。 |
Field | String | 否 | Size | 清单文件需要导出的信息。支持多选,取值如下:
说明 查看跨区域复制和同区域复制源对象的复制状态功能目前处于邀测状态,如您需要使用该功能,请联系客户经理。 默认导出所有信息。 |
该请求返回的公共响应消息头,请参见公共参数。
该请求响应中无消息元素。
PUT /?inventory&id=report HTTP/1.1 Host: BucketName.tos-cn-beijing.volces.com Date: Sat, 07 Oct 2023 09:02:23 GMT Authorization: authorization string { "InventoryConfiguration": { "Id": "report", "IsEnabled": "true", "Filter": { "Prefix": "Pics/" }, "Destination": { "TOSBucketDestination": { "Format": "CSV", "AccountId": "200000****", "Role": "TosArchiveTOSInventory", "Bucket": "destination-bucket", "Prefix": "prefix1" } }, "Schedule": { "Frequency": "Daily" }, "IncludedObjectVersions": "All", "OptionalFields": { "Field": [ "Size", "LastModifiedDate", "ETag", "StorageClass", "IsMultipartUploaded", "EncryptionStatus", "CRC64", "ReplicationStatus" ] } } }
HTTP/1.1 200 OK Date: Sat, 07 Oct 2023 09:02:23 GMT Server: TosServer x-tos-id-2: 1e89f203jld00006-a444fd0 x-tos-request-id: 1e89f203b2d00006-a444ed0 Content-Length: 0