mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix: keep climc network-create backward compatibility (#24341)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
@@ -98,6 +98,22 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
|
||||
type NetworkCreate3Options struct {
|
||||
compute_options.NetworkCreateOptions `start_ip->positional:"false" end_ip->positional:"false" net_mask->positional:"false"`
|
||||
}
|
||||
R(&NetworkCreate3Options{}, "network-create3", "Create a dual-stack virtual network", func(s *mcclient.ClientSession, args *NetworkCreate3Options) error {
|
||||
params, err := args.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
net, err := modules.Networks.Create(s, params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(net)
|
||||
return nil
|
||||
})
|
||||
|
||||
type NetworkSplitOptions struct {
|
||||
NETWORK string `help:"ID or name of network to split"`
|
||||
IP string `help:"Start ip of the split network"`
|
||||
|
||||
@@ -67,9 +67,9 @@ func (opts *NetworkListOptions) Params() (jsonutils.JSONObject, error) {
|
||||
type NetworkCreateOptions struct {
|
||||
WIRE string `help:"ID or Name of wire in which the network is created"`
|
||||
NETWORK string `help:"Name of new network"`
|
||||
StartIp string `help:"Start of IPv4 address range"`
|
||||
EndIp string `help:"End of IPv4 address rnage"`
|
||||
NetMask int64 `help:"Length of network mask"`
|
||||
StartIp string `help:"Start of IPv4 address range" positional:"true" json:"start_ip"`
|
||||
EndIp string `help:"End of IPv4 address rnage" positional:"true" json:"end_ip"`
|
||||
NetMask int64 `help:"Length of network mask" positional:"true" json:"net_mask"`
|
||||
Gateway string `help:"Default gateway"`
|
||||
|
||||
StartIp6 string `help:"IPv6 start ip"`
|
||||
|
||||
Reference in New Issue
Block a user