mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #1251 in YUNIONIO/onecloud from ~QIUJIAN/onecloud:hotfix/qj-batch-update-joint-module-support to release/2.7.0
* commit '4d888f172542b5fe645e8cef36258150120d546e': fix: support batch update joint module
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"net/url"
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
)
|
||||
|
||||
@@ -175,3 +174,15 @@ func (this *JointResourceManager) Patch(s *mcclient.ClientSession, mid, sid stri
|
||||
}
|
||||
return this.filterSingleResult(s, result, nil)
|
||||
}
|
||||
|
||||
func (this *JointResourceManager) BatchUpdate(s *mcclient.ClientSession, mid string, sids []string, query jsonutils.JSONObject, params jsonutils.JSONObject) []SubmitResult {
|
||||
return BatchDo(sids, func(sid string) (jsonutils.JSONObject, error) {
|
||||
return this.Update(s, mid, sid, query, params)
|
||||
})
|
||||
}
|
||||
|
||||
func (this *JointResourceManager) BatchPatch(s *mcclient.ClientSession, mid string, sids []string, query jsonutils.JSONObject, params jsonutils.JSONObject) []SubmitResult {
|
||||
return BatchDo(sids, func(sid string) (jsonutils.JSONObject, error) {
|
||||
return this.Patch(s, mid, sid, query, params)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
|
||||
"yunion.io/x/jsonutils"
|
||||
"yunion.io/x/log"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/mcclient"
|
||||
)
|
||||
|
||||
@@ -139,7 +138,9 @@ type JointManager interface {
|
||||
BatchDetach(s *mcclient.ClientSession, mid string, sids []string) []SubmitResult
|
||||
BatchDetach2(s *mcclient.ClientSession, mid string, sids []string) []SubmitResult
|
||||
Update(s *mcclient.ClientSession, mid, sid string, query jsonutils.JSONObject, params jsonutils.JSONObject) (jsonutils.JSONObject, error)
|
||||
BatchUpdate(s *mcclient.ClientSession, mid string, sids []string, query jsonutils.JSONObject, params jsonutils.JSONObject) []SubmitResult
|
||||
Patch(s *mcclient.ClientSession, mid, sid string, query jsonutils.JSONObject, params jsonutils.JSONObject) (jsonutils.JSONObject, error)
|
||||
BatchPatch(s *mcclient.ClientSession, mid string, sids []string, query jsonutils.JSONObject, params jsonutils.JSONObject) []SubmitResult
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user