ListMultipartUploads

ListMultipartUploads可以罗列出所有执行中的Multipart Upload事件,即已经被初始化的Multipart Upload但是未被Complete或者Abort的Multipart Upload事件。COS返回的罗列结果中最多会包含1000个Multipart Upload信息。如果想指定COS返回罗列结果内Multipart Upload信息的数目,可以在请求中添加max-uploads参数。另外,COS返回罗列结果中的IsTruncated元素标明是否还有其他的Multipart Upload。

请求语法

Get /?uploads HTTP/1.1
Host: bucketname.cos.chinac.com
Date: GMT Date
Authorization: Signature

请求参数

Name Type Description
max-uploads String 限定此次返回Multipart Uploads事件的最大数目,默认为1000
upload-id-marker Long 用来指定返回结果的起始位置。

响应元素

Name Type Description
Bucket String Bucket名称
NextUploadIdMarker Long 如果本次没有返回全部结果,用于标明接下来请求的NextUploadIdMarker值
MaxUploads int 返回的最大Upload数目
IsTruncated boolean “true”表示本次没有返回全部结果;“false”表示本次已经返回了全部结果。
Uploads Object 保存Multipart Upload事件信息
Key String 初始化Multipart Upload事件的Object名字
UploadId Long Multipart Upload事件的ID
Initiated String Multipart Upload事件初始化的时间

细节分析

  1. max-uploads参数最大值为1000
  2. ListMultipartUploads请求支持upload-id-marker和max-uploads。通过这些参数的组合,可以设定查询Multipart Uploads事件的规则,获得期望的查询结果
  3. 如果upload-id-marker参数未设置,查询结果中包含所有Multipart事件。如果upload-id-marker参数被设置,查询结果中包含大于upload-id-marker的Multipart事件

示例

请求示例
Get /?uploads  HTTP/1.1
Host: test-bucket.cos.chinac.com
Date: Thu, 23 Feb 2012 06:14:27 GMT
Authorization: COS qn6qrrqxo2oawuk53otfjbyc:JX75CtQqsmBBz+dcivn7kwBMvOY=
响应示例
HTTP/1.1 200 
Content-Type: application/json
Content-Length: 1839
Connection: keep-alive
x-cos-request-id: 58a41847-3d93-1905-20db-ba6f561ce67a
Date: Thu, 23 Feb 2012 06:14:27 GMT
Server: ChinacCOS

{
    "Bucket": "test-bucket",
    "NextUploadIdMarker": 1251,
    "IsTruncated": false,
    "Uploads":[
    {
        "Key": "objectName",
        "UploadId": 1250,
        "Initiated": "2016-02-25T15:42:14+0800"
    },
    {
        "Key": "multipart.data",
        "UploadId": 1251,
        "Initiated": "2016-02-25T15:43:16+0800"
    }
    ]
}

results matching ""

    No results matching ""