Merge branch '3.1' into fix/duplicate-device-configs-merge

This commit is contained in:
Guobin Yue authored and GitHub committed 2026-10-09 21:23:38 +08:00
commit 7df7ce1c96
11 files changed
+359 -37

No files matched your search

+11
View File
@@ -20,6 +20,7 @@ from uuid import UUID, uuid4
from pydantic import BaseModel, ConfigDict, Discriminator, Field, field_validator, model_validator
from ..common import ErrorMessage
from ..update import PartialUpdateModel
from .labels import Label
@@ -216,6 +217,16 @@ class Link(LinkBase):
)
class LinkBatchResult(BaseModel):
"""
Outcome of one link of a batch creation request.
"""
status_code: int = Field(..., description="HTTP status code the same request would have returned on its own")
link: Optional[Link] = Field(None, description="The created link, set when status_code is 201")
error: Optional[ErrorMessage] = Field(None, description="The error, set when the link could not be created")
class UDPPortInfo(BaseModel):
"""
UDP port information.
+15 -1
View File
@@ -20,7 +20,7 @@ from uuid import UUID, uuid4
from pydantic import BaseModel, Field
from ..common import ConsoleType, CustomAdapter, NodeStatus
from ..common import ConsoleType, CustomAdapter, ErrorMessage, NodeStatus
from ..update import PartialUpdateModel
from .labels import Label
@@ -168,6 +168,10 @@ class NodeCreate(NodeBase):
name: str
node_type: NodeType
node_id: UUID = Field(default_factory=uuid4)
strict_names: bool = Field(
False,
description="Return a 409 error instead of renaming the node when the requested name is already used",
)
class NodeUpdate(PartialUpdateModel, NodeBase):
@@ -205,6 +209,16 @@ class Node(NodeBase):
)
class NodeBatchResult(BaseModel):
"""
Outcome of one node of a batch creation request.
"""
status_code: int = Field(..., description="HTTP status code the same request would have returned on its own")
node: Optional[Node] = Field(None, description="The created node, set when status_code is 201")
error: Optional[ErrorMessage] = Field(None, description="The error, set when the node could not be created")
class NodeDuplicate(BaseModel):
"""
Data to duplicate a node.