mirror of
				https://github.com/gravitl/netmaker.git
				synced 2025-10-31 12:16:29 +08:00 
			
		
		
		
	added network role update to host PUT
This commit is contained in:
		| @@ -85,6 +85,17 @@ func updateHost(w http.ResponseWriter, r *http.Request) { | |||||||
| 		return | 		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() | 	apiHostData := newHost.ConvertNMHostToAPI() | ||||||
| 	logger.Log(2, r.Header.Get("user"), "updated host", newHost.ID.String()) | 	logger.Log(2, r.Header.Get("user"), "updated host", newHost.ID.String()) | ||||||
| 	w.WriteHeader(http.StatusOK) | 	w.WriteHeader(http.StatusOK) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 0xdcarns
					0xdcarns