Updated on 2022-02-10 GMT+08:00
PUT Part - Copy
API Description
After a multipart upload is initialized, you can use this API to copy a part to a specified bucket by using the multipart upload ID.
Method Definition
func (obsClient ObsClient) CopyPart(input *CopyPartInput) (output *CopyPartOutput, err error)
Method Definition If a Signed URL Is Used
func (obsClient ObsClient) CopyPartWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *CopyPartOutput, err error)
Request Parameter
Field |
Type |
Optional or Mandatory |
---|---|---|
input |
Mandatory |
Returned Result
Field |
Type |
---|---|
output |
|
err |
error |
Sample Code
func main() { input := &obs.CopyPartInput{} input.Bucket = "bucketname" input.Key = "objectkey" input.CopySourceBucket = "sourcebucketname" input.CopySourceKey = "sourceobjectkey" input.UploadId = "uploadid" input.PartNumber = 1 input.CopySourceRangeStart = 0 input.CopySourceRangeEnd = 1024 output, err := obsClient.CopyPart(input) if err == nil { fmt.Printf("RequestId:%s\n", output.RequestId) fmt.Printf("ETag:%s\n", output.ETag) } else { if obsError, ok := err.(obs.ObsError); ok { fmt.Println(obsError.Code) fmt.Println(obsError.Message) } else { fmt.Println(err) } } }
Parent topic: Objects-Related APIs
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot