diff --git a/api/agent.yaml b/api/agent.yaml index 00d4fd8..95a0339 100644 --- a/api/agent.yaml +++ b/api/agent.yaml @@ -315,7 +315,7 @@ components: SubnetCreateRequest: type: object - required: [name, vpc, vxlan_id, gateway_ip, cidr] + required: [name, vpc, gateway_ip, cidr] properties: name: type: string @@ -325,9 +325,18 @@ components: type: string description: Parent VPC name example: vpc1 + mode: + type: string + description: > + Subnet mode. "vxlan" (default): creates a VXLAN tunnel and a host bridge. + "bridge": attaches directly to an existing bridge resolved from iface_type in the agent config. + "vlan" is reserved for future use. + enum: [vxlan, bridge] + default: vxlan + example: vxlan vxlan_id: type: integer - description: VXLAN VNI identifier + description: VXLAN VNI identifier. Required when mode is "vxlan", ignored otherwise. example: 100 iface_type: type: string @@ -356,12 +365,17 @@ components: vpc: type: string example: vpc1 + mode: + type: string + enum: [vxlan, bridge] + example: vxlan vxlan_id: type: integer + description: VXLAN VNI. Present only when mode is "vxlan". example: 100 local_iface: type: string - description: Resolved interface name + description: Resolved interface name from agent config example: br-000000 gateway_ip: type: string diff --git a/internal/api/agent/models.go b/internal/api/agent/models.go index f13407b..9622ef9 100644 --- a/internal/api/agent/models.go +++ b/internal/api/agent/models.go @@ -12,6 +12,7 @@ type VPC struct { type SubnetCreateRequest struct { Name string `json:"name"` VPC string `json:"vpc"` + Mode string `json:"mode"` VxlanID int `json:"vxlan_id"` IfaceType string `json:"iface_type"` GatewayIP string `json:"gateway_ip"` @@ -22,6 +23,7 @@ type Subnet struct { Name string `json:"name"` State string `json:"state"` VPC string `json:"vpc"` + Mode string `json:"mode"` VxlanID int `json:"vxlan_id"` LocalIface string `json:"local_iface"` GatewayIP string `json:"gateway_ip"`