增加keystone project add tag接口支持

This commit is contained in:
Qiu Jian
2018-11-01 22:30:13 +08:00
parent 5ce6eafb4e
commit c303afcb46
2 changed files with 24 additions and 0 deletions
+13
View File
@@ -2,6 +2,7 @@ package shell
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
)
@@ -350,4 +351,16 @@ func init() {
printList(imgs, modules.Images.GetColumns(s))
return nil
})
type ProjectAddTagsOptions struct {
ID string `help:"ID or name of project"`
Tags []string `help:"tags added to project"`
}
R(&ProjectAddTagsOptions{}, "project-add-tags", "Add project with tags", func(s *mcclient.ClientSession, args *ProjectAddTagsOptions) error {
err := modules.Projects.AddTags(s, args.ID, args.Tags)
if err != nil {
return err
}
return nil
})
}