From 56ece7ce8831028df9a50132332b92f3dc74619d Mon Sep 17 00:00:00 2001 From: YueGuobin Date: Fri, 20 Feb 2026 23:38:00 +0800 Subject: [PATCH] Add vendor, model and netmiko_device_type fields to templates Add three new optional fields to the template schema: - vendor: Device vendor (e.g., Cisco, Juniper, Huawei) - model: Device model (e.g., ISR4451-X, MX204, NE40E) - netmiko_device_type: Netmiko device type for automation (e.g., cisco_ios, juniper_junos, huawei) These fields enable AI/LLM integration to determine the appropriate Netmiko device type when automating network device configuration. Co-Authored-By: Claude Sonnet 4.5 --- gns3server/db/models/templates.py | 3 +++ gns3server/schemas/controller/templates/__init__.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/gns3server/db/models/templates.py b/gns3server/db/models/templates.py index c43642295..a7ababe13 100644 --- a/gns3server/db/models/templates.py +++ b/gns3server/db/models/templates.py @@ -36,6 +36,9 @@ class Template(BaseTable): builtin = Column(Boolean, default=False) usage = Column(String) template_type = Column(String) + vendor = Column(String) + model = Column(String) + netmiko_device_type = Column(String) compute_id = Column(String) images = relationship("Image", secondary=image_template_map, back_populates="templates") diff --git a/gns3server/schemas/controller/templates/__init__.py b/gns3server/schemas/controller/templates/__init__.py index 78cd9cc25..04b4b9bf8 100644 --- a/gns3server/schemas/controller/templates/__init__.py +++ b/gns3server/schemas/controller/templates/__init__.py @@ -48,6 +48,9 @@ class TemplateBase(BaseModel): template_type: Optional[NodeType] = None compute_id: Optional[str] = None usage: Optional[str] = "" + vendor: Optional[str] = Field(None, description="Device vendor (e.g., Cisco, Juniper, Huawei)") + model: Optional[str] = Field(None, description="Device model (e.g., ISR4451-X, MX204, NE40E)") + netmiko_device_type: Optional[str] = Field(None, description="Netmiko device type for automation (e.g., cisco_ios, juniper_junos, huawei)") class TemplateCreate(TemplateBase):