diff --git a/agent/agent_windows.go b/agent/agent_windows.go index 37808ea..a240363 100644 --- a/agent/agent_windows.go +++ b/agent/agent_windows.go @@ -627,7 +627,7 @@ func (a *WindowsAgent) SyncMeshNodeID() { return } - url := fmt.Sprintf("%s/api/v1/%d/meshinfo/", a.Server, a.AgentPK) + url := fmt.Sprintf("%s/api/v3/%d/meshinfo/", a.Server, a.AgentPK) req := &APIRequest{ URL: url, Method: "GET", @@ -869,7 +869,7 @@ func (a *WindowsAgent) CleanupPythonAgent() { // UpdateSalt downloads the latest salt minion and performs an update func (a *WindowsAgent) UpdateSalt() { - url := fmt.Sprintf("%s/api/v2/%s/saltminion/", a.Server, a.AgentID) + url := fmt.Sprintf("%s/api/v3/%s/saltminion/", a.Server, a.AgentID) req := &APIRequest{ URL: url, Headers: a.Headers, @@ -956,7 +956,7 @@ func (a *WindowsAgent) UpdateSalt() { WaitForService("salt-minion", "running", 10) - req.URL = a.Server + "/api/v2/saltminion/" + req.URL = a.Server + "/api/v3/saltminion/" req.Method = "PUT" req.Payload = map[string]string{"ver": data.LatestVer, "agent_id": a.AgentID} _, _ = req.MakeRequest() diff --git a/agent/install_windows.go b/agent/install_windows.go index cd1d4b6..f979586 100644 --- a/agent/install_windows.go +++ b/agent/install_windows.go @@ -120,7 +120,7 @@ func (a *WindowsAgent) Install(i *Installer) { if i.LocalMesh == "" { a.Logger.Infoln("Downloading mesh agent...") payload := map[string]string{"arch": arch} - r, err := rClient.R().SetBody(payload).SetOutput(mesh).Post(fmt.Sprintf("%s/api/v2/meshexe/", baseURL)) + r, err := rClient.R().SetBody(payload).SetOutput(mesh).Post(fmt.Sprintf("%s/api/v3/meshexe/", baseURL)) if err != nil { a.installerMsg(fmt.Sprintf("Failed to download mesh agent: %s", err.Error()), "error") } @@ -139,7 +139,7 @@ func (a *WindowsAgent) Install(i *Installer) { Token string `json:"token"` } payload := map[string]string{"agent_id": a.AgentID} - r, err := rClient.R().SetBody(payload).SetResult(&TokenResp{}).Post(fmt.Sprintf("%s/api/v2/newagent/", baseURL)) + r, err := rClient.R().SetBody(payload).SetResult(&TokenResp{}).Post(fmt.Sprintf("%s/api/v3/newagent/", baseURL)) if err != nil { a.installerMsg(err.Error(), "error") } @@ -208,7 +208,7 @@ func (a *WindowsAgent) Install(i *Installer) { "monitoring_type": i.AgentType, } - r, err = rClient.R().SetBody(agentPayload).SetResult(&NewAgentResp{}).Patch(fmt.Sprintf("%s/api/v2/newagent/", baseURL)) + r, err = rClient.R().SetBody(agentPayload).SetResult(&NewAgentResp{}).Patch(fmt.Sprintf("%s/api/v3/newagent/", baseURL)) if err != nil { a.installerMsg(err.Error(), "error") } @@ -307,7 +307,7 @@ func (a *WindowsAgent) Install(i *Installer) { acceptAttempts := 0 acceptRetries := 20 for { - r, err := rClient.R().SetBody(acceptPayload).Post(fmt.Sprintf("%s/api/v2/saltminion/", baseURL)) + r, err := rClient.R().SetBody(acceptPayload).Post(fmt.Sprintf("%s/api/v3/saltminion/", baseURL)) if err != nil { a.Logger.Debugln(err) acceptAttempts++ @@ -338,7 +338,7 @@ func (a *WindowsAgent) Install(i *Installer) { syncAttempts := 0 syncRetries := 20 for { - r, err := rClient.R().SetBody(syncPayload).Patch(fmt.Sprintf("%s/api/v2/saltminion/", baseURL)) + r, err := rClient.R().SetBody(syncPayload).Patch(fmt.Sprintf("%s/api/v3/saltminion/", baseURL)) if err != nil { a.Logger.Debugln(err) syncAttempts++ diff --git a/agent/service_windows.go b/agent/service_windows.go index 32af931..b503e13 100644 --- a/agent/service_windows.go +++ b/agent/service_windows.go @@ -36,7 +36,7 @@ func (a *WindowsAgent) WinAgentSvc() { var data map[string]interface{} var sleep int - url := a.Server + "/api/v2/hello/" + url := a.Server + "/api/v3/hello/" req := &APIRequest{ URL: url, Headers: a.Headers, diff --git a/agent/wmi_windows.go b/agent/wmi_windows.go index d1826da..11d7524 100644 --- a/agent/wmi_windows.go +++ b/agent/wmi_windows.go @@ -1216,7 +1216,7 @@ func (a *WindowsAgent) GetWMI() { wmiInfo["cpu"] = cpu wmiInfo["usb"] = usb - url := a.Server + "/api/v2/sysinfo/" + url := a.Server + "/api/v3/sysinfo/" payload := map[string]interface{}{"agent_id": a.AgentID, "sysinfo": wmiInfo} req := &APIRequest{