f-28: fix: renomage api param

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-05-18 21:58:33 +02:00
commit 848f965883
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
13 changed files with 53 additions and 53 deletions

View file

@ -50,8 +50,8 @@ func (s *Server) listSubnets(w http.ResponseWriter, _ *http.Request) {
subnets[name].VxlanID, _ = strconv.Atoi(value)
case "local_iface":
subnets[name].LocalIface = value
case "gateway_ip":
subnets[name].GatewayIP = value
case "interface_ip":
subnets[name].InterfaceIP = value
case "cidr":
subnets[name].CIDR = value
}
@ -71,9 +71,9 @@ func (s *Server) postSubnet(w http.ResponseWriter, r *http.Request) {
json.NewEncoder(w).Encode(ErrorResponse{Error: "invalid request body"})
return
}
if req.Name == "" || req.VPC == "" || req.GatewayIP == "" || req.CIDR == "" {
if req.Name == "" || req.VPC == "" || req.InterfaceIP == "" || req.CIDR == "" {
w.WriteHeader(http.StatusBadRequest)
json.NewEncoder(w).Encode(ErrorResponse{Error: "name, vpc, gateway_ip and cidr are required"})
json.NewEncoder(w).Encode(ErrorResponse{Error: "name, vpc, interface_ip and cidr are required"})
return
}
cmd := dispatcher.CreateSubnetCommand{
@ -82,7 +82,7 @@ func (s *Server) postSubnet(w http.ResponseWriter, r *http.Request) {
Mode: req.Mode,
VxlanID: req.VxlanID,
IfaceType: req.IfaceType,
GatewayIP: req.GatewayIP,
InterfaceIP: req.InterfaceIP,
CIDR: req.CIDR,
}
if err := s.dispatcher.Prepare(cmd); err != nil {
@ -118,8 +118,8 @@ func (s *Server) postSubnet(w http.ResponseWriter, r *http.Request) {
sub.VxlanID, _ = strconv.Atoi(value)
case "local_iface":
sub.LocalIface = value
case "gateway_ip":
sub.GatewayIP = value
case "interface_ip":
sub.InterfaceIP = value
case "cidr":
sub.CIDR = value
}