List Parts
API Description
You can use this API to list the uploaded parts in a bucket by using the multipart upload ID.
Method Definition
func (obsClient ObsClient) ListParts(input *ListPartsInput) (output *ListPartsOutput, err error)
Method Definition If a Signed URL Is Used
func (obsClient ObsClient) ListPartsWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *ListPartsOutput, err error)
Request Parameter
| Field | Type | Optional or Mandatory |
|---|---|---|
| input | Mandatory |
Returned Result
| Field | Type |
|---|---|
| output | |
| err | error |
Sample Code
func main() {
input := &obs.ListPartsInput{}
input.Bucket = "bucketname"
input.Key = "objectkey"
input.UploadId = "uploadid"
output, err := obsClient.ListParts(input)
if err == nil {
fmt.Printf("RequestId:%s\n", output.RequestId)
for index, part := range output.Parts {
fmt.Printf("Part[%d]-ETag:%s, PartNumber:%d, LastModified:%s, Size:%d\n", index, part.ETag,
part.PartNumber, part.LastModified, part.Size)
}
} else {
if obsError, ok := err.(obs.ObsError); ok {
fmt.Println(obsError.Code)
fmt.Println(obsError.Message)
} else {
fmt.Println(err)
}
}
} Last Article: PUT Part - Copy
Next Article: Complete Multipart Upload
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.