mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #14074 from ioito/hotfix/qx-apsara-credential-update
fix(region): apsara credential update
This commit is contained in:
@@ -79,6 +79,7 @@ func init() {
|
||||
cmd.PerformWithKeyword("update-credential-aws", "update-credential", &options.SAWSCloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("update-credential-openstack", "update-credential", &options.SOpenStackCloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("update-credential-huawei", "update-credential", &options.SHuaweiCloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("update-credential-apsara", "update-credential", &options.SApsaraCloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("update-credential-hcso", "update-credential", &options.SHCSOAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("update-credential-ucloud", "update-credential", &options.SUcloudCloudAccountUpdateCredentialOptions{})
|
||||
cmd.PerformWithKeyword("update-credential-zstack", "update-credential", &options.SZStackCloudAccountUpdateCredentialOptions{})
|
||||
|
||||
@@ -680,12 +680,17 @@ func (self *SCloudaccount) PerformTestConnectivity(ctx context.Context, userCred
|
||||
return nil, err
|
||||
}
|
||||
|
||||
defaultRegion, _ := jsonutils.Marshal(self.Options).GetString("default_region")
|
||||
_, _, err = cloudprovider.IsValidCloudAccount(cloudprovider.ProviderConfig{
|
||||
URL: self.AccessUrl,
|
||||
Vendor: self.Provider,
|
||||
Account: account.Account,
|
||||
Secret: account.Secret,
|
||||
|
||||
DefaultRegion: defaultRegion,
|
||||
|
||||
ReadOnly: self.ReadOnly,
|
||||
|
||||
ProxyFunc: self.proxyFunc(),
|
||||
})
|
||||
if err != nil {
|
||||
@@ -755,12 +760,18 @@ func (self *SCloudaccount) PerformUpdateCredential(ctx context.Context, userCred
|
||||
}
|
||||
}
|
||||
|
||||
defaultRegion, _ := jsonutils.Marshal(self.Options).GetString("default_region")
|
||||
_, accountId, err := cloudprovider.IsValidCloudAccount(cloudprovider.ProviderConfig{
|
||||
Vendor: self.Provider,
|
||||
URL: self.AccessUrl,
|
||||
Account: account.Account,
|
||||
Secret: account.Secret,
|
||||
Options: self.Options,
|
||||
Name: self.Name,
|
||||
Vendor: self.Provider,
|
||||
URL: self.AccessUrl,
|
||||
Account: account.Account,
|
||||
Secret: account.Secret,
|
||||
Options: self.Options,
|
||||
DefaultRegion: defaultRegion,
|
||||
|
||||
ReadOnly: self.ReadOnly,
|
||||
|
||||
ProxyFunc: self.proxyFunc(),
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -432,6 +432,15 @@ func (opts *SAliyunCloudAccountUpdateCredentialOptions) Params() (jsonutils.JSON
|
||||
return jsonutils.Marshal(opts), nil
|
||||
}
|
||||
|
||||
type SApsaraCloudAccountUpdateCredentialOptions struct {
|
||||
SCloudAccountIdOptions
|
||||
SAccessKeyCredential
|
||||
}
|
||||
|
||||
func (opts *SApsaraCloudAccountUpdateCredentialOptions) Params() (jsonutils.JSONObject, error) {
|
||||
return jsonutils.Marshal(opts), nil
|
||||
}
|
||||
|
||||
type SAzureCloudAccountUpdateCredentialOptions struct {
|
||||
SCloudAccountIdOptions
|
||||
SAzureCredential
|
||||
|
||||
Reference in New Issue
Block a user