mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-10-05 18:21:05 +03:00
style: sort imports in schemas
This commit is contained in:
parent
634189d443
commit
3b993b464f
@ -15,102 +15,107 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# General schemas
|
||||
from .config import ServerConfig
|
||||
from .common import ErrorMessage
|
||||
from .version import Version
|
||||
|
||||
# Controller schemas
|
||||
from .controller.links import (
|
||||
LinkCreate,
|
||||
LinkUpdate,
|
||||
Link,
|
||||
UDPPortInfo,
|
||||
EthernetPortInfo,
|
||||
LinkCapture,
|
||||
MarkerCreate,
|
||||
MarkerUpdate,
|
||||
MarkerDefinitionCreate,
|
||||
)
|
||||
from .config import ServerConfig
|
||||
from .controller.appliances import Appliance, ApplianceVersion, ApplianceVersionV8
|
||||
from .controller.computes import (
|
||||
AutoIdlePC,
|
||||
Compute,
|
||||
ComputeCreate,
|
||||
ComputeDockerImage,
|
||||
ComputeUpdate,
|
||||
ComputeVirtualBoxVM,
|
||||
ComputeVMwareVM,
|
||||
ComputeDockerImage,
|
||||
AutoIdlePC,
|
||||
Compute,
|
||||
)
|
||||
from .controller.templates import TemplateCreate, TemplateUpdate, TemplateUsage, Template
|
||||
from .controller.images import Image, ImageType, ImageSyncRequest, ImageSyncJob
|
||||
from .controller.appliances import ApplianceVersion, ApplianceVersionV8, Appliance
|
||||
from .controller.drawings import Drawing
|
||||
from .controller.gns3vm import GNS3VM
|
||||
from .controller.nodes import NodeCreate, NodeUpdate, NodeDuplicate, NodeCapture, Node
|
||||
from .controller.projects import (
|
||||
ProjectCreate,
|
||||
ProjectUpdate,
|
||||
ProjectDuplicate,
|
||||
Project,
|
||||
ProjectFile,
|
||||
ProjectCompression,
|
||||
NodeFile,
|
||||
from .controller.images import Image, ImageSyncJob, ImageSyncRequest, ImageType
|
||||
|
||||
# Controller schemas
|
||||
from .controller.links import (
|
||||
EthernetPortInfo,
|
||||
Link,
|
||||
LinkCapture,
|
||||
LinkCreate,
|
||||
LinkUpdate,
|
||||
MarkerCreate,
|
||||
MarkerDefinitionCreate,
|
||||
MarkerUpdate,
|
||||
UDPPortInfo,
|
||||
)
|
||||
from .controller.nodes import Node, NodeCapture, NodeCreate, NodeDuplicate, NodeUpdate
|
||||
from .controller.projects import (
|
||||
NodeFile,
|
||||
Project,
|
||||
ProjectCompression,
|
||||
ProjectCreate,
|
||||
ProjectDuplicate,
|
||||
ProjectFile,
|
||||
ProjectUpdate,
|
||||
)
|
||||
from .controller.templates import Template, TemplateCreate, TemplateUpdate, TemplateUsage
|
||||
from .controller.users import (
|
||||
UserCreate,
|
||||
UserUpdate,
|
||||
Credentials,
|
||||
LoggedInUserUpdate,
|
||||
User,
|
||||
Credentials,
|
||||
UserCreate,
|
||||
UserGroup,
|
||||
UserGroupCreate,
|
||||
UserGroupUpdate,
|
||||
UserGroup,
|
||||
UserUpdate,
|
||||
)
|
||||
from .version import Version
|
||||
|
||||
# Conditionally import AI-related schemas
|
||||
try:
|
||||
from .controller.llm_model_configs import (
|
||||
LLMModelConfigData,
|
||||
LLMModelConfigCreate,
|
||||
LLMModelConfigUpdate,
|
||||
LLMModelConfigResponse,
|
||||
LLMModelConfigWithSource,
|
||||
LLMModelConfigInheritedResponse,
|
||||
LLMModelConfigListResponse,
|
||||
)
|
||||
from .controller.chat import (
|
||||
OpenAIToolCall,
|
||||
ChatRequest,
|
||||
ChatResponse,
|
||||
OpenAIMessage,
|
||||
ConversationHistory,
|
||||
ChatSession,
|
||||
ConversationHistory,
|
||||
OpenAIMessage,
|
||||
OpenAIToolCall,
|
||||
RenameSession,
|
||||
)
|
||||
from .controller.llm_model_configs import (
|
||||
LLMModelConfigCreate,
|
||||
LLMModelConfigData,
|
||||
LLMModelConfigInheritedResponse,
|
||||
LLMModelConfigListResponse,
|
||||
LLMModelConfigResponse,
|
||||
LLMModelConfigUpdate,
|
||||
LLMModelConfigWithSource,
|
||||
)
|
||||
except ImportError:
|
||||
# AI schemas are not available (should not happen as they don't depend on external libs)
|
||||
pass
|
||||
|
||||
from .controller.rbac import RoleCreate, RoleUpdate, Role, Privilege, ACECreate, ACEUpdate, ACE
|
||||
from .controller.settings import SettingsResponse, SettingsUpdate, SettingsUpdateResponse
|
||||
from .controller.pools import Resource, ResourceCreate, ResourcePoolCreate, ResourcePoolUpdate, ResourcePool
|
||||
from .controller.tokens import Token, ApiKeyCreate, RefreshTokenRequest
|
||||
from .controller.snapshots import SnapshotCreate, Snapshot
|
||||
from .controller.iou_license import IOULicense
|
||||
from .controller.capabilities import Capabilities
|
||||
from .controller.netmiko import NetmikoDeviceType, NetmikoDeviceTypeList
|
||||
from .compute.atm_switch_nodes import ATMSwitch, ATMSwitchCreate, ATMSwitchUpdate
|
||||
from .compute.cloud_nodes import Cloud, CloudCreate, CloudUpdate
|
||||
from .compute.docker_nodes import Docker, DockerCreate, DockerUpdate
|
||||
from .compute.dynamips_nodes import Dynamips, DynamipsCreate, DynamipsUpdate
|
||||
from .compute.ethernet_hub_nodes import EthernetHub, EthernetHubCreate, EthernetHubUpdate
|
||||
from .compute.ethernet_switch_nodes import EthernetSwitch, EthernetSwitchCreate, EthernetSwitchUpdate
|
||||
from .compute.frame_relay_switch_nodes import FrameRelaySwitch, FrameRelaySwitchCreate, FrameRelaySwitchUpdate
|
||||
from .compute.iou_nodes import IOU, IOUCreate, IOUStart, IOUUpdate
|
||||
from .compute.nat_nodes import NAT, NATCreate, NATUpdate
|
||||
|
||||
# Controller template schemas
|
||||
from .controller.templates.vpcs_templates import VPCSTemplate, VPCSTemplateUpdate
|
||||
# Compute schemas
|
||||
from .compute.nios import TAPNIO, UDPNIO, BatchNIOCreate, BatchNIOEntry, EthernetNIO, MarkerRebuild, MarkerToggle
|
||||
from .compute.qemu_nodes import Qemu, QemuCreate, QemuUpdate
|
||||
from .compute.virtualbox_nodes import VirtualBox, VirtualBoxCreate, VirtualBoxUpdate
|
||||
from .compute.vmware_nodes import VMware, VMwareCreate, VMwareUpdate
|
||||
from .compute.vpcs_nodes import VPCS, VPCSCreate, VPCSUpdate
|
||||
from .controller.capabilities import Capabilities
|
||||
from .controller.iou_license import IOULicense
|
||||
from .controller.netmiko import NetmikoDeviceType, NetmikoDeviceTypeList
|
||||
from .controller.pools import Resource, ResourceCreate, ResourcePool, ResourcePoolCreate, ResourcePoolUpdate
|
||||
from .controller.rbac import ACE, ACECreate, ACEUpdate, Privilege, Role, RoleCreate, RoleUpdate
|
||||
from .controller.settings import SettingsResponse, SettingsUpdate, SettingsUpdateResponse
|
||||
from .controller.snapshots import Snapshot, SnapshotCreate
|
||||
from .controller.templates.cloud_templates import CloudTemplate, CloudTemplateUpdate
|
||||
from .controller.templates.iou_templates import IOUTemplate, IOUTemplateUpdate
|
||||
from .controller.templates.docker_templates import DockerTemplate, DockerTemplateUpdate
|
||||
from .controller.templates.ethernet_hub_templates import EthernetHubTemplate, EthernetHubTemplateUpdate
|
||||
from .controller.templates.ethernet_switch_templates import EthernetSwitchTemplate, EthernetSwitchTemplateUpdate
|
||||
from .controller.templates.virtualbox_templates import VirtualBoxTemplate, VirtualBoxTemplateUpdate
|
||||
from .controller.templates.vmware_templates import VMwareTemplate, VMwareTemplateUpdate
|
||||
from .controller.templates.qemu_templates import QemuTemplate, QemuTemplateUpdate
|
||||
from .controller.templates.dynamips_templates import (
|
||||
DynamipsTemplate,
|
||||
C1700DynamipsTemplate,
|
||||
C1700DynamipsTemplateUpdate,
|
||||
C2600DynamipsTemplate,
|
||||
@ -125,23 +130,18 @@ from .controller.templates.dynamips_templates import (
|
||||
C3745DynamipsTemplateUpdate,
|
||||
C7200DynamipsTemplate,
|
||||
C7200DynamipsTemplateUpdate,
|
||||
DynamipsTemplate,
|
||||
)
|
||||
from .controller.templates.ethernet_hub_templates import EthernetHubTemplate, EthernetHubTemplateUpdate
|
||||
from .controller.templates.ethernet_switch_templates import EthernetSwitchTemplate, EthernetSwitchTemplateUpdate
|
||||
from .controller.templates.iou_templates import IOUTemplate, IOUTemplateUpdate
|
||||
from .controller.templates.qemu_templates import QemuTemplate, QemuTemplateUpdate
|
||||
from .controller.templates.virtualbox_templates import VirtualBoxTemplate, VirtualBoxTemplateUpdate
|
||||
from .controller.templates.vmware_templates import VMwareTemplate, VMwareTemplateUpdate
|
||||
|
||||
# Compute schemas
|
||||
from .compute.nios import UDPNIO, TAPNIO, EthernetNIO, MarkerToggle, MarkerRebuild, BatchNIOEntry, BatchNIOCreate
|
||||
from .compute.atm_switch_nodes import ATMSwitchCreate, ATMSwitchUpdate, ATMSwitch
|
||||
from .compute.cloud_nodes import CloudCreate, CloudUpdate, Cloud
|
||||
from .compute.docker_nodes import DockerCreate, DockerUpdate, Docker
|
||||
from .compute.dynamips_nodes import DynamipsCreate, DynamipsUpdate, Dynamips
|
||||
from .compute.ethernet_hub_nodes import EthernetHubCreate, EthernetHubUpdate, EthernetHub
|
||||
from .compute.ethernet_switch_nodes import EthernetSwitchCreate, EthernetSwitchUpdate, EthernetSwitch
|
||||
from .compute.frame_relay_switch_nodes import FrameRelaySwitchCreate, FrameRelaySwitchUpdate, FrameRelaySwitch
|
||||
from .compute.qemu_nodes import QemuCreate, QemuUpdate, Qemu
|
||||
from .compute.iou_nodes import IOUCreate, IOUUpdate, IOUStart, IOU
|
||||
from .compute.nat_nodes import NATCreate, NATUpdate, NAT
|
||||
from .compute.vpcs_nodes import VPCSCreate, VPCSUpdate, VPCS
|
||||
from .compute.vmware_nodes import VMwareCreate, VMwareUpdate, VMware
|
||||
from .compute.virtualbox_nodes import VirtualBoxCreate, VirtualBoxUpdate, VirtualBox
|
||||
# Controller template schemas
|
||||
from .controller.templates.vpcs_templates import VPCSTemplate, VPCSTemplateUpdate
|
||||
from .controller.tokens import ApiKeyCreate, RefreshTokenRequest, Token
|
||||
|
||||
# Schemas for both controller and compute
|
||||
from .qemu_disk_image import QemuDiskImageFormat, QemuDiskImageCreate, QemuDiskImageUpdate
|
||||
from .qemu_disk_image import QemuDiskImageCreate, QemuDiskImageFormat, QemuDiskImageUpdate
|
||||
|
||||
@ -14,9 +14,10 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
from typing import Optional
|
||||
from enum import Enum
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
|
||||
|
||||
class ErrorMessage(BaseModel):
|
||||
|
||||
@ -14,10 +14,11 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from ..common import NodeStatus
|
||||
|
||||
|
||||
|
||||
@ -14,11 +14,12 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional, Union, List
|
||||
from enum import Enum
|
||||
from typing import List, Optional, Union
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from ..common import NodeStatus
|
||||
|
||||
|
||||
|
||||
@ -14,11 +14,12 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
from typing import Optional, List
|
||||
from typing import List, Optional
|
||||
from uuid import UUID
|
||||
|
||||
from ..common import NodeStatus, CustomAdapter, ConsoleType, AuxType, ExtraConfig
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
|
||||
from ..common import AuxType, ConsoleType, CustomAdapter, ExtraConfig, NodeStatus
|
||||
|
||||
|
||||
class DockerBase(BaseModel):
|
||||
|
||||
@ -15,11 +15,12 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional, List
|
||||
from enum import Enum
|
||||
from typing import List, Optional
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from ..common import NodeStatus
|
||||
|
||||
|
||||
|
||||
@ -14,10 +14,11 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional, List
|
||||
from typing import List, Optional
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from ..common import NodeStatus
|
||||
|
||||
|
||||
|
||||
@ -14,10 +14,11 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import BaseModel, Field, model_validator
|
||||
from typing import Optional, List
|
||||
from uuid import UUID
|
||||
from enum import Enum
|
||||
from typing import List, Optional
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel, Field, model_validator
|
||||
|
||||
from ..common import NodeStatus
|
||||
|
||||
|
||||
@ -14,10 +14,11 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from ..common import NodeStatus
|
||||
|
||||
|
||||
|
||||
@ -14,11 +14,12 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional
|
||||
from uuid import UUID
|
||||
|
||||
from ..common import NodeStatus, ConsoleType
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from ..common import ConsoleType, NodeStatus
|
||||
|
||||
|
||||
class IOUBase(BaseModel):
|
||||
|
||||
@ -14,11 +14,12 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional, Union, List
|
||||
from enum import Enum
|
||||
from typing import List, Optional, Union
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from ..common import NodeStatus
|
||||
|
||||
|
||||
|
||||
@ -15,9 +15,10 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional, List
|
||||
from enum import Enum
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class UDPNIOType(str, Enum):
|
||||
|
||||
@ -14,12 +14,13 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional, List
|
||||
from enum import Enum
|
||||
from typing import List, Optional
|
||||
from uuid import UUID
|
||||
|
||||
from ..common import NodeStatus, CustomAdapter
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from ..common import CustomAdapter, NodeStatus
|
||||
|
||||
|
||||
class QemuPlatform(str, Enum):
|
||||
|
||||
@ -14,12 +14,13 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional, List
|
||||
from enum import Enum
|
||||
from typing import List, Optional
|
||||
from uuid import UUID
|
||||
|
||||
from ..common import NodeStatus, CustomAdapter
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from ..common import CustomAdapter, NodeStatus
|
||||
|
||||
|
||||
class VirtualBoxConsoleType(str, Enum):
|
||||
|
||||
@ -14,12 +14,13 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional, List
|
||||
from enum import Enum
|
||||
from typing import List, Optional
|
||||
from uuid import UUID
|
||||
|
||||
from ..common import NodeStatus, CustomAdapter
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from ..common import CustomAdapter, NodeStatus
|
||||
|
||||
|
||||
class VMwareConsoleType(str, Enum):
|
||||
|
||||
@ -14,11 +14,12 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional
|
||||
from enum import Enum
|
||||
from typing import Optional
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from ..common import NodeStatus
|
||||
|
||||
|
||||
|
||||
@ -15,11 +15,11 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import socket
|
||||
|
||||
from enum import Enum
|
||||
from pydantic import ConfigDict, BaseModel, Field, SecretStr, FilePath, DirectoryPath, field_validator, model_validator
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, DirectoryPath, Field, FilePath, SecretStr, field_validator, model_validator
|
||||
|
||||
|
||||
class ControllerSettings(BaseModel):
|
||||
jwt_secret_key: Optional[str] = Field(
|
||||
|
||||
@ -19,9 +19,10 @@
|
||||
from enum import Enum
|
||||
from typing import Annotated, List, Literal, Optional, Union
|
||||
from uuid import UUID
|
||||
from pydantic import AnyUrl, BaseModel, Discriminator, EmailStr, Field, Tag, model_validator
|
||||
from ..common import ExtraConfig
|
||||
|
||||
from pydantic import AnyUrl, BaseModel, Discriminator, EmailStr, Field, Tag, model_validator
|
||||
|
||||
from ..common import ExtraConfig
|
||||
|
||||
# ============================================================================
|
||||
# Shared Enums
|
||||
|
||||
@ -14,8 +14,9 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
|
||||
@ -15,9 +15,10 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import List
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from .nodes import NodeType
|
||||
|
||||
|
||||
|
||||
@ -18,8 +18,9 @@
|
||||
Chat API schemas for GNS3 Copilot integration.
|
||||
"""
|
||||
|
||||
from typing import Any, Dict, List, Literal, Optional
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional, List, Dict, Any, Literal
|
||||
|
||||
|
||||
class OpenAIToolCall(BaseModel):
|
||||
|
||||
@ -15,13 +15,13 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import uuid
|
||||
|
||||
from pydantic import ConfigDict, BaseModel, Field, SecretStr, field_validator, model_validator
|
||||
from typing import List, Optional, Union, Any
|
||||
from enum import Enum
|
||||
from typing import Any, List, Optional, Union
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, SecretStr, field_validator, model_validator
|
||||
|
||||
from .nodes import NodeType
|
||||
from .base import DateTimeModelMixin
|
||||
from .nodes import NodeType
|
||||
|
||||
|
||||
class Protocol(str, Enum):
|
||||
|
||||
@ -14,10 +14,11 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class Drawing(BaseModel):
|
||||
"""
|
||||
|
||||
@ -14,9 +14,10 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional
|
||||
from enum import Enum
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class WhenExit(str, Enum):
|
||||
|
||||
@ -14,11 +14,12 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import ConfigDict, BaseModel, Field
|
||||
from enum import Enum
|
||||
from datetime import datetime
|
||||
from typing import Optional, Literal
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
from .base import DateTimeModelMixin
|
||||
|
||||
|
||||
|
||||
@ -14,9 +14,10 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional, Union
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class Label(BaseModel):
|
||||
"""
|
||||
|
||||
@ -14,11 +14,12 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
from typing import List, Optional, Tuple
|
||||
from enum import Enum
|
||||
from typing import List, Optional, Tuple
|
||||
from uuid import UUID, uuid4
|
||||
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
|
||||
from .labels import Label
|
||||
|
||||
|
||||
|
||||
@ -14,12 +14,12 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from typing import Optional, Literal, Union
|
||||
from pydantic import BaseModel, Field, ConfigDict, field_validator
|
||||
from typing import Literal, Optional, Union
|
||||
from uuid import UUID
|
||||
|
||||
from .base import DateTimeModelMixin
|
||||
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
||||
|
||||
from .base import DateTimeModelMixin
|
||||
|
||||
# Valid model types
|
||||
ModelType = Literal["text", "vision", "stt", "tts", "multimodal", "embedding", "reranking", "other"]
|
||||
|
||||
@ -15,9 +15,10 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import List
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class NetmikoDeviceType(BaseModel):
|
||||
"""
|
||||
|
||||
@ -14,13 +14,14 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import List, Optional, Union
|
||||
from enum import Enum
|
||||
from typing import List, Optional, Union
|
||||
from uuid import UUID, uuid4
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from ..common import ConsoleType, CustomAdapter, NodeStatus
|
||||
from .labels import Label
|
||||
from ..common import ConsoleType, NodeStatus, CustomAdapter
|
||||
|
||||
|
||||
class NodeType(str, Enum):
|
||||
|
||||
@ -14,10 +14,11 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from typing import Optional
|
||||
from pydantic import ConfigDict, BaseModel, Field
|
||||
from uuid import UUID
|
||||
from enum import Enum
|
||||
from typing import Optional
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
from .base import DateTimeModelMixin
|
||||
|
||||
|
||||
@ -15,10 +15,11 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from pydantic import BaseModel, Field, HttpUrl
|
||||
from enum import Enum
|
||||
from typing import List, Optional
|
||||
from uuid import UUID
|
||||
from enum import Enum
|
||||
|
||||
from pydantic import BaseModel, Field, HttpUrl
|
||||
|
||||
|
||||
class ProjectStatus(str, Enum):
|
||||
|
||||
@ -14,10 +14,11 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from typing import Optional, List
|
||||
from pydantic import ConfigDict, BaseModel, Field
|
||||
from uuid import UUID
|
||||
from enum import Enum
|
||||
from typing import List, Optional
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
from .base import DateTimeModelMixin
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ a secret leak at worst.
|
||||
from pathlib import Path
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import ConfigDict, BaseModel, Field
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
from ..config import (
|
||||
BuiltinSymbolTheme,
|
||||
|
||||
@ -15,10 +15,11 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class SnapshotBase(BaseModel):
|
||||
"""
|
||||
|
||||
@ -14,13 +14,14 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import ConfigDict, BaseModel, Field
|
||||
from typing import Optional, List
|
||||
from enum import Enum
|
||||
from typing import List, Optional
|
||||
from uuid import UUID
|
||||
|
||||
from ..nodes import NodeType
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
from ..base import DateTimeModelMixin
|
||||
from ..nodes import NodeType
|
||||
|
||||
|
||||
class Category(str, Enum):
|
||||
|
||||
@ -15,11 +15,13 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from . import Category, TemplateBase
|
||||
from gns3server.schemas.compute.cloud_nodes import EthernetPort, TAPPort, UDPPort, CloudConsoleType
|
||||
from typing import List, Optional, Union
|
||||
|
||||
from pydantic import Field
|
||||
from typing import Optional, Union, List
|
||||
|
||||
from gns3server.schemas.compute.cloud_nodes import CloudConsoleType, EthernetPort, TAPPort, UDPPort
|
||||
|
||||
from . import Category, TemplateBase
|
||||
|
||||
|
||||
class CloudTemplate(TemplateBase):
|
||||
|
||||
@ -15,11 +15,12 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from . import Category, TemplateBase
|
||||
from ...common import ConsoleType, AuxType, CustomAdapter, ExtraConfig
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import Field
|
||||
from typing import Optional, List
|
||||
|
||||
from ...common import AuxType, ConsoleType, CustomAdapter, ExtraConfig
|
||||
from . import Category, TemplateBase
|
||||
|
||||
|
||||
class DockerTemplateBase(TemplateBase):
|
||||
|
||||
@ -14,20 +14,21 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from . import Category, TemplateBase
|
||||
|
||||
from gns3server.schemas.compute.dynamips_nodes import (
|
||||
DynamipsConsoleType,
|
||||
DynamipsPlatform,
|
||||
DynamipsAdapters,
|
||||
DynamipsWics,
|
||||
DynamipsNPE,
|
||||
DynamipsMidplane,
|
||||
)
|
||||
from enum import Enum
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import Field
|
||||
from typing import Optional
|
||||
from enum import Enum
|
||||
|
||||
from gns3server.schemas.compute.dynamips_nodes import (
|
||||
DynamipsAdapters,
|
||||
DynamipsConsoleType,
|
||||
DynamipsMidplane,
|
||||
DynamipsNPE,
|
||||
DynamipsPlatform,
|
||||
DynamipsWics,
|
||||
)
|
||||
|
||||
from . import Category, TemplateBase
|
||||
|
||||
|
||||
class DynamipsTemplateBase(TemplateBase):
|
||||
|
||||
@ -14,12 +14,13 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from . import Category, TemplateBase
|
||||
from gns3server.schemas.compute.ethernet_hub_nodes import EthernetHubPort
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import Field
|
||||
from typing import Optional, List
|
||||
|
||||
from gns3server.schemas.compute.ethernet_hub_nodes import EthernetHubPort
|
||||
|
||||
from . import Category, TemplateBase
|
||||
|
||||
DEFAULT_PORTS = [
|
||||
EthernetHubPort(port_number=0, name="Ethernet0"),
|
||||
|
||||
@ -15,12 +15,14 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from . import Category, TemplateBase
|
||||
from gns3server.schemas.compute.ethernet_switch_nodes import EthernetSwitchPort
|
||||
from enum import Enum
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import Field
|
||||
from typing import Optional, List
|
||||
from enum import Enum
|
||||
|
||||
from gns3server.schemas.compute.ethernet_switch_nodes import EthernetSwitchPort
|
||||
|
||||
from . import Category, TemplateBase
|
||||
|
||||
DEFAULT_PORTS = [
|
||||
EthernetSwitchPort(port_number=0, name="Ethernet0", vlan=1, type="access", ethertype="0x8100"),
|
||||
|
||||
@ -15,11 +15,13 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from . import Category, TemplateBase
|
||||
from gns3server.schemas.compute.iou_nodes import ConsoleType
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import Field
|
||||
from typing import Optional
|
||||
|
||||
from gns3server.schemas.compute.iou_nodes import ConsoleType
|
||||
|
||||
from . import Category, TemplateBase
|
||||
|
||||
|
||||
class IOUTemplateBase(TemplateBase):
|
||||
|
||||
@ -15,20 +15,22 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from . import Category, TemplateBase
|
||||
from gns3server.schemas.compute.qemu_nodes import (
|
||||
QemuConsoleType,
|
||||
QemuPlatform,
|
||||
QemuAdapterType,
|
||||
QemuOnCloseAction,
|
||||
QemuBootPriority,
|
||||
QemuDiskInterfaceType,
|
||||
QemuProcessPriority,
|
||||
CustomAdapter,
|
||||
)
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import Field
|
||||
from typing import Optional, List
|
||||
|
||||
from gns3server.schemas.compute.qemu_nodes import (
|
||||
CustomAdapter,
|
||||
QemuAdapterType,
|
||||
QemuBootPriority,
|
||||
QemuConsoleType,
|
||||
QemuDiskInterfaceType,
|
||||
QemuOnCloseAction,
|
||||
QemuPlatform,
|
||||
QemuProcessPriority,
|
||||
)
|
||||
|
||||
from . import Category, TemplateBase
|
||||
|
||||
|
||||
class QemuTemplate(TemplateBase):
|
||||
|
||||
@ -14,16 +14,18 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from . import Category, TemplateBase
|
||||
from gns3server.schemas.compute.virtualbox_nodes import (
|
||||
VirtualBoxConsoleType,
|
||||
VirtualBoxAdapterType,
|
||||
VirtualBoxOnCloseAction,
|
||||
CustomAdapter,
|
||||
)
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import Field
|
||||
from typing import Optional, List
|
||||
|
||||
from gns3server.schemas.compute.virtualbox_nodes import (
|
||||
CustomAdapter,
|
||||
VirtualBoxAdapterType,
|
||||
VirtualBoxConsoleType,
|
||||
VirtualBoxOnCloseAction,
|
||||
)
|
||||
|
||||
from . import Category, TemplateBase
|
||||
|
||||
|
||||
class VirtualBoxTemplateBase(TemplateBase):
|
||||
|
||||
@ -15,16 +15,18 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from . import Category, TemplateBase
|
||||
from gns3server.schemas.compute.vmware_nodes import (
|
||||
VMwareConsoleType,
|
||||
VMwareAdapterType,
|
||||
VMwareOnCloseAction,
|
||||
CustomAdapter,
|
||||
)
|
||||
from typing import List, Optional
|
||||
|
||||
from pydantic import Field
|
||||
from typing import Optional, List
|
||||
|
||||
from gns3server.schemas.compute.vmware_nodes import (
|
||||
CustomAdapter,
|
||||
VMwareAdapterType,
|
||||
VMwareConsoleType,
|
||||
VMwareOnCloseAction,
|
||||
)
|
||||
|
||||
from . import Category, TemplateBase
|
||||
|
||||
|
||||
class VMwareTemplateBase(TemplateBase):
|
||||
|
||||
@ -15,11 +15,13 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from . import Category, TemplateBase
|
||||
from gns3server.schemas.compute.vpcs_nodes import ConsoleType
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import Field
|
||||
from typing import Optional
|
||||
|
||||
from gns3server.schemas.compute.vpcs_nodes import ConsoleType
|
||||
|
||||
from . import Category, TemplateBase
|
||||
|
||||
|
||||
class VPCSTemplate(TemplateBase):
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
|
||||
@ -19,18 +19,18 @@
|
||||
# This file contains the validation for checking a .gns3 file
|
||||
#
|
||||
|
||||
from enum import Enum
|
||||
from typing import List, Optional
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from .computes import Compute
|
||||
from .drawings import Drawing
|
||||
from .links import Link
|
||||
from .nodes import Node
|
||||
|
||||
from .projects import Supplier, Variable
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional, List
|
||||
from enum import Enum
|
||||
from uuid import UUID
|
||||
|
||||
|
||||
class TopologyType(str, Enum):
|
||||
topology = "topology"
|
||||
|
||||
@ -16,9 +16,10 @@
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
from pydantic import ConfigDict, EmailStr, BaseModel, Field, SecretStr
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, EmailStr, Field, SecretStr
|
||||
|
||||
from .base import DateTimeModelMixin
|
||||
|
||||
|
||||
|
||||
@ -14,9 +14,10 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional
|
||||
from enum import Enum
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class QemuDiskImageFormat(str, Enum):
|
||||
|
||||
@ -14,9 +14,10 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
class Version(BaseModel):
|
||||
controller_host: Optional[str] = Field(None, description="Controller hostname or IP address")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user