mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 14:31: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
@@ -16,7 +16,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from sqlalchemy import Boolean, Column, String, Integer, Float, ForeignKey, PickleType
|
||||
from sqlalchemy import Boolean, Column, String, Integer, Float, ForeignKey, PickleType, JSON
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from .base import BaseTable, generate_uuid, GUID
|
||||
@@ -36,9 +36,7 @@ class Template(BaseTable):
|
||||
builtin = Column(Boolean, default=False)
|
||||
usage = Column(String)
|
||||
template_type = Column(String)
|
||||
vendor = Column(String)
|
||||
model = Column(String)
|
||||
netmiko_device_type = Column(String)
|
||||
tags = Column(JSON, default='{}')
|
||||
compute_id = Column(String)
|
||||
images = relationship("Image", secondary=image_template_map, back_populates="templates")
|
||||
|
||||
|
||||
Reference in new issue
Block a user