mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-06 07:11:13 +02:00
Merge branch '3.1' into fix/duplicate-device-configs-merge
This commit is contained in:
34 files changed
+276
-70
No files matched your search
@@ -20,6 +20,7 @@ from uuid import UUID
|
||||
from pydantic import BaseModel
|
||||
|
||||
from ..common import NodeStatus
|
||||
from ..update import PartialUpdateModel
|
||||
|
||||
|
||||
class ATMSwitchBase(BaseModel):
|
||||
@@ -41,11 +42,13 @@ class ATMSwitchCreate(ATMSwitchBase):
|
||||
node_id: Optional[UUID] = None
|
||||
|
||||
|
||||
class ATMSwitchUpdate(ATMSwitchBase):
|
||||
class ATMSwitchUpdate(PartialUpdateModel, ATMSwitchBase):
|
||||
"""
|
||||
Properties to update an ATM switch node.
|
||||
"""
|
||||
|
||||
update_excluded_fields = ("node_id",)
|
||||
|
||||
name: Optional[str] = None
|
||||
node_id: Optional[UUID] = None
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ from uuid import UUID
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from ..common import NodeStatus
|
||||
from ..update import PartialUpdateModel
|
||||
|
||||
|
||||
class HostInterfaceType(str, Enum):
|
||||
@@ -148,12 +149,14 @@ class CloudCreate(CloudBase):
|
||||
name: str
|
||||
|
||||
|
||||
class CloudUpdate(CloudBase):
|
||||
class CloudUpdate(PartialUpdateModel, CloudBase):
|
||||
"""
|
||||
Properties to update a cloud node.
|
||||
"""
|
||||
|
||||
pass
|
||||
update_excluded_fields = ("node_id",)
|
||||
|
||||
name: Optional[str] = None
|
||||
|
||||
|
||||
class Cloud(CloudBase):
|
||||
|
||||
@@ -20,6 +20,7 @@ from uuid import UUID
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
|
||||
from ..common import AuxType, ConsoleType, CustomAdapter, ExtraConfig, NodeStatus
|
||||
from ..update import PartialUpdateModel
|
||||
|
||||
|
||||
class DockerBase(BaseModel):
|
||||
@@ -91,12 +92,15 @@ class DockerCreate(DockerBase):
|
||||
)
|
||||
|
||||
|
||||
class DockerUpdate(DockerBase):
|
||||
class DockerUpdate(PartialUpdateModel, DockerBase):
|
||||
"""
|
||||
Properties to update a Docker node.
|
||||
"""
|
||||
|
||||
pass
|
||||
update_excluded_fields = ("node_id",)
|
||||
|
||||
name: Optional[str] = None
|
||||
image: Optional[str] = Field(None, description="Docker image name")
|
||||
|
||||
|
||||
class Docker(DockerBase):
|
||||
|
||||
@@ -22,6 +22,7 @@ from uuid import UUID
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from ..common import NodeStatus
|
||||
from ..update import PartialUpdateModel
|
||||
|
||||
|
||||
class DynamipsPlatform(str, Enum):
|
||||
@@ -180,11 +181,13 @@ class DynamipsCreate(DynamipsBase):
|
||||
ram: int = Field(..., gt=0, description="Amount of RAM in MB")
|
||||
|
||||
|
||||
class DynamipsUpdate(DynamipsBase):
|
||||
class DynamipsUpdate(PartialUpdateModel, DynamipsBase):
|
||||
"""
|
||||
Properties to update a Dynamips node.
|
||||
"""
|
||||
|
||||
update_excluded_fields = ("node_id", "dynamips_id")
|
||||
|
||||
platform: Optional[DynamipsPlatform] = Field(None, description="Cisco router platform")
|
||||
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ from uuid import UUID
|
||||
from pydantic import BaseModel
|
||||
|
||||
from ..common import NodeStatus
|
||||
from ..update import PartialUpdateModel
|
||||
|
||||
|
||||
class EthernetHubPort(BaseModel):
|
||||
@@ -46,12 +47,12 @@ class EthernetHubCreate(EthernetHubBase):
|
||||
name: str
|
||||
|
||||
|
||||
class EthernetHubUpdate(EthernetHubBase):
|
||||
class EthernetHubUpdate(PartialUpdateModel, EthernetHubBase):
|
||||
"""
|
||||
Properties to update an Ethernet hub node.
|
||||
"""
|
||||
|
||||
pass
|
||||
update_excluded_fields = ("node_id",)
|
||||
|
||||
|
||||
class EthernetHub(EthernetHubBase):
|
||||
|
||||
@@ -21,6 +21,7 @@ from uuid import UUID
|
||||
from pydantic import BaseModel, Field, model_validator
|
||||
|
||||
from ..common import NodeStatus
|
||||
from ..update import PartialUpdateModel
|
||||
|
||||
|
||||
class EthernetSwitchPortType(str, Enum):
|
||||
@@ -83,12 +84,12 @@ class EthernetSwitchCreate(EthernetSwitchBase):
|
||||
name: str
|
||||
|
||||
|
||||
class EthernetSwitchUpdate(EthernetSwitchBase):
|
||||
class EthernetSwitchUpdate(PartialUpdateModel, EthernetSwitchBase):
|
||||
"""
|
||||
Properties to update an Ethernet hub node.
|
||||
"""
|
||||
|
||||
pass
|
||||
update_excluded_fields = ("node_id",)
|
||||
|
||||
|
||||
class EthernetSwitch(EthernetSwitchBase):
|
||||
|
||||
@@ -20,6 +20,7 @@ from uuid import UUID
|
||||
from pydantic import BaseModel
|
||||
|
||||
from ..common import NodeStatus
|
||||
from ..update import PartialUpdateModel
|
||||
|
||||
|
||||
class FrameRelaySwitchBase(BaseModel):
|
||||
@@ -41,11 +42,13 @@ class FrameRelaySwitchCreate(FrameRelaySwitchBase):
|
||||
node_id: Optional[UUID] = None
|
||||
|
||||
|
||||
class FrameRelaySwitchUpdate(FrameRelaySwitchBase):
|
||||
class FrameRelaySwitchUpdate(PartialUpdateModel, FrameRelaySwitchBase):
|
||||
"""
|
||||
Properties to update an Frame Relay node.
|
||||
"""
|
||||
|
||||
update_excluded_fields = ("node_id",)
|
||||
|
||||
name: Optional[str] = None
|
||||
node_id: Optional[UUID] = None
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ from uuid import UUID
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from ..common import ConsoleType, NodeStatus
|
||||
from ..update import PartialUpdateModel
|
||||
|
||||
|
||||
class IOUBase(BaseModel):
|
||||
@@ -58,12 +59,16 @@ class IOUCreate(IOUBase):
|
||||
application_id: int = Field(..., description="Application ID for running IOU executable")
|
||||
|
||||
|
||||
class IOUUpdate(IOUBase):
|
||||
class IOUUpdate(PartialUpdateModel, IOUBase):
|
||||
"""
|
||||
Properties to update an IOU node.
|
||||
"""
|
||||
|
||||
pass
|
||||
update_excluded_fields = ("node_id", "application_id")
|
||||
|
||||
name: Optional[str] = None
|
||||
path: Optional[str] = Field(None, description="IOU executable path")
|
||||
application_id: Optional[int] = Field(None, description="Application ID for running IOU executable")
|
||||
|
||||
|
||||
class IOU(IOUBase):
|
||||
|
||||
@@ -21,6 +21,7 @@ from uuid import UUID
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from ..common import NodeStatus
|
||||
from ..update import PartialUpdateModel
|
||||
|
||||
|
||||
class HostInterfaceType(str, Enum):
|
||||
@@ -106,12 +107,14 @@ class NATCreate(NATBase):
|
||||
name: str
|
||||
|
||||
|
||||
class NATUpdate(NATBase):
|
||||
class NATUpdate(PartialUpdateModel, NATBase):
|
||||
"""
|
||||
Properties to update a NAT node.
|
||||
"""
|
||||
|
||||
pass
|
||||
update_excluded_fields = ("node_id",)
|
||||
|
||||
name: Optional[str] = None
|
||||
|
||||
|
||||
class NAT(NATBase):
|
||||
|
||||
@@ -21,6 +21,7 @@ from uuid import UUID
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from ..common import CustomAdapter, NodeStatus
|
||||
from ..update import PartialUpdateModel
|
||||
|
||||
|
||||
class QemuPlatform(str, Enum):
|
||||
@@ -227,12 +228,14 @@ class QemuCreate(QemuBase):
|
||||
)
|
||||
|
||||
|
||||
class QemuUpdate(QemuBase):
|
||||
class QemuUpdate(PartialUpdateModel, QemuBase):
|
||||
"""
|
||||
Properties to update a Qemu node.
|
||||
"""
|
||||
|
||||
pass
|
||||
update_excluded_fields = ("node_id",)
|
||||
|
||||
name: Optional[str] = None
|
||||
|
||||
|
||||
class Qemu(QemuBase):
|
||||
|
||||
@@ -21,6 +21,7 @@ from uuid import UUID
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from ..common import CustomAdapter, NodeStatus
|
||||
from ..update import PartialUpdateModel
|
||||
|
||||
|
||||
class VirtualBoxConsoleType(str, Enum):
|
||||
@@ -83,12 +84,15 @@ class VirtualBoxCreate(VirtualBoxBase):
|
||||
vmname: str = Field(..., description="VirtualBox VM name (in VirtualBox itself)")
|
||||
|
||||
|
||||
class VirtualBoxUpdate(VirtualBoxBase):
|
||||
class VirtualBoxUpdate(PartialUpdateModel, VirtualBoxBase):
|
||||
"""
|
||||
Properties to update a VirtualBox node.
|
||||
"""
|
||||
|
||||
pass
|
||||
update_excluded_fields = ("node_id",)
|
||||
|
||||
name: Optional[str] = None
|
||||
vmname: Optional[str] = None
|
||||
|
||||
|
||||
class VirtualBox(VirtualBoxBase):
|
||||
|
||||
@@ -21,6 +21,7 @@ from uuid import UUID
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from ..common import CustomAdapter, NodeStatus
|
||||
from ..update import PartialUpdateModel
|
||||
|
||||
|
||||
class VMwareConsoleType(str, Enum):
|
||||
@@ -89,12 +90,16 @@ class VMwareCreate(VMwareBase):
|
||||
linked_clone: bool = Field(..., description="Whether the VM is a linked clone or not")
|
||||
|
||||
|
||||
class VMwareUpdate(VMwareBase):
|
||||
class VMwareUpdate(PartialUpdateModel, VMwareBase):
|
||||
"""
|
||||
Properties to update a VMware node.
|
||||
"""
|
||||
|
||||
pass
|
||||
update_excluded_fields = ("node_id",)
|
||||
|
||||
name: Optional[str] = None
|
||||
vmx_path: Optional[str] = None
|
||||
linked_clone: Optional[bool] = None
|
||||
|
||||
|
||||
class VMware(VMwareBase):
|
||||
|
||||
@@ -21,6 +21,7 @@ from uuid import UUID
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from ..common import NodeStatus
|
||||
from ..update import PartialUpdateModel
|
||||
|
||||
|
||||
class ConsoleType(str, Enum):
|
||||
@@ -54,12 +55,14 @@ class VPCSCreate(VPCSBase):
|
||||
name: str
|
||||
|
||||
|
||||
class VPCSUpdate(VPCSBase):
|
||||
class VPCSUpdate(PartialUpdateModel, VPCSBase):
|
||||
"""
|
||||
Properties to update a VPCS node.
|
||||
"""
|
||||
|
||||
pass
|
||||
update_excluded_fields = ("node_id",)
|
||||
|
||||
name: Optional[str] = None
|
||||
|
||||
|
||||
class VPCS(VPCSBase):
|
||||
|
||||
Reference in new issue
Block a user