Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
duanliguo committed Jul 26, 2024
1 parent 2066d86 commit 0de92b5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
3 changes: 2 additions & 1 deletion bce/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ import (

// Constants and default values for the package bce
const (
SDK_VERSION = "0.9.185"
SDK_VERSION = "0.9.186"
URI_PREFIX = "/" // now support uri without prefix "v1" so just set root path
DEFAULT_DOMAIN = "baidubce.com"
DEFAULT_PROTOCOL = "http"
HTTPS_PROTOCAL = "https"
DEFAULT_REGION = "bj"
DEFAULT_CONTENT_TYPE = "application/json;charset=utf-8"
DEFAULT_CONNECTION_TIMEOUT_IN_MILLIS = 1200 * 1000
Expand Down
11 changes: 9 additions & 2 deletions services/bec/api/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,15 @@ type VmServiceBatchActionArgs struct {
}

type CreateVmImageArgs struct {
VmId string `json:"vmId,omitempty"`
Name string `json:"name,omitempty"`
VmId string `json:"vmId,omitempty"`
Name string `json:"name,omitempty"`
Images []ImageInfo `json:"images,omitempty"`
}

type ImageInfo struct {
ImageName string `json:"imageName,omitempty"`
PvcId string `json:"pvcId,omitempty"`
ImageProcessType string `json:"imageProcessType,omitempty"`
}

type CreateVmImageResult struct {
Expand Down
8 changes: 8 additions & 0 deletions services/bos/api/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,14 @@ func replaceEndpointByBucket(bucket, endpoint string) string {
func setUriAndEndpoint(cli bce.Client, req *bce.BceRequest, ctx *BosContext, endpoint string) {
origin_uri := req.Uri()
bucket := ctx.Bucket
// deal with protocal
if strings.HasPrefix(endpoint, "https://") {
req.SetProtocol(bce.HTTPS_PROTOCAL)
endpoint = strings.TrimPrefix(endpoint, "https://")
} else if strings.HasPrefix(endpoint, "http://") {
req.SetProtocol(bce.DEFAULT_PROTOCOL)
endpoint = strings.TrimPrefix(endpoint, "http://")
}
// set uri, endpoint for cname, cdn, virtual host
if cli.GetBceClientConfig().CnameEnabled || isCnameLikeHost(endpoint) {
req.SetEndpoint(endpoint)
Expand Down

0 comments on commit 0de92b5

Please sign in to comment.