refactor and testing
This commit is contained in:
parent
91c9de6e34
commit
c038774f2c
16 changed files with 445 additions and 195 deletions
26
agent/tactical/mesh/mesh.go
Normal file
26
agent/tactical/mesh/mesh.go
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue