fix: 1. capability privilege interface bugfix 2. cloud-provider

privilege issue
This commit is contained in:
Qiu Jian
2019-06-12 08:58:42 +08:00
parent ef63ef634c
commit a7bd209416
7 changed files with 56 additions and 5 deletions
+8 -1
View File
@@ -17,13 +17,20 @@ package shell
import (
"yunion.io/x/onecloud/pkg/mcclient"
"yunion.io/x/onecloud/pkg/mcclient/modules"
"yunion.io/x/onecloud/pkg/mcclient/options"
)
func init() {
type CapabilitiesOptions struct {
Domain string `help:"ID or name of domain"`
Scope string `help:"query scope" choices:"system|domain|project"`
}
R(&CapabilitiesOptions{}, "capabilities", "Show backend capabilities", func(s *mcclient.ClientSession, args *CapabilitiesOptions) error {
result, err := modules.Capabilities.List(s, nil)
query, err := options.StructToParams(args)
if err != nil {
return err
}
result, err := modules.Capabilities.List(s, query)
if err != nil {
return err
}
+2
View File
@@ -176,6 +176,8 @@ func init() {
type CloudregionCapabiltyOptions struct {
ID string `help:"ID or name of cloud region to check" json:"-"`
Domain string `help:"cloud region domain"`
ShowEmulated bool `help:"show emulated cloud region"`
}
R(&CloudregionCapabiltyOptions{}, "cloud-region-capability", "Show region's capacibilities", func(s *mcclient.ClientSession, args *CloudregionCapabiltyOptions) error {
query, err := options.StructToParams(args)