Help Center> Object Storage Service> SDK Reference> Go> Bucket-Related APIs> Deleting a Bucket's Encryption Configurations

Deleting a Bucket's Encryption Configurations

API Description

You can use this API to delete the encryption configurations of a bucket.

Method Definition

func (obsClient ObsClient) DeleteBucketEncryption(bucketName string) (output *BaseModel, err error)

Method Definition If a Signed URL Is Used

func (obsClient ObsClient) DeleteBucketEncryptionWithSignedURL(signedURL string, actualSignedRequestHeaders http.Header) (output *BaseModel, err error)

Request Parameters

Field

Type

Optional or Mandatory

Description

bucketName

string

Mandatory

Bucket name

Returned Result

Field

Type

output

*BaseModel

err

error

Sample Code

var obsClient, _ = obs.New(ak, sk, endpoint, obs.WithSignature(obs.SignatureObs))

func main() 
       // Delete the encryption configurations of the specified bucket.
       output, err := obsClient.DeleteBucketEncryption("bucketName")
       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)
              }
       }
}