f-28: api: implement new model usage

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-05-18 20:15:16 +02:00
commit 9a16cf011a
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
3 changed files with 18 additions and 1 deletions

View file

@ -47,6 +47,8 @@ func (s *Server) getSubnet(w http.ResponseWriter, _ *http.Request, name string)
sub.State = value
case "vpc":
sub.VPC = value
case "mode":
sub.Mode = value
case "vxlan_id":
sub.VxlanID, _ = strconv.Atoi(value)
case "local_iface":

View file

@ -44,6 +44,8 @@ func (s *Server) listSubnets(w http.ResponseWriter, _ *http.Request) {
subnets[name].State = value
case "vpc":
subnets[name].VPC = value
case "mode":
subnets[name].Mode = value
case "vxlan_id":
subnets[name].VxlanID, _ = strconv.Atoi(value)
case "local_iface":
@ -77,6 +79,7 @@ func (s *Server) postSubnet(w http.ResponseWriter, r *http.Request) {
cmd := dispatcher.CreateSubnetCommand{
Name: req.Name,
VPC: req.VPC,
Mode: req.Mode,
VxlanID: req.VxlanID,
IfaceType: req.IfaceType,
GatewayIP: req.GatewayIP,
@ -109,6 +112,8 @@ func (s *Server) postSubnet(w http.ResponseWriter, r *http.Request) {
sub.State = value
case "vpc":
sub.VPC = value
case "mode":
sub.Mode = value
case "vxlan_id":
sub.VxlanID, _ = strconv.Atoi(value)
case "local_iface":