Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions netbox_routing/search/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from .static import StaticRouteIndex
from .ospf import OSPFInstanceIndex, OSPFAreaIndex
from .eigrp import EIGRPRouterIndex, EIGRPAddressFamilyIndex

__all__ = (
'StaticRouteIndex',

'OSPFInstanceIndex',
'OSPFAreaIndex',

'EIGRPRouterIndex',
'EIGRPAddressFamilyIndex'
)
23 changes: 23 additions & 0 deletions netbox_routing/search/eigrp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from netbox.search import SearchIndex, register_search
from netbox_routing.models.eigrp import EIGRPRouter, EIGRPAddressFamily


@register_search
class EIGRPRouterIndex(SearchIndex):
model = EIGRPRouter
fields = (
('rid', 100),
('pid', 200),
('name', 210),
('comments', 5000),
)
display_attrs = ('device', 'mode')


@register_search
class EIGRPAddressFamilyIndex(SearchIndex):
model = EIGRPAddressFamily
fields = (
('rid', 100),
('comments', 5000),
)
23 changes: 23 additions & 0 deletions netbox_routing/search/ospf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from netbox.search import SearchIndex, register_search
from netbox_routing.models.ospf import OSPFInstance, OSPFArea


@register_search
class OSPFInstanceIndex(SearchIndex):
model = OSPFInstance
fields = (
('name', 100),
('router_id', 200),
('process_id', 300),
('comments', 5000),
)
display_attrs = ('process_id', 'device', 'vrf')


@register_search
class OSPFAreaIndex(SearchIndex):
model = OSPFArea
fields = (
('area_id', 100),
('comments', 5000),
)
14 changes: 14 additions & 0 deletions netbox_routing/search/static.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from netbox.search import SearchIndex, register_search
from netbox_routing.models.static import StaticRoute


@register_search
class StaticRouteIndex(SearchIndex):
model = StaticRoute
fields = (
('name', 100),
('prefix', 200),
('next_hop', 300),
('comments', 5000),
)
display_attrs = ('prefix', 'next_hop', 'vrf')
Loading