mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
climc: add server-modify-src-check
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 \"-\""`
|
||||
|
||||
Reference in New Issue
Block a user