mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
feature: lbagent register (#15872)
Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
@@ -132,7 +132,7 @@ func init() {
|
||||
printLbagent(lbagent)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerAgentActionDeployOptions{}, "lbagent-deploy", "Deploy lbagent", func(s *mcclient.ClientSession, opts *options.LoadbalancerAgentActionDeployOptions) error {
|
||||
/*R(&options.LoadbalancerAgentActionDeployOptions{}, "lbagent-deploy", "Deploy lbagent", func(s *mcclient.ClientSession, opts *options.LoadbalancerAgentActionDeployOptions) error {
|
||||
params, err := opts.Params()
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -151,5 +151,23 @@ func init() {
|
||||
}
|
||||
printLbagent(lbagent)
|
||||
return nil
|
||||
})*/
|
||||
R(&options.LoadbalancerAgentJoinClusterOptions{}, "lbagent-join-cluster", "Agent join cluster", func(s *mcclient.ClientSession, opts *options.LoadbalancerAgentJoinClusterOptions) error {
|
||||
params, _ := opts.Params()
|
||||
lbagent, err := modules.LoadbalancerAgents.PerformAction(s, opts.ID, "join-cluster", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printLbagent(lbagent)
|
||||
return nil
|
||||
})
|
||||
R(&options.LoadbalancerAgentLeaveClusterOptions{}, "lbagent-leave-cluster", "Agent leave cluster", func(s *mcclient.ClientSession, opts *options.LoadbalancerAgentLeaveClusterOptions) error {
|
||||
params, _ := opts.Params()
|
||||
lbagent, err := modules.LoadbalancerAgents.PerformAction(s, opts.ID, "leave-cluster", params)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printLbagent(lbagent)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user