From 3716e88878b3a545d96b5ce8d0936bd48608caa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Wed, 7 Nov 2018 17:56:28 +0800 Subject: [PATCH] =?UTF-8?q?Image=E6=B7=BB=E5=8A=A0description=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/climc/shell/images.go | 8 ++++++-- pkg/mcclient/modules/mod_images.go | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/climc/shell/images.go b/cmd/climc/shell/images.go index ac82bc6d50..cc5e507ad0 100644 --- a/cmd/climc/shell/images.go +++ b/cmd/climc/shell/images.go @@ -205,8 +205,9 @@ func init() { }) type ImageUpdateOptions struct { - ID string `help:"ID or Name of Image"` - Name string `help:"New name of the image"` + ID string `help:"ID or Name of Image"` + Name string `help:"New name of the image"` + Description string `help:"Description of image"` ImageOptionalOptions } @@ -227,6 +228,9 @@ func init() { if len(args.Name) > 0 { params.Add(jsonutils.NewString(args.Name), "name") } + if len(args.Description) > 0 { + params.Add(jsonutils.NewString(args.Description), "description") + } err := addImageOptionalOptions(s, params, args.ImageOptionalOptions) if err != nil { return err diff --git a/pkg/mcclient/modules/mod_images.go b/pkg/mcclient/modules/mod_images.go index 15997322f9..120c001114 100644 --- a/pkg/mcclient/modules/mod_images.go +++ b/pkg/mcclient/modules/mod_images.go @@ -560,7 +560,7 @@ func init() { "OS_Distribution", "OS_version", "Min_disk", "Min_ram", "Status", "Notes", "OS_arch", "Preference", - "OS_Codename", "Parent_id"}, + "OS_Codename", "Parent_id", "Description"}, []string{"Owner", "Owner_name"})} register(&Images) }