mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 06:09:39 +08:00
fix: 1. capability privilege interface bugfix 2. cloud-provider
privilege issue
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user