查看PDF

列举分段上传任务

更新时间: 2019-03-13 10:23

功能说明

列举指定桶中所有的初始化后还未合并或还未取消的分段上传任务。

方法定义

  1. func (obsClient ObsClient) ListMultipartUploads(input *ListMultipartUploadsInput) (output *ListMultipartUploadsOutput, err error)

使用带授权信息URL的方法定义

  1. func (obsClient ObsClient) ListMultipartUploadsWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *ListMultipartUploadsOutput, err error)

请求参数


参数名

类型

约束

input

*ListMultipartUploadsInput

必选

返回结果


参数名

类型

output

*ListMultipartUploadsOutput

err

error

代码样例

  1. func main() {
  2. input := &obs.ListMultipartUploadsInput{}
  3. input.Bucket = "bucketname"
  4. input.MaxUploads = 10
  5. output, err := obsClient.ListMultipartUploads(input)
  6. if err == nil {
  7. fmt.Printf("RequestId:%s\n", output.RequestId)
  8. for index, upload := range output.Uploads {
  9. fmt.Printf("Upload[%d]-OwnerId:%s, UploadId:%s, Key:%s, Initiated:%s\n",
  10. index, upload.Owner.ID, upload.UploadId, upload.Key, upload.Initiated)
  11. }
  12. } else {
  13. if obsError, ok := err.(obs.ObsError); ok {
  14. fmt.Println(obsError.Code)
  15. fmt.Println(obsError.Message)
  16. } else {
  17. fmt.Println(err)
  18. }
  19. }
  20. }

父主题:桶相关接口