Skip to content

Commit

Permalink
Add features in bos
Browse files Browse the repository at this point in the history
  • Loading branch information
duanliguo committed Dec 5, 2024
1 parent a1bc6ec commit 851e7b6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bce/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (

// Constants and default values for the package bce
const (
SDK_VERSION = "0.9.204"
SDK_VERSION = "0.9.205"
URI_PREFIX = "/" // now support uri without prefix "v1" so just set root path
DEFAULT_DOMAIN = "baidubce.com"
DEFAULT_PROTOCOL = "http"
Expand Down
11 changes: 11 additions & 0 deletions services/bos/api/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,17 @@ func PutBucket(cli bce.Client, bucket string, args *PutBucketArgs, ctx *BosConte
if len(args.TagList) != 0 {
req.SetHeader(http.BCE_TAG, args.TagList)
}
if args.EnableMultiAz {
jsonBytes, jsonErr := json.Marshal(args)
if jsonErr != nil {
return "", jsonErr
}
body, err := bce.NewBodyFromBytes(jsonBytes)
if err != nil {
return "", err
}
req.SetBody(body)
}
}
resp := &bce.BceResponse{}
if err := SendRequest(cli, req, resp, ctx); err != nil {
Expand Down
3 changes: 2 additions & 1 deletion services/bos/api/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ type PrefixType struct {
}

type PutBucketArgs struct {
TagList string
TagList string `json:"-"`
EnableMultiAz bool `json:"enableMultiAz"`
}

// ListObjectsResult defines the result structure of ListObjects api.
Expand Down

0 comments on commit 851e7b6

Please sign in to comment.