Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 884 Bytes

delete_bucket_notification.md

File metadata and controls

33 lines (25 loc) · 884 Bytes

DELETE Bucket Notification

Code Snippet

Initialize the Qingstor object with your AccessKeyID and SecretAccessKey.

import (
	"github.com/qingstor/qingstor-sdk-go/v4/config"
	"github.com/qingstor/qingstor-sdk-go/v4/service"
)

var conf, _ = config.New("YOUR-ACCESS-KEY-ID", "YOUR--SECRET-ACCESS-KEY")
var qingStor, _ = service.Init(conf)

Initialize a Bucket object according to the bucket name you set for subsequent creation:

bucketName := "your-bucket-name"
zoneName := "pek3b"
bucketService, _ := qingStor.Bucket(bucketName, zoneName)

then you can DELETE Bucket Notification

	if output, err := bucketService.DeleteNotification(); err != nil {
		fmt.Printf("Delete notifications of bucket(name: %s) failed with given error: %s\n", bucketName, err)
	} else {
		fmt.Printf("The status code expected: 204(actually: %d)\n", *output.StatusCode)
	}