Obtaining the Storage Class of a Bucket
API Description
You can use this API to obtain the storage class of a bucket.
Method Definition
func (obsClient ObsClient) GetBucketStoragePolicy(bucketName string) (output *GetBucketStoragePolicyOutput, err error)
Method Definition If a Signed URL Is Used
func (obsClient ObsClient) GetBucketStoragePolicyWithSignedUrl(signedUrl string, actualSignedRequestHeaders http.Header) (output *GetBucketStoragePolicyOutput, err error)
Request Parameter
| Field | Type | Optional or Mandatory | Description |
|---|---|---|---|
| bucketName | string | Mandatory | Bucket name |
Returned Result
| Field | Type |
|---|---|
| output | |
| err | error |
Sample Code
func main() { output, err := obsClient.GetBucketStoragePolicy("bucketname") if err == nil { fmt.Printf("RequestId:%s\n", output.RequestId) fmt.Printf("StorageClass:%s\n", output.StorageClass) } else { if obsError, ok := err.(obs.ObsError); ok { fmt.Println(obsError.Code) fmt.Println(obsError.Message) } else { fmt.Println(err) } } }
Last Article: Setting a Storage Class for a Bucket
Next Article: Setting a Bucket ACL
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.