From 8bd23cf3dea87fc7166dd6258e9eae62e35d5df3 Mon Sep 17 00:00:00 2001 From: Qu Xuan Date: Fri, 17 Jul 2020 18:51:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=81=BF=E5=85=8D=E4=B9=8C=E5=85=B0?= =?UTF-8?q?=E5=AF=9F=E5=B8=83=E5=8C=BA=E5=9F=9F=E6=8B=89=E5=8F=96=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/multicloud/aliyun/region.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/multicloud/aliyun/region.go b/pkg/multicloud/aliyun/region.go index 716516e68c..fa8e275baf 100644 --- a/pkg/multicloud/aliyun/region.go +++ b/pkg/multicloud/aliyun/region.go @@ -43,6 +43,8 @@ type SRegion struct { RegionId string LocalName string + RegionEndpoint string + izones []cloudprovider.ICloudZone ivpcs []cloudprovider.ICloudVpc @@ -105,7 +107,11 @@ func (self *SRegion) ecsRequest(apiName string, params map[string]string) (jsonu if err != nil { return nil, err } - return jsonRequest(client, "ecs.aliyuncs.com", ALIYUN_API_VERSION, apiName, params, self.client.debug) + endpoint := self.RegionEndpoint + if len(endpoint) == 0 { + endpoint = "ecs.aliyuncs.com" + } + return jsonRequest(client, endpoint, ALIYUN_API_VERSION, apiName, params, self.client.debug) } func (self *SRegion) rdsRequest(apiName string, params map[string]string) (jsonutils.JSONObject, error) {