# # Copyright (C) 2020 GNS3 Technologies Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . from pydantic import BaseModel, Field from typing import List class NetmikoDeviceType(BaseModel): """ A Netmiko device type supported by the installed Netmiko library. """ name: str = Field(..., description="Device type name to store in the netmiko_device_type field") telnet: bool = Field(False, description="Whether the device type connects over Telnet") custom: bool = Field(False, description="Whether the device type is a GNS3-copilot custom driver (gns3_ prefix)") class NetmikoDeviceTypeList(BaseModel): """ List of Netmiko device types supported by the installed Netmiko library. """ netmiko_version: str = Field(..., description="Version of the installed Netmiko library") device_types: List[NetmikoDeviceType] = Field(..., description="Supported device types, sorted by name")