diff --git a/gns3server/schemas/compute/cloud_nodes.py b/gns3server/schemas/compute/cloud_nodes.py index 92d8aadd7..6ffe24cc8 100644 --- a/gns3server/schemas/compute/cloud_nodes.py +++ b/gns3server/schemas/compute/cloud_nodes.py @@ -22,7 +22,7 @@ from ..common import NodeStatus -class HostInterfaceType(Enum): +class HostInterfaceType(str, Enum): ethernet = "ethernet" tap = "tap" @@ -38,7 +38,7 @@ class HostInterface(BaseModel): special: bool = Field(..., description="Whether the interface is non standard") -class EthernetType(Enum): +class EthernetType(str, Enum): ethernet = "ethernet" @@ -53,7 +53,7 @@ class EthernetPort(BaseModel): interface: str -class TAPType(Enum): +class TAPType(str, Enum): tap = "tap" @@ -68,7 +68,7 @@ class TAPPort(BaseModel): interface: str -class UDPType(Enum): +class UDPType(str, Enum): udp = "udp" @@ -85,7 +85,7 @@ class UDPPort(BaseModel): rport: int = Field(..., gt=0, le=65535, description="Remote port") -class CloudConsoleType(Enum): +class CloudConsoleType(str, Enum): telnet = "telnet" vnc = "vnc" diff --git a/gns3server/schemas/compute/ethernet_switch_nodes.py b/gns3server/schemas/compute/ethernet_switch_nodes.py index 0edd7f1b1..db0e8cd32 100644 --- a/gns3server/schemas/compute/ethernet_switch_nodes.py +++ b/gns3server/schemas/compute/ethernet_switch_nodes.py @@ -22,14 +22,14 @@ from ..common import NodeStatus -class EthernetSwitchPortType(Enum): +class EthernetSwitchPortType(str, Enum): access = "access" dot1q = "dot1q" qinq = "qinq" -class EthernetSwitchEtherType(Enum): +class EthernetSwitchEtherType(str, Enum): ethertype_8021q = "0x8100" ethertype_qinq = "0x88A8" diff --git a/gns3server/schemas/compute/nat_nodes.py b/gns3server/schemas/compute/nat_nodes.py index 755ac6647..ef91c8dd6 100644 --- a/gns3server/schemas/compute/nat_nodes.py +++ b/gns3server/schemas/compute/nat_nodes.py @@ -22,7 +22,7 @@ from ..common import NodeStatus -class HostInterfaceType(Enum): +class HostInterfaceType(str, Enum): ethernet = "ethernet" tap = "tap" @@ -38,7 +38,7 @@ class HostInterface(BaseModel): special: bool = Field(..., description="Whether the interface is non standard") -class EthernetType(Enum): +class EthernetType(str, Enum): ethernet = "ethernet" @@ -53,7 +53,7 @@ class EthernetPort(BaseModel): interface: str -class TAPType(Enum): +class TAPType(str, Enum): tap = "tap" @@ -68,7 +68,7 @@ class TAPPort(BaseModel): interface: str -class UDPType(Enum): +class UDPType(str, Enum): udp = "udp" diff --git a/gns3server/schemas/compute/nios.py b/gns3server/schemas/compute/nios.py index 75ab4b5b7..686c85327 100644 --- a/gns3server/schemas/compute/nios.py +++ b/gns3server/schemas/compute/nios.py @@ -20,7 +20,7 @@ from enum import Enum -class UDPNIOType(Enum): +class UDPNIOType(str, Enum): udp = "nio_udp" @@ -38,7 +38,7 @@ class UDPNIO(BaseModel): filters: Optional[dict] = Field(None, description="Packet filters") -class EthernetNIOType(Enum): +class EthernetNIOType(str, Enum): ethernet = "nio_ethernet" @@ -52,7 +52,7 @@ class EthernetNIO(BaseModel): ethernet_device: str = Field(..., description="Ethernet device name e.g. eth0") -class TAPNIOType(Enum): +class TAPNIOType(str, Enum): tap = "nio_tap" diff --git a/gns3server/schemas/controller/appliances.py b/gns3server/schemas/controller/appliances.py index c5b35471d..af816d4a9 100644 --- a/gns3server/schemas/controller/appliances.py +++ b/gns3server/schemas/controller/appliances.py @@ -22,7 +22,7 @@ from pydantic import AnyUrl, BaseModel, EmailStr, Field, confloat, conint, constr -class Category(Enum): +class Category(str, Enum): router = 'router' multilayer_switch = 'multilayer_switch' @@ -31,7 +31,7 @@ class Category(Enum): guest = 'guest' -class RegistryVersion(Enum): +class RegistryVersion(int, Enum): version1 = 1 version2 = 2 @@ -41,14 +41,14 @@ class RegistryVersion(Enum): version6 = 6 -class Status(Enum): +class Status(str, Enum): stable = 'stable' experimental = 'experimental' broken = 'broken' -class Availability(Enum): +class Availability(str, Enum): free = 'free' with_registration = 'with-registration' @@ -56,7 +56,7 @@ class Availability(Enum): service_contract = 'service-contract' -class ConsoleType(Enum): +class ConsoleType(str, Enum): telnet = 'telnet' vnc = 'vnc' @@ -101,7 +101,7 @@ class Iou(BaseModel): startup_config: str = Field(..., title='Config loaded at startup') -class Chassis(Enum): +class Chassis(str, Enum): chassis_1720 = '1720' chassis_1721 = '1721' @@ -122,7 +122,7 @@ class Chassis(Enum): chassis_3660 = '3660' -class Platform(Enum): +class Platform(str, Enum): c1700 = 'c1700' c2600 = 'c2600' @@ -133,13 +133,13 @@ class Platform(Enum): c7200 = 'c7200' -class Midplane(Enum): +class Midplane(str, Enum): std = 'std' vxr = 'vxr' -class Npe(Enum): +class Npe(str, Enum): npe_100 = 'npe-100' npe_150 = 'npe-150' @@ -151,7 +151,7 @@ class Npe(Enum): npe_g2 = 'npe-g2' -class AdapterType(Enum): +class AdapterType(str, Enum): e1000 = 'e1000' e1000_82544gc = 'e1000-82544gc' @@ -179,7 +179,7 @@ class AdapterType(Enum): vmxnet3 = 'vmxnet3' -class DiskInterface(Enum): +class DiskInterface(str, Enum): ide = 'ide' sata = 'sata' @@ -193,7 +193,7 @@ class DiskInterface(Enum): none = 'none' -class Arch(Enum): +class Arch(str, Enum): aarch64 = 'aarch64' alpha = 'alpha' @@ -225,7 +225,7 @@ class Arch(Enum): xtensaeb = 'xtensaeb' -class ConsoleType1(Enum): +class ConsoleType1(str, Enum): telnet = 'telnet' vnc = 'vnc' @@ -234,7 +234,7 @@ class ConsoleType1(Enum): none = 'none' -class BootPriority(Enum): +class BootPriority(str, Enum): c = 'c' d = 'd' @@ -247,14 +247,14 @@ class BootPriority(Enum): nd = 'nd' -class Kvm(Enum): +class Kvm(str, Enum): require = 'require' allow = 'allow' disable = 'disable' -class ProcessPriority(Enum): +class ProcessPriority(str, Enum): realtime = 'realtime' very_high = 'very high' @@ -306,7 +306,7 @@ class Qemu(BaseModel): ) -class Compression(Enum): +class Compression(str, Enum): bzip2 = 'bzip2' gzip = 'gzip' @@ -355,7 +355,7 @@ class ApplianceVersion(BaseModel): images: Optional[ApplianceVersionImages] = Field(None, title='Images used for this version') -class DynamipsSlot(Enum): +class DynamipsSlot(str, Enum): C7200_IO_2FE = 'C7200-IO-2FE' C7200_IO_FE = 'C7200-IO-FE' @@ -385,7 +385,7 @@ class DynamipsSlot(Enum): _ = '' -class DynamipsWic(Enum): +class DynamipsWic(str, Enum): WIC_1ENET = 'WIC-1ENET' WIC_1T = 'WIC-1T'