mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-30 18:23:35 +08:00
aliyun: region: rename ecsClient to sdkClient
This commit is contained in:
@@ -17,7 +17,7 @@ import (
|
||||
|
||||
type SRegion struct {
|
||||
client *SAliyunClient
|
||||
ecsClient *sdk.Client
|
||||
sdkClient *sdk.Client
|
||||
ossClient *oss.Client
|
||||
|
||||
RegionId string
|
||||
@@ -44,15 +44,15 @@ func (self *SRegion) GetMetadata() *jsonutils.JSONDict {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (self *SRegion) getEcsClient() (*sdk.Client, error) {
|
||||
if self.ecsClient == nil {
|
||||
func (self *SRegion) getSdkClient() (*sdk.Client, error) {
|
||||
if self.sdkClient == nil {
|
||||
cli, err := sdk.NewClientWithAccessKey(self.RegionId, self.client.accessKey, self.client.secret)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
self.ecsClient = cli
|
||||
self.sdkClient = cli
|
||||
}
|
||||
return self.ecsClient, nil
|
||||
return self.sdkClient, nil
|
||||
}
|
||||
|
||||
// oss endpoint
|
||||
@@ -79,7 +79,7 @@ func (self *SRegion) GetOssClient() (*oss.Client, error) {
|
||||
}
|
||||
|
||||
func (self *SRegion) ecsRequest(apiName string, params map[string]string) (jsonutils.JSONObject, error) {
|
||||
client, err := self.getEcsClient()
|
||||
client, err := self.getSdkClient()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user