From e686d2996dbf03ca87751332a8b2066b3c46573f Mon Sep 17 00:00:00 2001 From: zhengjiajie Date: Mon, 17 Sep 2018 11:33:45 +0800 Subject: [PATCH] zhengjiajie add param --- cmd/climc/shell/res_results.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cmd/climc/shell/res_results.go b/cmd/climc/shell/res_results.go index 19fb101b98..876eaf5a6b 100644 --- a/cmd/climc/shell/res_results.go +++ b/cmd/climc/shell/res_results.go @@ -14,9 +14,11 @@ func init() { StatMonth string `help:"stat_month of the query"` StartDate string `help:"start_date of the query"` EndDate string `help:"end_date of the query"` + ResType string `help:"res_type of the query"` + Platform string `help:"platform of the query"` Export string `help:"export of the query"` - ExportKeys string `help:"export_keys of the query"` - ExportTexts string `help:"export_texts of the query"` + ExportKeys []string `help:"export_keys of the query"` + ExportTexts []string `help:"export_texts of the query"` ProjectId string `help:"project_id of the query"` } R(&ResResultsListOptions{}, "resresult-list", "List all res results ", func(s *mcclient.ClientSession, args *ResResultsListOptions) error { @@ -39,14 +41,20 @@ func init() { if len(args.EndDate) > 0 { params.Add(jsonutils.NewString(args.EndDate), "end_date") } + if len(args.ResType) > 0 { + params.Add(jsonutils.NewString(args.ResType), "res_type") + } + if len(args.Platform) > 0 { + params.Add(jsonutils.NewString(args.Platform), "platform") + } if len(args.Export) > 0 { params.Add(jsonutils.NewString(args.Export), "export") } if len(args.ExportKeys) > 0 { - params.Add(jsonutils.NewString(args.ExportKeys), "export_keys") + params.Add(jsonutils.NewStringArray(args.ExportKeys), "export_keys") } if len(args.ExportTexts) > 0 { - params.Add(jsonutils.NewString(args.ExportTexts), "export_texts") + params.Add(jsonutils.NewStringArray(args.ExportTexts), "export_texts") } if len(args.ProjectId) > 0 { params.Add(jsonutils.NewString(args.ProjectId), "project_id")