Merge pull request #281 in YUNIONIO/onecloud from ~LIZEXI/onecloud:feature/lzx-network-list-by-type to release/2.2.0

* commit 'f6b87be132258e01a97a0cf8de396648377ce9a8':
  network list by server_type
This commit is contained in:
邱剑
2018-10-10 16:37:16 +08:00
+9 -5
View File
@@ -12,11 +12,12 @@ import (
func init() {
type NetworkListOptions struct {
options.BaseListOptions
Ip string `help:"search networks that contain this IP"`
Zone string `help:"search networks in a zone"`
Wire string `help:"search networks belongs to a wire"`
Vpc string `help:"search networks belongs to a VPC"`
Region string `help:"search networks belongs to a CloudRegion"`
Ip string `help:"search networks that contain this IP"`
Zone string `help:"search networks in a zone"`
Wire string `help:"search networks belongs to a wire"`
Vpc string `help:"search networks belongs to a VPC"`
Region string `help:"search networks belongs to a CloudRegion"`
ServerType string `help:"search networks belongs to a ServerType"`
}
R(&NetworkListOptions{}, "network-list", "List networks", func(s *mcclient.ClientSession, args *NetworkListOptions) error {
var params *jsonutils.JSONDict
@@ -40,6 +41,9 @@ func init() {
if len(args.Region) > 0 {
params.Add(jsonutils.NewString(args.Region), "cloudregion")
}
if len(args.ServerType) > 0 {
params.Add(jsonutils.NewString(args.ServerType), "server_type")
}
var result *modules.ListResult
var err error
if len(args.Wire) > 0 {