列举分段上传任务
更新时间: 2019-03-13 10:23
功能说明
列举指定桶中所有的初始化后还未合并或还未取消的分段上传任务。
方法定义
- func (obsClient ObsClient) ListMultipartUploads(input *ListMultipartUploadsInput) (output *ListMultipartUploadsOutput, err error)
使用带授权信息URL的方法定义
- func (obsClient ObsClient) ListMultipartUploadsWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *ListMultipartUploadsOutput, err error)
请求参数
参数名 | 类型 | 约束 |
---|---|---|
input | *ListMultipartUploadsInput | 必选 |
返回结果
参数名 | 类型 |
---|---|
output | *ListMultipartUploadsOutput |
err | error |
代码样例
- func main() {
- input := &obs.ListMultipartUploadsInput{}
- input.Bucket = "bucketname"
- input.MaxUploads = 10
- output, err := obsClient.ListMultipartUploads(input)
- if err == nil {
- fmt.Printf("RequestId:%s\n", output.RequestId)
- for index, upload := range output.Uploads {
- fmt.Printf("Upload[%d]-OwnerId:%s, UploadId:%s, Key:%s, Initiated:%s\n",
- index, upload.Owner.ID, upload.UploadId, upload.Key, upload.Initiated)
- }
- } else {
- if obsError, ok := err.(obs.ObsError); ok {
- fmt.Println(obsError.Code)
- fmt.Println(obsError.Message)
- } else {
- fmt.Println(err)
- }
- }
- }
父主题:桶相关接口