1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

52 lines
983 B
Python
Raw Normal View History

from netbox.search import SearchIndex, register_search
2022-10-21 13:16:16 -04:00
from . import models
2022-10-21 13:16:16 -04:00
@register_search
class ClusterIndex(SearchIndex):
2022-10-21 13:16:16 -04:00
model = models.Cluster
fields = (
('name', 100),
2022-11-15 10:37:35 -05:00
('description', 500),
2022-10-21 13:16:16 -04:00
('comments', 5000),
)
2022-10-21 13:16:16 -04:00
@register_search
class ClusterGroupIndex(SearchIndex):
model = models.ClusterGroup
fields = (
('name', 100),
('slug', 110),
('description', 500),
)
@register_search
class ClusterTypeIndex(SearchIndex):
model = models.ClusterType
fields = (
('name', 100),
('slug', 110),
('description', 500),
)
@register_search
class VirtualMachineIndex(SearchIndex):
2022-10-21 13:16:16 -04:00
model = models.VirtualMachine
fields = (
('name', 100),
2022-11-15 10:37:35 -05:00
('description', 500),
2022-10-21 13:16:16 -04:00
('comments', 5000),
)
@register_search
class VMInterfaceIndex(SearchIndex):
model = models.VMInterface
fields = (
('name', 100),
('description', 500),
)