mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
修复: webconsole参数缺失,导致yunionapi RPC调用失败
This commit is contained in:
@@ -58,7 +58,7 @@ func init() {
|
||||
})
|
||||
|
||||
R(&o.WebConsoleBaremetalOptions{}, "webconsole-baremetal", "Connect baremetal host webconsole", func(s *mcclient.ClientSession, args *o.WebConsoleBaremetalOptions) error {
|
||||
ret, err := modules.WebConsole.DoBaremetalConnect(s, args.ID)
|
||||
ret, err := modules.WebConsole.DoBaremetalConnect(s, args.ID, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -67,7 +67,7 @@ func init() {
|
||||
})
|
||||
|
||||
R(&o.WebConsoleSshOptions{}, "webconsole-ssh", "Connect ssh webconsole", func(s *mcclient.ClientSession, args *o.WebConsoleSshOptions) error {
|
||||
ret, err := modules.WebConsole.DoSshConnect(s, args.IP)
|
||||
ret, err := modules.WebConsole.DoSshConnect(s, args.IP, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -26,11 +26,7 @@ func NewWebConsoleManager() ResourceManager {
|
||||
Keyword: "webconsole", KeywordPlural: "webconsole"}
|
||||
}
|
||||
|
||||
func (m WebConsoleManager) DoConnect(
|
||||
s *mcclient.ClientSession,
|
||||
connType, id, action string,
|
||||
params jsonutils.JSONObject,
|
||||
) (jsonutils.JSONObject, error) {
|
||||
func (m WebConsoleManager) DoConnect(s *mcclient.ClientSession, connType, id, action string, params jsonutils.JSONObject) (jsonutils.JSONObject, error) {
|
||||
if len(connType) == 0 {
|
||||
return nil, fmt.Errorf("Empty connection resource type")
|
||||
}
|
||||
@@ -44,32 +40,22 @@ func (m WebConsoleManager) DoConnect(
|
||||
return m._post(s, url, params, "webconsole")
|
||||
}
|
||||
|
||||
func (m WebConsoleManager) DoK8sConnect(
|
||||
s *mcclient.ClientSession,
|
||||
id, action string,
|
||||
params jsonutils.JSONObject,
|
||||
) (jsonutils.JSONObject, error) {
|
||||
func (m WebConsoleManager) DoK8sConnect(s *mcclient.ClientSession, id, action string, params jsonutils.JSONObject) (jsonutils.JSONObject, error) {
|
||||
return m.DoConnect(s, "k8s", id, action, params)
|
||||
}
|
||||
|
||||
func (m WebConsoleManager) DoK8sShellConnect(
|
||||
s *mcclient.ClientSession,
|
||||
id string, params jsonutils.JSONObject,
|
||||
) (jsonutils.JSONObject, error) {
|
||||
func (m WebConsoleManager) DoK8sShellConnect(s *mcclient.ClientSession, id string, params jsonutils.JSONObject) (jsonutils.JSONObject, error) {
|
||||
return m.DoK8sConnect(s, id, "shell", params)
|
||||
}
|
||||
|
||||
func (m WebConsoleManager) DoK8sLogConnect(
|
||||
s *mcclient.ClientSession,
|
||||
id string, params jsonutils.JSONObject,
|
||||
) (jsonutils.JSONObject, error) {
|
||||
func (m WebConsoleManager) DoK8sLogConnect(s *mcclient.ClientSession, id string, params jsonutils.JSONObject) (jsonutils.JSONObject, error) {
|
||||
return m.DoK8sConnect(s, id, "log", params)
|
||||
}
|
||||
|
||||
func (m WebConsoleManager) DoBaremetalConnect(s *mcclient.ClientSession, id string) (jsonutils.JSONObject, error) {
|
||||
func (m WebConsoleManager) DoBaremetalConnect(s *mcclient.ClientSession, id string, params jsonutils.JSONObject) (jsonutils.JSONObject, error) {
|
||||
return m.DoConnect(s, "baremetal", id, "", nil)
|
||||
}
|
||||
|
||||
func (m WebConsoleManager) DoSshConnect(s *mcclient.ClientSession, id string) (jsonutils.JSONObject, error) {
|
||||
func (m WebConsoleManager) DoSshConnect(s *mcclient.ClientSession, id string, params jsonutils.JSONObject) (jsonutils.JSONObject, error) {
|
||||
return m.DoConnect(s, "ssh", id, "", nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user