mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
fix: 避免频繁同步rds sku信息
This commit is contained in:
@@ -487,6 +487,10 @@ func syncRegionDBInstanceSkus(ctx context.Context, userCred mcclient.TokenCreden
|
||||
}
|
||||
|
||||
for _, region := range cloudregions {
|
||||
if !region.GetDriver().IsSupportedDBInstance() {
|
||||
log.Infof("region %s(%s) not support dbinstance, skip sync", region.Name, region.Id)
|
||||
continue
|
||||
}
|
||||
result := DBInstanceSkuManager.syncDBInstanceSkus(ctx, userCred, ®ion, meta)
|
||||
msg := result.Result()
|
||||
notes := fmt.Sprintf("SyncDBInstanceSkus for region %s result: %s", region.Name, msg)
|
||||
|
||||
@@ -36,6 +36,7 @@ type IRegionDriver interface {
|
||||
IElasticcacheAccount
|
||||
IElasticcacheAcl
|
||||
IElasticcacheBackup
|
||||
IDBInstanceDriver
|
||||
|
||||
ValidateCreateLoadbalancerData(ctx context.Context, userCred mcclient.TokenCredential, data *jsonutils.JSONDict) (*jsonutils.JSONDict, error)
|
||||
ValidateDeleteLoadbalancerCondition(ctx context.Context, lb *SLoadbalancer) error
|
||||
@@ -122,6 +123,11 @@ type IRegionDriver interface {
|
||||
GetDefaultSecurityGroupVpcId() string
|
||||
GetSecurityGroupVpcId(ctx context.Context, userCred mcclient.TokenCredential, region *SCloudregion, host *SHost, vpc *SVpc, classic bool) (string, error)
|
||||
|
||||
IsSupportedBillingCycle(bc billing.SBillingCycle, resource string) bool
|
||||
GetSecgroupVpcid(vpcId string) string
|
||||
}
|
||||
|
||||
type IDBInstanceDriver interface {
|
||||
ValidateCreateDBInstanceData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, input *api.SDBInstanceCreateInput, skus []SDBInstanceSku, network *SNetwork) (*api.SDBInstanceCreateInput, error)
|
||||
ValidateCreateDBInstanceAccountData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, instance *SDBInstance, input *api.SDBInstanceAccountCreateInput) (*api.SDBInstanceAccountCreateInput, error)
|
||||
ValidateCreateDBInstanceDatabaseData(ctx context.Context, userCred mcclient.TokenCredential, ownerId mcclient.IIdentityProvider, instance *SDBInstance, input *api.SDBInstanceDatabaseCreateInput) (*api.SDBInstanceDatabaseCreateInput, error)
|
||||
@@ -132,14 +138,14 @@ type IRegionDriver interface {
|
||||
|
||||
RequestCreateDBInstance(ctx context.Context, userCred mcclient.TokenCredential, dbinstance *SDBInstance, task taskman.ITask) error
|
||||
RequestCreateDBInstanceBackup(ctx context.Context, userCred mcclient.TokenCredential, instance *SDBInstance, backup *SDBInstanceBackup, task taskman.ITask) error
|
||||
RequestRenewDBInstance(instance *SDBInstance, bc billing.SBillingCycle) (time.Time, error)
|
||||
RequestChangeDBInstanceConfig(ctx context.Context, userCred mcclient.TokenCredential, instance *SDBInstance, task taskman.ITask) error
|
||||
|
||||
IsSupportedDBInstance() bool
|
||||
IsSupportDBInstancePublicConnection() bool
|
||||
IsSupportKeepDBInstanceManualBackup() bool
|
||||
|
||||
IsSupportedBillingCycle(bc billing.SBillingCycle, resource string) bool
|
||||
GetSecgroupVpcid(vpcId string) string
|
||||
InitDBInstanceUser(dbinstance *SDBInstance, task taskman.ITask, desc *cloudprovider.SManagedDBInstanceCreateConfig) error
|
||||
RequestRenewDBInstance(instance *SDBInstance, bc billing.SBillingCycle) (time.Time, error)
|
||||
RequestChangeDBInstanceConfig(ctx context.Context, userCred mcclient.TokenCredential, instance *SDBInstance, task taskman.ITask) error
|
||||
}
|
||||
|
||||
type IElasticcacheDriver interface {
|
||||
|
||||
@@ -1536,6 +1536,10 @@ func (self *SAliyunRegionDriver) RequestElasticcacheAccountResetPassword(ctx con
|
||||
return ea.SyncWithCloudElasticcacheAccount(ctx, userCred, iea)
|
||||
}
|
||||
|
||||
func (self *SAliyunRegionDriver) IsSupportedDBInstance() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (self *SAliyunRegionDriver) IsSupportedElasticcache() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -299,6 +299,10 @@ func (self *SBaseRegionDriver) IsSupportKeepDBInstanceManualBackup() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (self *SBaseRegionDriver) IsSupportedDBInstance() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (self *SBaseRegionDriver) IsSupportedElasticcache() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -2563,6 +2563,10 @@ func (self *SHuaWeiRegionDriver) AllowUpdateElasticcacheAuthMode(ctx context.Con
|
||||
return fmt.Errorf("not support update huawei elastic cache auth_mode")
|
||||
}
|
||||
|
||||
func (self *SHuaWeiRegionDriver) IsSupportedDBInstance() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (self *SHuaWeiRegionDriver) IsSupportedElasticcache() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user