Skip to content

Commit 0de92b5

Browse files
committed
fix bugs
1 parent 2066d86 commit 0de92b5

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

bce/config.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ import (
2626

2727
// Constants and default values for the package bce
2828
const (
29-
SDK_VERSION = "0.9.185"
29+
SDK_VERSION = "0.9.186"
3030
URI_PREFIX = "/" // now support uri without prefix "v1" so just set root path
3131
DEFAULT_DOMAIN = "baidubce.com"
3232
DEFAULT_PROTOCOL = "http"
33+
HTTPS_PROTOCAL = "https"
3334
DEFAULT_REGION = "bj"
3435
DEFAULT_CONTENT_TYPE = "application/json;charset=utf-8"
3536
DEFAULT_CONNECTION_TIMEOUT_IN_MILLIS = 1200 * 1000

services/bec/api/model.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,8 +771,15 @@ type VmServiceBatchActionArgs struct {
771771
}
772772

773773
type CreateVmImageArgs struct {
774-
VmId string `json:"vmId,omitempty"`
775-
Name string `json:"name,omitempty"`
774+
VmId string `json:"vmId,omitempty"`
775+
Name string `json:"name,omitempty"`
776+
Images []ImageInfo `json:"images,omitempty"`
777+
}
778+
779+
type ImageInfo struct {
780+
ImageName string `json:"imageName,omitempty"`
781+
PvcId string `json:"pvcId,omitempty"`
782+
ImageProcessType string `json:"imageProcessType,omitempty"`
776783
}
777784

778785
type CreateVmImageResult struct {

services/bos/api/util.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,14 @@ func replaceEndpointByBucket(bucket, endpoint string) string {
366366
func setUriAndEndpoint(cli bce.Client, req *bce.BceRequest, ctx *BosContext, endpoint string) {
367367
origin_uri := req.Uri()
368368
bucket := ctx.Bucket
369+
// deal with protocal
370+
if strings.HasPrefix(endpoint, "https://") {
371+
req.SetProtocol(bce.HTTPS_PROTOCAL)
372+
endpoint = strings.TrimPrefix(endpoint, "https://")
373+
} else if strings.HasPrefix(endpoint, "http://") {
374+
req.SetProtocol(bce.DEFAULT_PROTOCOL)
375+
endpoint = strings.TrimPrefix(endpoint, "http://")
376+
}
369377
// set uri, endpoint for cname, cdn, virtual host
370378
if cli.GetBceClientConfig().CnameEnabled || isCnameLikeHost(endpoint) {
371379
req.SetEndpoint(endpoint)

0 commit comments

Comments
 (0)