Coverage for ipam/search.py: 100%
87 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 AggregateIndex(SearchIndex):
8 model = models.Aggregate
9 fields = (
10 ('prefix', 120),
11 ('description', 500),
12 ('date_added', 2000),
13 ('comments', 5000),
14 )
15 display_attrs = ('rir', 'tenant', 'description')
18@register_search
19class ASNIndex(SearchIndex):
20 model = models.ASN
21 fields = (
22 ('asn', 100),
23 ('prefixed_name', 110),
24 ('description', 500),
25 ('comments', 5000),
26 )
27 display_attrs = ('rir', 'role', 'tenant', 'description')
30@register_search
31class ASNRangeIndex(SearchIndex):
32 model = models.ASNRange
33 fields = (
34 ('name', 100),
35 ('description', 500),
36 ('comments', 5000),
37 )
38 display_attrs = ('rir', 'tenant', 'description')
41@register_search
42class FHRPGroupIndex(SearchIndex):
43 model = models.FHRPGroup
44 fields = (
45 ('name', 100),
46 ('group_id', 2000),
47 ('description', 500),
48 ('comments', 5000),
49 )
50 display_attrs = ('protocol', 'auth_type', 'description')
53@register_search
54class IPAddressIndex(SearchIndex):
55 model = models.IPAddress
56 fields = (
57 ('address', 100),
58 ('dns_name', 300),
59 ('description', 500),
60 ('comments', 5000),
61 )
62 display_attrs = ('vrf', 'tenant', 'status', 'role', 'description')
65@register_search
66class IPRangeIndex(SearchIndex):
67 model = models.IPRange
68 fields = (
69 ('start_address', 100),
70 ('end_address', 300),
71 ('description', 500),
72 ('comments', 5000),
73 )
74 display_attrs = ('vrf', 'tenant', 'status', 'role', 'description')
77@register_search
78class PrefixIndex(SearchIndex):
79 model = models.Prefix
80 fields = (
81 ('prefix', 110),
82 ('description', 500),
83 ('comments', 5000),
84 )
85 display_attrs = ('scope', 'vrf', 'tenant', 'vlan', 'status', 'role', 'description')
88@register_search
89class RIRIndex(SearchIndex):
90 model = models.RIR
91 fields = (
92 ('name', 100),
93 ('slug', 110),
94 ('description', 500),
95 ('comments', 5000),
96 )
97 display_attrs = ('description',)
100@register_search
101class RoleIndex(SearchIndex):
102 model = models.Role
103 fields = (
104 ('name', 100),
105 ('slug', 110),
106 ('description', 500),
107 ('comments', 5000),
108 )
109 display_attrs = ('description',)
112@register_search
113class RouteTargetIndex(SearchIndex):
114 model = models.RouteTarget
115 fields = (
116 ('name', 100),
117 ('description', 500),
118 ('comments', 5000),
119 )
120 display_attrs = ('tenant', 'description')
123@register_search
124class ServiceIndex(SearchIndex):
125 model = models.Service
126 fields = (
127 ('name', 100),
128 ('description', 500),
129 ('comments', 5000),
130 )
131 display_attrs = ('parent', 'description')
134@register_search
135class ServiceTemplateIndex(SearchIndex):
136 model = models.ServiceTemplate
137 fields = (
138 ('name', 100),
139 ('description', 500),
140 ('comments', 5000),
141 )
142 display_attrs = ('description',)
145@register_search
146class VLANIndex(SearchIndex):
147 model = models.VLAN
148 fields = (
149 ('name', 100),
150 ('vid', 100),
151 ('description', 500),
152 ('comments', 5000),
153 )
154 display_attrs = ('site', 'group', 'tenant', 'status', 'role', 'description')
157@register_search
158class VLANGroupIndex(SearchIndex):
159 model = models.VLANGroup
160 fields = (
161 ('name', 100),
162 ('slug', 110),
163 ('description', 500),
164 ('comments', 5000),
165 )
166 display_attrs = ('scope_type', 'description')
169@register_search
170class VLANTranslationPolicyIndex(SearchIndex):
171 model = models.VLANTranslationPolicy
172 fields = (
173 ('name', 100),
174 ('description', 500),
175 ('comments', 5000),
176 )
177 display_attrs = ('description',)
180@register_search
181class VLANTranslationRuleIndex(SearchIndex):
182 model = models.VLANTranslationRule
183 fields = (
184 ('policy', 100),
185 ('local_vid', 200),
186 ('remote_vid', 200),
187 )
188 display_attrs = ('policy', 'local_vid', 'remote_vid')
191@register_search
192class VRFIndex(SearchIndex):
193 model = models.VRF
194 fields = (
195 ('name', 100),
196 ('rd', 200),
197 ('description', 500),
198 ('comments', 5000),
199 )
200 display_attrs = ('rd', 'tenant', 'description')