Restore Archive Objects
API Description
You can use this API to restore an Archive object in a specified bucket.
Method Definition
func (obsClient ObsClient) RestoreObject(input *RestoreObjectInput) (output *BaseModel, err error)
Method Definition If a Signed URL Is Used
func (obsClient ObsClient) RestoreObjectWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header, data io.Reader) (output *BaseModel, err error)
Request Parameter
|
Field |
Type |
Optional or Mandatory |
|---|---|---|
|
input |
Mandatory |
Returned Result
|
Field |
Type |
|---|---|
|
output |
|
|
err |
error |
Sample Code
func main() {
input := &obs.RestoreObjectInput{}
input.Bucket = "bucketname"
input.Key = "objectkey"
input.Days = 1
input.Tier = obs.RestoreTierExpedited
output, err := obsClient.RestoreObject(input)
if err == nil {
fmt.Printf("RequestId:%s\n", output.RequestId)
} else {
if obsError, ok := err.(obs.ObsError); ok {
fmt.Println(obsError.Code)
fmt.Println(obsError.Message)
} else {
fmt.Println(err)
}
}
}
Last Article: DELETE Multipart upload
Next Article: Other APIs
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.