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:
邱剑
2018-09-27 16:06:52 +08:00
2 changed files with 10 additions and 0 deletions
+1
View File
@@ -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
+9
View File
@@ -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)
}