mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
增加:通过cloud provider来过滤虚拟机的功能
This commit is contained in:
@@ -64,6 +64,7 @@ func init() {
|
||||
Secgroup string `help:"Secgroup ID or Name"`
|
||||
AdminSecgroup string `help:"AdminSecgroup ID or Name"`
|
||||
Hypervisor string `help:"Show server of hypervisor" choices:"kvm|esxi|container|baremetal|aliyun"`
|
||||
Manager string `help:"Show servers imported from manager"`
|
||||
BaseListOptions
|
||||
}
|
||||
R(&ServerListOptions{}, "server-list", "List virtual servers", func(s *mcclient.ClientSession, args *ServerListOptions) error {
|
||||
@@ -98,6 +99,9 @@ func init() {
|
||||
if len(args.Hypervisor) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Hypervisor), "hypervisor")
|
||||
}
|
||||
if len(args.Manager) > 0 {
|
||||
params.Add(jsonutils.NewString(args.Manager), "manager")
|
||||
}
|
||||
result, err := modules.Servers.List(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user