mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-01 15:07:17 +08:00
Merge pull request #253 in YUNIONIO/onecloud from ~QUXUAN/onecloud:hotfix/qx-interface to release/2.1.0
* commit '03653febc708d5337024dc88aaaf2165c0d9c43d': 补充modules interface
This commit is contained in:
@@ -102,6 +102,7 @@ type Manager interface {
|
||||
BatchPatchInContext(session *mcclient.ClientSession, idlist []string, params jsonutils.JSONObject, ctx Manager, ctxid string) []SubmitResult
|
||||
BatchPatchInContexts(session *mcclient.ClientSession, idlist []string, params jsonutils.JSONObject, ctxs []ManagerContext) []SubmitResult
|
||||
PerformAction(session *mcclient.ClientSession, id string, action string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)
|
||||
PerformClassAction(session *mcclient.ClientSession, action string, params jsonutils.JSONObject) (jsonutils.JSONObject, error)
|
||||
PerformActionInContext(session *mcclient.ClientSession, id string, action string, params jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error)
|
||||
PerformActionInContexts(session *mcclient.ClientSession, id string, action string, params jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error)
|
||||
BatchPerformAction(session *mcclient.ClientSession, idlist []string, action string, params jsonutils.JSONObject) []SubmitResult
|
||||
|
||||
@@ -351,6 +351,15 @@ func (this *ResourceManager) PerformActionInContexts(session *mcclient.ClientSes
|
||||
return this._post(session, path, this.params2Body(params), this.Keyword)
|
||||
}
|
||||
|
||||
func (this *ResourceManager) PerformClassAction(session *mcclient.ClientSession, action string, params jsonutils.JSONObject) (jsonutils.JSONObject, error) {
|
||||
return this.PerformClassActionInContexts(session, action, params, nil)
|
||||
}
|
||||
|
||||
func (this *ResourceManager) PerformClassActionInContexts(session *mcclient.ClientSession, action string, params jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error) {
|
||||
path := fmt.Sprintf("/%s/%s", this.ContextPath(ctxs), url.PathEscape(action))
|
||||
return this._post(session, path, params, this.Keyword)
|
||||
}
|
||||
|
||||
func (this *ResourceManager) BatchPerformAction(session *mcclient.ClientSession, idlist []string, action string, params jsonutils.JSONObject) []SubmitResult {
|
||||
return this.BatchPerformActionInContexts(session, idlist, action, params, nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user