mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(region): fix sync project bug and add climc choices
This commit is contained in:
@@ -517,8 +517,8 @@ type SyncRangeInput struct {
|
||||
Host []string `json:"host"`
|
||||
|
||||
// 按资源类型同步,可输入多个
|
||||
// enmu: compute, network, loadbalancer, objectstore, rds, cache, nat, nas, waf, mongodb, es, kafka, app, container
|
||||
Resources []string `json:"resources" choices:"compute|network|loadbalancer|objectstore|rds|cache|nat|nas|waf|mongodb|es|kafka|app|container|eip|tablestore"`
|
||||
// enmu: project, compute, network, eip, loadbalancer, objectstore, rds, cache, event, cloudid, dnszone, public_ip, intervpcnetwork, saml_auth, quota, nat, nas, waf, mongodb, es, kafka, app, cdn, container, ipv6_gateway, tablestore, modelarts, vpcpeer, misc
|
||||
Resources []string `json:"resources" choices:"project|compute|network|eip|loadbalancer|objectstore|rds|cache|event|cloudid|dnszone|public_ip|intervpcnetwork|saml_auth|quota|nat|nas|waf|mongodb|es|kafka|app|cdn|container|ipv6_gateway|tablestore|modelarts|vpcpeer|misc"`
|
||||
}
|
||||
|
||||
type SAccountPermission struct {
|
||||
|
||||
@@ -509,6 +509,10 @@ func (sr *SSyncRange) GetRegionIds() ([]string, error) {
|
||||
}
|
||||
|
||||
func (sr *SSyncRange) NeedSyncResource(res string) bool {
|
||||
if sr.FullSync {
|
||||
return true
|
||||
}
|
||||
|
||||
if len(sr.Resources) == 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -83,11 +83,9 @@ func (self *CloudAccountSyncInfoTask) OnCloudaccountSyncReady(ctx context.Contex
|
||||
return
|
||||
}
|
||||
|
||||
if syncRange.FullSync {
|
||||
err := models.SyncCloudaccountResources(ctx, self.GetUserCred(), cloudaccount, &syncRange)
|
||||
if err != nil {
|
||||
log.Errorf("SyncAccountResources error: %v", err)
|
||||
}
|
||||
err := models.SyncCloudaccountResources(ctx, self.GetUserCred(), cloudaccount, &syncRange)
|
||||
if err != nil {
|
||||
log.Errorf("SyncAccountResources error: %v", err)
|
||||
}
|
||||
|
||||
cloudproviders := cloudaccount.GetEnabledCloudproviders()
|
||||
|
||||
Reference in New Issue
Block a user