diff --git a/bce/config.go b/bce/config.go index f330a72e..c55090aa 100644 --- a/bce/config.go +++ b/bce/config.go @@ -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 diff --git a/services/bec/api/model.go b/services/bec/api/model.go index 0b1524b7..19b3e099 100644 --- a/services/bec/api/model.go +++ b/services/bec/api/model.go @@ -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 { diff --git a/services/bos/api/util.go b/services/bos/api/util.go index 4ed97374..31ba002b 100644 --- a/services/bos/api/util.go +++ b/services/bos/api/util.go @@ -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)