mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-05 14:51:13 +02:00
feat(api): add tag filtering to nodes and templates endpoints
- Add optional `tags` query parameter to `/nodes` and `/templates` endpoints - Support filtering by tags in format "key:value" with multiple tags ANDed together - Example: `?tags=vendor:cisco&tags=model:7200` filters nodes/templates with both tags - Maintain backward compatibility for existing API usage without tags parameter
This commit is contained in:
1 parent
56ece7ce88
commit
a3616e6d33
6 files changed
+93
-16
No files matched your search
@@ -15,7 +15,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from pydantic import BaseModel, Field, model_validator
|
||||
from typing import List, Optional, Union, Any
|
||||
from typing import List, Optional, Union, Any, Dict
|
||||
from enum import Enum
|
||||
from uuid import UUID, uuid4
|
||||
|
||||
@@ -133,6 +133,10 @@ class NodeBase(BaseModel):
|
||||
port_segment_size: Optional[int] = Field(None, description="Size of the port segment")
|
||||
first_port_name: Optional[str] = Field(None, description="Name of the first port")
|
||||
custom_adapters: Optional[List[CustomAdapter]] = None
|
||||
tags: Optional[Dict[str, str]] = Field(
|
||||
default_factory=dict,
|
||||
description="User-defined metadata tags inherited from template or custom"
|
||||
)
|
||||
|
||||
|
||||
class NodeCreate(NodeBase):
|
||||
|
||||
Reference in new issue
Block a user