From 50b3603d9d534e333412c03bcf6fd005ab6eda42 Mon Sep 17 00:00:00 2001 From: Qiu Jian Date: Wed, 9 Jan 2019 17:25:16 +0800 Subject: [PATCH] =?UTF-8?q?mcclient=20module=E5=A2=9E=E5=8A=A0DeleteWithPa?= =?UTF-8?q?ram=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=85=81=E8=AE=B8=E6=8A=8AqueryS?= =?UTF-8?q?tring=E4=BC=A0=E9=80=92=E5=88=B0=E5=90=8E=E7=AB=AF=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=89=8D=E7=AB=AF=E6=97=A0=E6=B3=95=E6=B8=85?= =?UTF-8?q?=E7=90=86=E5=9B=9E=E6=94=B6=E7=AB=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/mcclient/modules/modules.go | 6 ++++++ pkg/mcclient/modules/resource.go | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/pkg/mcclient/modules/modules.go b/pkg/mcclient/modules/modules.go index da1774fbcc..9304a20744 100644 --- a/pkg/mcclient/modules/modules.go +++ b/pkg/mcclient/modules/modules.go @@ -110,11 +110,17 @@ type Manager interface { BatchPerformActionInContext(session *mcclient.ClientSession, idlist []string, action string, params jsonutils.JSONObject, ctx Manager, ctxid string) []SubmitResult BatchPerformActionInContexts(session *mcclient.ClientSession, idlist []string, action string, params jsonutils.JSONObject, ctxs []ManagerContext) []SubmitResult Delete(session *mcclient.ClientSession, id string, body jsonutils.JSONObject) (jsonutils.JSONObject, error) + DeleteWithParam(session *mcclient.ClientSession, id string, query jsonutils.JSONObject, body jsonutils.JSONObject) (jsonutils.JSONObject, error) DeleteInContext(session *mcclient.ClientSession, id string, body jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error) + DeleteInContextWithParam(session *mcclient.ClientSession, id string, query jsonutils.JSONObject, body jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error) DeleteInContexts(session *mcclient.ClientSession, id string, body jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error) + DeleteInContextsWithParam(session *mcclient.ClientSession, id string, query jsonutils.JSONObject, body jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error) BatchDelete(session *mcclient.ClientSession, idlist []string, body jsonutils.JSONObject) []SubmitResult + BatchDeleteWithParam(session *mcclient.ClientSession, idlist []string, query jsonutils.JSONObject, body jsonutils.JSONObject) []SubmitResult BatchDeleteInContext(session *mcclient.ClientSession, idlist []string, body jsonutils.JSONObject, ctx Manager, ctxid string) []SubmitResult + BatchDeleteInContextWithParam(session *mcclient.ClientSession, idlist []string, query jsonutils.JSONObject, body jsonutils.JSONObject, ctx Manager, ctxid string) []SubmitResult BatchDeleteInContexts(session *mcclient.ClientSession, idlist []string, body jsonutils.JSONObject, ctxs []ManagerContext) []SubmitResult + BatchDeleteInContextsWithParam(session *mcclient.ClientSession, idlist []string, query jsonutils.JSONObject, body jsonutils.JSONObject, ctxs []ManagerContext) []SubmitResult } type JointManager interface { diff --git a/pkg/mcclient/modules/resource.go b/pkg/mcclient/modules/resource.go index f7c544aa6c..4c1b1da5f2 100644 --- a/pkg/mcclient/modules/resource.go +++ b/pkg/mcclient/modules/resource.go @@ -485,6 +485,10 @@ func (this *ResourceManager) DeleteInContext(session *mcclient.ClientSession, id return this.DeleteInContexts(session, id, body, []ManagerContext{{ctx, ctxid}}) } +func (this *ResourceManager) DeleteInContextWithParam(session *mcclient.ClientSession, id string, query jsonutils.JSONObject, body jsonutils.JSONObject, ctx Manager, ctxid string) (jsonutils.JSONObject, error) { + return this.DeleteInContextsWithParam(session, id, query, body, []ManagerContext{{ctx, ctxid}}) +} + func (this *ResourceManager) DeleteInContexts(session *mcclient.ClientSession, id string, body jsonutils.JSONObject, ctxs []ManagerContext) (jsonutils.JSONObject, error) { return this.deleteInContexts(session, id, nil, body, ctxs) }