Skip to content

Commit

Permalink
add network name to common node
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishek9686 committed Dec 12, 2024
1 parent e684547 commit 28bd5b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions controllers/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,8 @@ func getNode(w http.ResponseWriter, r *http.Request) {
logic.ReturnErrorResponse(w, r, logic.FormatError(err, "internal"))
return
}
net, _ := logic.GetNetwork(node.Network)
node.NetworkName = net.Name
server := servercfg.GetServerInfo()
response := models.NodeGet{
Node: node,
Expand Down
2 changes: 1 addition & 1 deletion models/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ type CommonNode struct {
ID uuid.UUID `json:"id" yaml:"id"`
HostID uuid.UUID `json:"hostid" yaml:"hostid"`
Network string `json:"network" yaml:"network"`
NetworkName string `json:"network_name" yaml:"network_name"`
NetworkName string `json:"network_name" yaml:"network_name"`
NetworkRange net.IPNet `json:"networkrange" yaml:"networkrange" swaggertype:"primitive,integer"`
NetworkRange6 net.IPNet `json:"networkrange6" yaml:"networkrange6" swaggertype:"primitive,number"`
Server string `json:"server" yaml:"server"`
Expand Down

0 comments on commit 28bd5b8

Please sign in to comment.