mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-25 13:37:00 +08:00
added network role update to host PUT
This commit is contained in:
parent
8c92308ccf
commit
2e419944c0
1 changed files with 11 additions and 0 deletions
|
|
@ -85,6 +85,17 @@ func updateHost(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
newNetworks := logic.GetHostNetworks(newHost.ID.String())
|
||||
if len(newNetworks) > 0 {
|
||||
if err = mq.ModifyClient(&mq.MqClient{
|
||||
ID: currHost.ID.String(),
|
||||
Text: currHost.Name,
|
||||
Networks: newNetworks,
|
||||
}); err != nil {
|
||||
logger.Log(0, r.Header.Get("user"), "failed to update host networks roles in DynSec:", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
apiHostData := newHost.ConvertNMHostToAPI()
|
||||
logger.Log(2, r.Header.Get("user"), "updated host", newHost.ID.String())
|
||||
w.WriteHeader(http.StatusOK)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue