diff --git a/cmd/climc/shell/servers.go b/cmd/climc/shell/servers.go index c3b66548b5..de8ae21587 100644 --- a/cmd/climc/shell/servers.go +++ b/cmd/climc/shell/servers.go @@ -460,6 +460,19 @@ func init() { return nil }) + R(&options.ServerModifySrcCheckOptions{}, "server-modify-src-check", "Modify src ip, mac check settings", func(s *mcclient.ClientSession, opts *options.ServerModifySrcCheckOptions) error { + params, err := options.StructToParams(opts) + if err != nil { + return err + } + srv, err := modules.Servers.PerformAction(s, opts.ID, "modify-src-check", params) + if err != nil { + return err + } + printObject(srv) + return nil + }) + R(&options.ServerSecGroupsOptions{}, "server-set-secgroup", "Set security groups to a VM", func(s *mcclient.ClientSession, opts *options.ServerSecGroupsOptions) error { params, err := options.StructToParams(opts) if err != nil { diff --git a/pkg/mcclient/options/servers.go b/pkg/mcclient/options/servers.go index e6e88804c5..94d468af83 100644 --- a/pkg/mcclient/options/servers.go +++ b/pkg/mcclient/options/servers.go @@ -532,6 +532,12 @@ type ServerSecGroupsOptions struct { Secgrp []string `help:"Ids of Security Groups" metavar:"Security Groups" positional:"true"` } +type ServerModifySrcCheckOptions struct { + ID string `help:"ID or Name of server" metavar:"Guest" json:"-"` + SrcIpCheck string `help:"Turn on/off src ip check" choices:"on|off"` + SrcMacCheck string `help:"Turn on/off src mac check" choices:"on|off"` +} + type ServerSendKeyOptions struct { ID string `help:"ID or Name of server" metavar:"Guest" json:"-"` KEYS string `help:"Special keys to send, eg. ctrl, alt, f12, shift, etc, separated by \"-\""`