refactor and testing

This commit is contained in:
redanthrax 2022-06-21 11:17:38 -07:00
parent 91c9de6e34
commit c038774f2c
16 changed files with 445 additions and 195 deletions

View file

@ -0,0 +1,26 @@
package mesh
import (
"github.com/amidaware/rmmagent/agent/tactical/api"
"github.com/amidaware/rmmagent/agent/utils"
)
func SyncMeshNodeID(agentID string) error {
id, err := GetMeshNodeID()
if err != nil {
return err
}
payload := MeshNodeID{
Func: "syncmesh",
Agentid: agentID,
NodeID: utils.StripAll(id),
}
err = api.PostPayload(payload, "/api/v3/syncmesh/")
if err != nil {
return err
}
return nil
}