Coverage for vpn/search.py: 100%
42 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-10 18:35 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-10 18:35 +0000
1from netbox.search import SearchIndex, register_search
3from . import models
6@register_search
7class TunnelIndex(SearchIndex):
8 model = models.Tunnel
9 fields = (
10 ('name', 100),
11 ('tunnel_id', 300),
12 ('description', 500),
13 ('comments', 5000),
14 )
15 display_attrs = ('group', 'status', 'encapsulation', 'tenant', 'tunnel_id', 'description')
18@register_search
19class TunnelGroupIndex(SearchIndex):
20 model = models.TunnelGroup
21 fields = (
22 ('name', 100),
23 ('slug', 110),
24 ('description', 500),
25 ('comments', 5000),
26 )
27 display_attrs = ('description',)
30@register_search
31class IKEProposalIndex(SearchIndex):
32 model = models.IKEProposal
33 fields = (
34 ('name', 100),
35 ('description', 500),
36 ('comments', 5000),
37 )
38 display_attrs = ('description',)
41@register_search
42class IKEPolicyIndex(SearchIndex):
43 model = models.IKEPolicy
44 fields = (
45 ('name', 100),
46 ('description', 500),
47 ('comments', 5000),
48 )
49 display_attrs = ('description',)
52@register_search
53class IPSecProposalIndex(SearchIndex):
54 model = models.IPSecProposal
55 fields = (
56 ('name', 100),
57 ('description', 500),
58 ('comments', 5000),
59 )
60 display_attrs = ('description',)
63@register_search
64class IPSecPolicyIndex(SearchIndex):
65 model = models.IPSecPolicy
66 fields = (
67 ('name', 100),
68 ('description', 500),
69 ('comments', 5000),
70 )
71 display_attrs = ('description',)
74@register_search
75class IPSecProfileIndex(SearchIndex):
76 model = models.IPSecProfile
77 fields = (
78 ('name', 100),
79 ('description', 500),
80 ('comments', 5000),
81 )
82 display_attrs = ('description',)
85@register_search
86class L2VPNIndex(SearchIndex):
87 model = models.L2VPN
88 fields = (
89 ('name', 100),
90 ('slug', 110),
91 ('identifier', 200),
92 ('description', 500),
93 ('comments', 5000),
94 )
95 display_attrs = ('type', 'status', 'identifier', 'tenant', 'description')