Automatic merge from release/2.2.0 -> release/2.3.0

* commit '6fd50aac20dda17a661f925156c82b559aa04b7f':
  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 {