Compare commits

...

1240 Commits

Author SHA1 Message Date
jeremystretch
f11a6f0135 Release v3.3-beta2 2022-08-03 14:41:50 -04:00
Jeremy Stretch
44850feaf8 Merge pull request #9904 from netbox-community/9888-site_device_filters
Fixes: #9888 - Add filter and columns for device and site
2022-08-03 13:31:58 -04:00
jeremystretch
367bf25618 Fixes #9778: Fix exception during cable deletion after deleting a connected termination 2022-08-03 12:46:16 -04:00
jeremystretch
b9678c7c0e Closes #9853: Show full object in cable A/B termination lists 2022-08-03 10:50:35 -04:00
Daniel Sheppard
37c4f1a7d3 Fix up a few minor mistakes. Add tests. 2022-08-02 13:38:17 -05:00
jeremystretch
d3a567a2f5 Fixes #9788: Ensure denormalized fields on CableTermination are kept in sync with related objects 2022-08-02 13:56:52 -04:00
Daniel Sheppard
5b3ef04550 #9888 - Add filter and columns for device and site 2022-08-02 12:56:10 -05:00
jeremystretch
e96620260a Closes #9903: Implement a mechanism for automatically updating denormalized fields 2022-08-02 13:49:34 -04:00
jeremystretch
29a611c729 Closes #9896: Discontinue arbitrary use of OrderedDict 2022-08-01 16:51:44 -04:00
jeremystretch
562769fb89 Merge branch 'develop' into feature 2022-08-01 14:42:09 -04:00
Jeremy Stretch
4591237bfd Merge pull request #9886 from hagbarddenstore/issue_9699
Remove deprecated usage of prefetch_related
2022-08-01 13:46:38 -04:00
jeremystretch
262a0cf397 Fixes #9789: Fix rendering of cable traces ending at provider networks 2022-08-01 13:29:39 -04:00
jeremystretch
ff3fcb8134 #9871: Tweak display of utilization graph value 2022-08-01 12:38:12 -04:00
jeremystretch
d4d73674fc Fixes #9871: Fix utilization graph value alignments 2022-08-01 11:54:39 -04:00
jeremystretch
984d15d7fb Closes #9893: Move YAML serialization logic for component templates under the individual models 2022-08-01 11:39:07 -04:00
jeremystretch
efa449faff Closes #9882: Add manufacturer column to modules table 2022-08-01 10:36:53 -04:00
jeremystretch
3af989763e Closes #9883: Linkify location column in power panels table 2022-08-01 10:32:05 -04:00
jeremystretch
9646f88384 Fixes #9885: Fix child prefix counts when editing/deleting aggregates in bulk 2022-08-01 10:28:21 -04:00
jeremystretch
1bbf5d214b Closes #9881: Increase granularity in utilization graph values 2022-08-01 10:23:18 -04:00
jeremystretch
8a075bcff9 Fixes #9884: Prevent querying assigned VRF on prefix object init 2022-08-01 09:47:18 -04:00
jeremystretch
9fe5f09742 Fixes #9891: Ensure consistent ordering for tags during object serialization 2022-08-01 09:32:52 -04:00
jeremystretch
84f2225f42 PEP8 cleanup 2022-08-01 09:16:58 -04:00
jeremystretch
728ad51624 Changelog & cleanup for #9637 2022-08-01 09:12:15 -04:00
atownson
5ab03b7e92 Closes #9637: Add existing fields to the Rack Reservation user interface pages (#9870)
* Closes netbox-community#9637

Added site_group to RackReservationFrom class fieldsets
Added location to RackReservationTable class
2022-08-01 09:01:18 -04:00
Kim Johansson
6904666e2a Remove deprecated usage of prefetch_related
Fixes #9699
2022-07-30 01:18:30 +02:00
Daniel Sheppard
890efa5400 Fixes #9062 - Add/edit {module} substitution to help text for component template name 2022-07-29 11:55:26 -05:00
jeremystretch
04fb0bd51c Closes #9858: ChangeLoggedModelFilterSet cleanup 2022-07-28 15:41:10 -04:00
jeremystretch
2c43c8d077 Closes #9793: Add PoE attributes to interface templates 2022-07-28 15:20:25 -04:00
jeremystretch
c5fb7b72f0 Closes #9391: Remove 500-character limit for custom link text & URL fields 2022-07-28 14:36:20 -04:00
jeremystretch
07620db027 Changelog for #9762 2022-07-28 12:45:27 -04:00
Jeremy Stretch
f8a3ffae4e Merge pull request #9868 from atownson/issue_9762
Closes #9762: Add nat_outside to the IPAddress table
2022-07-28 12:43:13 -04:00
atownson
62d1510c55 Closes netbox-community#9762
Added nat_outside to IPAddressTable class
2022-07-28 10:23:04 -05:00
jeremystretch
498b655cb7 Changelog and cleanup for #9825 2022-07-27 16:50:31 -04:00
Jeremy Stretch
fa94d9c82c Merge pull request #9826 from viroge/develop
Closes #9825: Add Contacts to VM table view
2022-07-27 16:48:08 -04:00
jeremystretch
6cee12b153 Fix formatting of webhook conditions form field 2022-07-27 15:40:25 -04:00
jeremystretch
a6be8dccf5 Fixes #9847: Respect desc_units when ordering rack units 2022-07-26 15:45:47 -04:00
jeremystretch
466931d2fb Fixes #9829: Arrange custom fields by group when editing objects 2022-07-26 12:41:51 -04:00
jeremystretch
d442f8fd60 Fixes #9843: Fix rendering of custom field values (regression from #9647) 2022-07-26 11:09:51 -04:00
jeremystretch
7631722f97 Merge branch 'temp' into feature 2022-07-26 08:36:50 -04:00
Daniel Sheppard
6d30c07dd0 Update changelog for #9844 2022-07-26 07:29:18 -05:00
Daniel Sheppard
6f7289f932 Fixes #9844 - Add dedicated device_vlan form field 2022-07-26 07:22:21 -05:00
jeremystretch
2583abc39d Fix null cable termination representation 2022-07-25 11:34:16 -04:00
jeremystretch
12476036cd Changelog for #9794, #9818 2022-07-25 09:55:20 -04:00
Jeremy Stretch
91070f823a Merge pull request #9819 from jaylik/jaylik-9818
Fixes #9818: Typo fix in CableForm
2022-07-25 09:52:42 -04:00
Jeremy Stretch
8df4966a2b Merge pull request #9796 from mzbroch/mzb-9102,4
Fixes 9794: Typo fix in REARPORT_BUTTONS template code
2022-07-25 09:50:27 -04:00
Gabor SOMOGYVARI
451a0067c7 Closes #9825: Add Contacts to VM table view 2022-07-22 10:42:20 +02:00
Juho Ylikorpi
e2580ea469 fixes #9818 2022-07-21 16:54:23 +03:00
jeremystretch
abf11fbcb8 Merge branch 'develop' into feature 2022-07-20 12:20:33 -04:00
jeremystretch
383918d83b PRVB 2022-07-20 11:15:02 -04:00
Jeremy Stretch
f8cbd322ba Merge pull request #9801 from netbox-community/develop
Release v3.2.7
2022-07-20 11:13:00 -04:00
jeremystretch
9835d6b2df Release NetBox v3.2.7 2022-07-20 10:57:11 -04:00
jeremystretch
17e00ac040 Fixes #9705: Support filter expressions for the serial field on racks, devices, and inventory items 2022-07-20 10:39:36 -04:00
Marek Zbroch
e92b7f8bb9 Typo fix in REARPORT_BUTTONS template code 2022-07-20 13:02:10 +02:00
jeremystretch
1c9db2d9f8 Fixes #9499: Fix filtered bulk deletion of VM Interfaces 2022-07-19 16:21:32 -04:00
jeremystretch
44586743ea Fixes #9437: Standardize form submission buttons and behavior when using enter key 2022-07-19 14:21:20 -04:00
jeremystretch
802d9d2b6e Fixes #9749: Retain original slug values when modifying object names 2022-07-19 13:01:51 -04:00
jeremystretch
a7a20ad2ea Fixes #9775: Fix exception when viewing a report with no descripton 2022-07-19 13:01:21 -04:00
Jeremy Stretch
124ff23e3d Merge pull request #9750 from smuth4/fix/broken-image-urls
Fixes #9634: Respect image URLs which are already fully formed
2022-07-19 12:46:32 -04:00
Jeremy Stretch
abfa6a325a Merge pull request #9748 from mzbroch/mzb-9102
Fixes #9768: Typo fix in CableEditView
2022-07-19 10:05:14 -04:00
jeremystretch
0e18292e41 Add summary release notes for v3.3 2022-07-18 13:09:45 -04:00
jeremystretch
6d53788ea2 Changelog for #9765 2022-07-18 13:05:12 -04:00
Jeremy Stretch
fae9874dde Merge pull request #9766 from kkthxbye-code/fix-9765
Fixes #9765 - Fix "Total segment" count on trace view
2022-07-18 13:04:01 -04:00
jeremystretch
b8da66bb55 Fixes #9733: Handle split paths during trace when fanning out to front ports with differing cables 2022-07-18 11:51:59 -04:00
kkthxbye-code
8a2276e791 Use segment_count for segment count on trace view 2022-07-18 16:17:16 +02:00
Jeremy Stretch
4bdef80554 Merge pull request #9752 from mzbroch/mzb-9102#2
Fixes #9730 - Fix CableForm Validation for #9102
2022-07-18 10:03:48 -04:00
jeremystretch
1a028f77d4 Changelog for #9754 2022-07-18 09:16:43 -04:00
Jeremy Stretch
7603468abc Merge pull request #9757 from kkthxbye-code/fix-9754-2
Fixes #9754 -Revert #9735 & #9696
2022-07-18 08:40:45 -04:00
kkthxbye-code
b854cefb57 Revert #9735 & #9696 2022-07-17 17:33:47 +02:00
Marek Zbroch
58b191b439 Fix CableForm Validation for #9102 2022-07-17 09:28:58 +02:00
Stephen Muth
3d475e5afa Fixes #9634: Respect image URLs which are already fully formed
For local storage, URLs will always be relative, but some custom storage backends
such as S3 may return absolute ones.
2022-07-16 11:46:25 -04:00
Marek Zbroch
f385a5fd5e Typo fix in CableEditView 2022-07-16 09:42:01 +02:00
jeremystretch
250265c3d9 Fixes #9746: Permit filtering interfaces by arbitrary speed value in UI 2022-07-15 15:40:55 -04:00
jeremystretch
e07dd3ddcb Define NESTED_SERIALIZER_PREFIX constant 2022-07-15 15:31:42 -04:00
jeremystretch
68f53aaa87 Closes #9745: Add wireless LANs and links to global search 2022-07-15 15:28:00 -04:00
Jeremy Stretch
5fda5cc08c Merge pull request #9742 from henryriveraCS/develop
Corrected typo for description of 'snapshots'
2022-07-15 14:53:15 -04:00
jeremystretch
68b87dd668 Fixes #9729: Fix ordering of content type creation to ensure compatability with demo data 2022-07-15 13:27:20 -04:00
Henry
6da171a699 Corrected typo for description of 'snapshots' 2022-07-15 10:52:37 -04:00
jeremystretch
024e7d8651 Fixes #9728: Fix validation when assigning a virtual machine to a device 2022-07-15 10:19:56 -04:00
jeremystretch
e8dd952aa5 Fix migration progress output 2022-07-15 10:07:35 -04:00
jeremystretch
fe2fae5b86 Closes #9741: Check for UserConfig instance during user login 2022-07-15 09:42:12 -04:00
jeremystretch
5b5160ca6f Fixes #9715: Fix SOCIAL_AUTH_PIPELINE config parameter not taking effect 2022-07-15 08:34:30 -04:00
Jeremy Stretch
b9dd654e7a Merge pull request #9735 from kkthxbye-code/fix-9734
Fixes #9734 & #9713 - Only set focus on select field search boxes if the select is open
2022-07-15 08:14:46 -04:00
kkthxbye-code
b0df24e6d1 UI: Only set focus on select field search boxes if the select is open 2022-07-15 08:51:05 +02:00
jeremystretch
868e94fb73 Release v3.3-beta1 2022-07-14 12:04:53 -04:00
jeremystretch
15395a56e7 Move L2VPN into new menu group 2022-07-14 11:02:00 -04:00
jeremystretch
29c81a788f Clean up connection tables 2022-07-14 10:37:27 -04:00
jeremystretch
0615252e15 Add progress output to cable migration 2022-07-14 10:33:20 -04:00
jeremystretch
be00d1f3c6 Fix erroneous import 2022-07-14 08:36:16 -04:00
jeremystretch
3eb6b6c07f Clean up core API imports 2022-07-13 16:18:55 -04:00
jeremystretch
0b86326435 #9102: Enable creating terminations in conjunction with cables via REST API 2022-07-13 15:35:37 -04:00
jeremystretch
fb2bfe2337 Introduce GenericObjectSerializer 2022-07-13 15:12:53 -04:00
jeremystretch
43a4a9c86d Complete release notes 2022-07-12 16:29:43 -04:00
jeremystretch
43b27cc052 Misc cleanup 2022-07-12 16:29:26 -04:00
jeremystretch
53372a7471 #8157: General cleanup & fix tests 2022-07-11 21:51:39 -04:00
jeremystretch
1ddb219a0c Documentation cleanup 2022-07-11 17:29:25 -04:00
jeremystretch
2264937f81 Consolidate custom field migrations 2022-07-11 17:11:58 -04:00
jeremystretch
8a8ada8529 #9177: Use TenancyColumnsMixin (from #9686) 2022-07-11 16:14:46 -04:00
jeremystretch
123e758c6d Closes #9708: Render user API tokens in a table 2022-07-11 15:43:59 -04:00
jeremystretch
531d961d30 Add API tokens to user menu 2022-07-11 14:47:15 -04:00
jeremystretch
c380fd00bf Merge branch 'develop' into feature 2022-07-11 12:58:24 -04:00
jeremystretch
57397570c0 Drop extraneous/invalid prefetches 2022-07-11 12:45:53 -04:00
jeremystretch
e106d7ac3a PRVB 2022-07-11 12:11:50 -04:00
Jeremy Stretch
b72793a85a Merge pull request #9706 from netbox-community/develop
Release v3.2.6
2022-07-11 12:09:21 -04:00
jeremystretch
68f24755aa Release v3.2.6 2022-07-11 11:41:28 -04:00
jeremystretch
5a4467a4a8 Fixes #9687: Don't restrict custom text field lengths when entering via UI form 2022-07-11 11:12:06 -04:00
jeremystretch
7c109ffd8c Fixes #9697: Fix device role link under device view 2022-07-11 11:02:18 -04:00
jeremystretch
6415661b61 Remove extraneous argument to GenericRelation 2022-07-11 10:33:14 -04:00
jeremystretch
ed7f42a803 Fixes #9704: Include last_updated field on JournalEntry REST API serializer 2022-07-11 10:28:37 -04:00
jeremystretch
e2af716a81 #9686: Add default accessor to TenantGroupColumn 2022-07-11 10:03:45 -04:00
jeremystretch
d3f91ce0a6 Changelog for #9632, #9686 2022-07-11 09:57:12 -04:00
Jeremy Stretch
dde005366a Merge pull request #9700 from PieterL75/issue9656_journalviewlayout
Fixes: #9656 Re-order journal list and form
2022-07-11 09:54:48 -04:00
Jeremy Stretch
85cab8d9b0 Merge pull request #9696 from kkthxbye-code/fix-9632
Fixes #9632 - Focus on select field after populating data
2022-07-11 09:51:45 -04:00
Jeremy Stretch
a49d3d2ddc Merge pull request #9695 from hagbarddenstore/issue_9686
Add Tenant Group column to tables #9686
2022-07-11 09:50:42 -04:00
kkthxbye-code
93c30c94b3 Focus on select field after populating data 2022-07-10 19:16:16 +02:00
Kim Johansson
1539769c08 Prefetch Tenant Group on user configurable tables
Prefetch the Tenant Group in views which allows its table to be configured
by the user. This decreases the amount of database queries that are required
to fetch the data.
2022-07-10 17:17:56 +02:00
Kim Johansson
c7ece43a18 Remove Tenant Group from child tables
Removes the Tenant Group column from tables which aren't configurable
by the user.
2022-07-10 17:16:12 +02:00
Kim Johansson
69a22ffe5e Prefetch Tenant Group in global search
Configure the prefetch to also include the Tenant Group, avoids additional
database queries when the Tenant Group column is to be rendered.

NOTE: If no personalisation of the global search tables should be done,
this commit can be reverted.
2022-07-10 15:38:21 +02:00
Kim Johansson
e6bfde1397 Replace TenantColumn with new TenancyColumnsMixin
Replaces all usages of the TenantColumn with the new TenancyColumnsMixin.

This enables the user to add a column for Tenant Group on all tables which
also has a column for Tenant.
2022-07-10 15:13:48 +02:00
Kim Johansson
bd60d46b82 Table mixin for Tenancy columns
A mixin to add the Tenant and Tenant Group columns to a table.
2022-07-10 15:08:55 +02:00
Kim Johansson
3c2a55a521 Add TenantGroupColumn to display Tenant Group on tables
Works the same as the existing TenantColumn, but displats the Tenant Group of
the Tenant.

Views should prefetch the Tenants Group for this to be efficient in large
tables.
2022-07-10 11:58:45 +02:00
jeremystretch
29eb37857c Merge branch 'develop' into feature 2022-07-08 16:06:27 -04:00
Jeremy Stretch
6c9f2734a2 Merge pull request #9615 from netbox-community/9102-cabling
Closes #9102: Add support for multi-termination cable ends
2022-07-08 14:59:38 -04:00
jeremystretch
a40ab9ffb1 Fixes #9657: Fix filtering for custom fields and webhooks in the UI 2022-07-08 14:59:16 -04:00
jeremystretch
55b3e4eeb3 Fixes #9682: Fix bulk assignment of ASNs to sites 2022-07-08 14:16:42 -04:00
jeremystretch
f386ec82ae Fix CablePath serialization for pass-through port paths 2022-07-08 13:55:13 -04:00
jeremystretch
ac4a87de13 Improve display of related objects in cables list 2022-07-08 13:33:43 -04:00
jeremystretch
42e5282283 Improve filtering cables by termination device/rack/site 2022-07-08 11:44:28 -04:00
jeremystretch
11707cb3b1 Fix trace() loop 2022-07-07 19:08:20 -04:00
jeremystretch
d444aa1110 Fix support for tracing across bridge relationships 2022-07-07 14:35:02 -04:00
jeremystretch
a858e041e4 Cache properties which return related objects 2022-07-07 14:23:05 -04:00
jeremystretch
13ef5dc0b3 Extend Interface.link_peers() to support WirelessLinks 2022-07-07 13:57:39 -04:00
jeremystretch
9a7f3f8c1a Cleanup for #9102 2022-07-07 12:48:44 -04:00
jeremystretch
1beb8522b9 #9102: Document API changes 2022-07-06 16:02:53 -04:00
jeremystretch
af14bfdd84 Rename LinkTermination to CabledObjectModel 2022-07-06 15:56:10 -04:00
jeremystretch
ba079b9ee5 Merge branch 'feature' into 9102-cabling 2022-07-06 14:09:25 -04:00
jeremystretch
78a3dfc5d9 Changelog for #8157 2022-07-06 13:38:25 -04:00
jeremystretch
4d3278cb52 #8157: Clean up L2VPN assignment for VM interfaces 2022-07-06 13:31:31 -04:00
Jeremy Stretch
5fd3eb82cd Merge pull request #9631 from netbox-community/8157-l2vpn
Closes: #8157 - Add L2VPN support
2022-07-06 13:14:21 -04:00
jeremystretch
1e1ce550c0 Update L2VPN migration 2022-07-06 12:53:10 -04:00
jeremystretch
4bb4bbce14 Clean up validation 2022-07-06 12:49:00 -04:00
jeremystretch
29a46d2c18 Add support for VM interface termination via bulk import 2022-07-06 12:48:28 -04:00
Daniel Sheppard
878c465c56 Update Termination table rendering on L2VPN View 2022-07-06 09:10:10 -05:00
Daniel Sheppard
f1c8926252 Fix error 2022-07-06 09:01:08 -05:00
Daniel Sheppard
5bcc3a3fb9 Update docs 2022-07-06 09:00:33 -05:00
Daniel Sheppard
30350e3b40 More fixes as a result of code review 2022-07-06 08:57:15 -05:00
Daniel Sheppard
0004b834fb Commit fixes Jeremy suggested
Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
2022-07-06 08:17:50 -05:00
Daniel Sheppard
dbb1773e15 Remove extraneous imports
Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
2022-07-06 08:04:33 -05:00
Daniel Sheppard
8e39e7f830 Change API urls to plural form
Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
2022-07-06 08:03:07 -05:00
Daniel Sheppard
aa856e75e8 Change Virtual Circuits to L2VPN
Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
2022-07-06 08:02:44 -05:00
Daniel Sheppard
b1729f2127 Change Virtual Circuits to L2VPN
Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
2022-07-06 08:02:29 -05:00
Pieter Lambrecht
13f854c91f Re-order journal list and form 2022-07-06 14:10:10 +02:00
jeremystretch
277c2ff869 Closes #8171: Populate next available address when cloning an IP 2022-07-01 16:36:24 -04:00
jeremystretch
23f391c5b5 Closes #9228: Add serialize_object() method to ChangeLoggingMixin 2022-07-01 15:52:16 -04:00
jeremystretch
a5124ab9c8 Closes #8511: Enable custom fields and tags for circuit terminations 2022-07-01 15:10:31 -04:00
jeremystretch
a57398b0d6 Closes #9647: Introduce customfield_value template tag 2022-07-01 14:45:22 -04:00
jeremystretch
c11af40a06 prepare_cloned_fields() should always return a QueryDict 2022-07-01 13:52:37 -04:00
jeremystretch
12c138b341 Closes #9074: Enable referencing the current user when evaluating permission constraints 2022-07-01 13:34:10 -04:00
jeremystretch
c6dfdf10e5 Introduce qs_filter_from_constraints() for constructing object permission QS filters 2022-07-01 11:49:36 -04:00
jeremystretch
ad5fd01ea4 Merge branch 'develop' into feature 2022-07-01 11:37:18 -04:00
jeremystretch
29f629156a Update NOTICE file 2022-07-01 11:36:34 -04:00
jeremystretch
be778353b7 #1099: Restore PoE fields on interface edit form 2022-06-30 17:13:26 -04:00
jeremystretch
3a6f46bf38 Closes #9075: Introduce AbortRequest exception for cleanly interrupting object mutations 2022-06-30 15:15:07 -04:00
jeremystretch
65f4895dd6 Add ActionsMixin to __all__ 2022-06-30 14:35:41 -04:00
Daniel Sheppard
5b397a9827 Add docs 2022-06-30 08:29:08 -05:00
Daniel Sheppard
dd6bfed565 Add migration file 2022-06-29 18:37:31 -05:00
Daniel Sheppard
6e983d1542 Fix up some PEP errors 2022-06-29 16:14:30 -05:00
Daniel Sheppard
3be9f6c4f3 #8157 - Final work on L2VPN model 2022-06-29 16:01:20 -05:00
jeremystretch
779969f150 Closes #9070: Hide navigation menu items based on user permissions 2022-06-29 16:36:10 -04:00
Jeremy Stretch
2245f1bf41 Merge pull request #9630 from netbox-community/9092-ObjectChildrenView
Closes #9092: Introduce support for use of ObjectChildrenView by plugins
2022-06-29 14:49:17 -04:00
jeremystretch
a0f9b5e47b Document support for ObjectChildrenView 2022-06-29 14:30:47 -04:00
jeremystretch
4649bc632c Update templates for subclasses of ObjectChildrenView 2022-06-29 14:21:57 -04:00
jeremystretch
cdcb77dea8 Move actions determination to a mixin 2022-06-29 14:21:30 -04:00
jeremystretch
c5770392e3 Refactor ObjectChildrenView 2022-06-28 18:14:57 -04:00
jeremystretch
cd3111ca8d Merge branch 'develop' into feature 2022-06-28 16:55:49 -04:00
jeremystretch
8e200a9cb4 #9403: Add labels to device VC fields 2022-06-28 16:24:56 -04:00
jeremystretch
ccb7e96d8a Changelog for #8854, #9403, #9540 2022-06-28 16:22:38 -04:00
Jeremy Stretch
f75ddeb721 Merge pull request #9622 from cpund/9403-branch
Closes #9403: Add support for setting a virtual chassis on a device in the GUI
2022-06-28 16:21:22 -04:00
Jeremy Stretch
221ddc6d0f Merge pull request #9600 from huntabyte/issue-8854
Fixes #8854: Remote auth default groups added to new remote auth users
2022-06-28 15:29:23 -04:00
Jeremy Stretch
31c752bf3a Merge pull request #9607 from huntabyte/feature-9540
Closes #9540: Filter IP addresses by assigned Device/VM
2022-06-28 15:08:37 -04:00
Daniel Sheppard
03f1584d3a L2VPN Clean Tree 2022-06-27 23:24:50 -05:00
jeremystretch
03d6e25dea Remove obsolete validation logic 2022-06-27 16:49:04 -04:00
jeremystretch
8bbc592261 Add SVG rendering to cable path tests 2022-06-27 15:53:34 -04:00
jeremystretch
9d35a9d912 Fix bug with path padding 2022-06-27 15:34:54 -04:00
jeremystretch
7622d90c1d Extend cable tracing to support terminations to different parent objects 2022-06-27 15:22:09 -04:00
jeremystretch
fcd1daaf79 Update power utilization calculations for new cabling model 2022-06-27 14:34:08 -04:00
jeremystretch
25ed3390cb Merge branch 'feature' into 9102-cabling 2022-06-27 12:12:34 -04:00
jeremystretch
7dd5f9e720 Closes #9177: Add tenant assignment for wireless LANs & links 2022-06-27 11:30:52 -04:00
Hunter Johnston
2077378ae1 Closes #9540: Filter IP addresses by assigned Device/VM 2022-06-25 15:41:31 -04:00
Jeremy Stretch
f6c52e0616 Merge pull request #9606 from netbox-community/4434-rack-device-highlights
Closes #4434: Enable highlighting devices within rack elevations
2022-06-24 11:44:11 -04:00
jeremystretch
fc02e15fb1 Closes #4434: Enable highlighting devices within rack elevations 2022-06-24 11:04:38 -04:00
Hunter Johnston
9b91c2a886 syntax: Removed dev imports 2022-06-23 23:29:14 -04:00
Hunter Johnston
d8b40056b5 Fixes #8854: Remote auth default groups added to new remote auth users 2022-06-23 20:54:26 -04:00
jeremystretch
4315c4697c Ignore default field values which reference ConfigItems when calculating migrations 2022-06-23 17:44:19 -04:00
jeremystretch
b77013c859 Docs & cleanup for #7702 2022-06-23 17:26:20 -04:00
Jeremy Stretch
f7de2611c1 Merge pull request #9576 from huntabyte/feature-7702
Closes #7702: Add Power feed defaults to user configurations
2022-06-23 17:00:06 -04:00
jeremystretch
f9d81fd362 Closes #9414: Add clone() method to NetBoxModel for copying instance attributes 2022-06-23 15:21:10 -04:00
Hunter Johnston
c330282919 Fix syntax error 2022-06-23 14:56:24 -04:00
Hunter Johnston
db807ab4a6 Closes #7702: Add power feed defaults to user configurations 2022-06-23 14:16:09 -04:00
jeremystretch
d55e3c352a Changelog for #9396, #9575, #9597 2022-06-23 14:14:02 -04:00
Hunter Johnston
afec53cea3 Fixes #9575: Add exception handling to services (#9586) 2022-06-23 14:11:59 -04:00
Hunter Johnston
6cb8b9110e Closes #9396: Query modules by module bay & display installed_modules for module_bay REST API endpoint (#9574)
* Closes #9396 - Added ability to query modules by module bay & installed_modules for module bay REST API endpoint

* Closes #9396 - Added ability to query modules by module bay & installed_modules for module bay REST API endpoint

* Closes #9396 - Added ability to query modules by module bay & installed_modules for module bay REST API endpoint
2022-06-23 13:28:36 -04:00
Jeremy Stretch
12bd3840f9 Merge pull request #9595 from netbox-community/9536-token-last-used
Closes #9536: Record last used time for API tokens
2022-06-23 12:28:30 -04:00
jeremystretch
dc05e62ce0 Documentation & clenaup for #9536 2022-06-23 12:15:02 -04:00
Jeremy Stretch
4f33685ca7 Merge pull request #9554 from PieterL75/issue_9536
Closes #9536: Last Used field on API tokens
2022-06-23 11:53:58 -04:00
Jeremy Stretch
cfb9605e9b Merge branch 'feature' into issue_9536 2022-06-23 10:35:27 -04:00
Jeremy Stretch
f563ba7a9e Merge pull request #9590 from netbox-community/8233-api-token-ip
Closes #8233: Restrict API tokens by source IP
2022-06-23 08:29:45 -04:00
jeremystretch
7e4b34560f Update token model docs 2022-06-23 08:12:36 -04:00
jeremystretch
d4db656940 Allowed IPs should be optional on Token 2022-06-23 08:09:39 -04:00
jeremystretch
3c15419bd0 Introduce IPNetworkSerializer to serialize allowed token IPs 2022-06-22 21:51:43 -04:00
jeremystretch
e3b7bba84f Add token authentication tests 2022-06-22 21:10:18 -04:00
jeremystretch
a38a880e67 Refactor source IP resolution logic 2022-06-22 17:01:07 -04:00
Jeremy Stretch
7043c6faf9 Merge pull request #9175 from PieterL75/issue_8233
Closes #8233: Restrict API key access by source IP
2022-06-22 16:23:59 -04:00
jeremystretch
379880cd84 Closes #9582: Enable assigning config contexts based on device location 2022-06-22 16:10:48 -04:00
jeremystretch
341615668b Closes #7120: Add termination_date field to Circuit 2022-06-22 15:09:50 -04:00
jeremystretch
e4aa933d57 Closes #7744: Add status field to Location 2022-06-22 13:33:19 -04:00
jeremystretch
4587b83d85 Closes #1099: Add PoE mode & type for interfaces 2022-06-21 21:22:24 -04:00
jeremystretch
9c214622a1 Closes #4350: Illustrate reservations vertically alongside rack elevations 2022-06-21 16:30:27 -04:00
Hunter Johnston
52178f78d1 Closes #7702: Add Powerfeed Defaults to User Configurations 2022-06-21 12:58:41 -04:00
jeremystretch
440dfabefe Merge branch 'feature' into 9102-cabling 2022-06-20 15:04:55 -04:00
jeremystretch
64080e808e Refactor dcim.svg module 2022-06-20 14:30:25 -04:00
Jeremy Stretch
7decad1ff3 Merge pull request #9571 from netbox-community/51-half-height-rack-units
Closes #51: Half height rack units
2022-06-20 14:13:44 -04:00
jeremystretch
103729c085 Add test for 0.5U devices 2022-06-20 13:57:37 -04:00
jeremystretch
4ced0bed13 Clean up rack model tests 2022-06-20 12:37:56 -04:00
jeremystretch
0d6d68c62f Fix YAML representation of decimal values 2022-06-20 12:07:59 -04:00
jeremystretch
278891c262 Fix rack utilization calculation 2022-06-20 12:07:59 -04:00
jeremystretch
ae12948558 Refactor device rendering methods 2022-06-20 12:07:59 -04:00
jeremystretch
0c915f7de9 Clean up rack elevation rendering 2022-06-20 12:06:34 -04:00
jeremystretch
84f0561712 Initial work on half-height RUs 2022-06-20 12:05:06 -04:00
jeremystretch
ba12db3019 Merge branch 'develop' into feature 2022-06-20 11:50:23 -04:00
jeremystretch
575e2c443b PRVB 2022-06-20 11:38:49 -04:00
Jeremy Stretch
7c09259b7d Merge pull request #9569 from netbox-community/develop
Release v3.2.5
2022-06-20 11:35:48 -04:00
jeremystretch
7ba268946a Release v3.2.5 2022-06-20 11:22:36 -04:00
jeremystretch
8074ca95bd Closes #9453: Disable default loggers when running tests 2022-06-20 11:17:15 -04:00
jeremystretch
d691ea92d0 #9525: Add button colors 2022-06-20 09:44:59 -04:00
jeremystretch
903a3e1a9c Changelog for #8944, #9108, #9556 2022-06-20 08:34:05 -04:00
Jeremy Stretch
4109113319 Merge pull request #9558 from kkthxbye-code/fix-9556
Fixes #9556 - Don't close select field when multiple select (v2)
2022-06-20 08:25:49 -04:00
Jeremy Stretch
872c11502f Merge pull request #9522 from kkthxbye-code/fix-9108
Fixes #9108 & #8944 - Sanitize HTML after rendering markdown
2022-06-20 08:16:43 -04:00
jeremystretch
10cb4f359a Changelog for #9417, #9517, #9525 2022-06-20 08:06:49 -04:00
Jeremy Stretch
45babf162e Merge pull request #9562 from huntabyte/feature-9525
Closes: #9525 - Add split button functionality to table rows
2022-06-20 08:03:20 -04:00
Jeremy Stretch
3434428357 Merge pull request #9563 from huntabyte/feature-9417
Closes #9417: Pre-populate manufacturer when adding modules to devices
2022-06-20 07:49:10 -04:00
Jeremy Stretch
25128bd06f Merge pull request #9564 from huntabyte/feature-9517
Closes #9517: Linkify Power Port on Power Outlet Object View
2022-06-20 07:45:30 -04:00
Hunter Johnston
e7620b0dd0 Closes #9517: Linkify Power Port on Power Outlet Object View 2022-06-19 22:10:01 -04:00
Hunter Johnston
65683d0df1 Closes #9417: Pre-populate manufacturer when adding modules to devices 2022-06-19 20:00:15 -04:00
Hunter Johnston
ff2ccfd670 Closes #9525: Added split button functionality to ActionsColumn 2022-06-19 19:12:52 -04:00
Pieter Lambrecht
81cea9b9d9 Show LastUsed in /user/api-tokens/ 2022-06-19 13:03:03 +02:00
Pieter Lambrecht
ae342a0506 Correct delay time from 6 to 60 seconds 2022-06-19 12:41:44 +02:00
Pieter Lambrecht
f8221340af Disable token last_used update when in Maint mode 2022-06-19 12:40:52 +02:00
Hunter Johnston
b1ec703ba9 Implemented feature #9525 2022-06-18 23:08:06 -04:00
Hunter Johnston
3d785d836d Implemented feature #9525 2022-06-18 23:05:18 -04:00
kkthxbye-code
7c79c90cd2 Sanitize HTML after rendering markdown 2022-06-17 23:16:57 +02:00
kkthxbye-code
a6e285316a Don't close select field when multiple select 2022-06-17 22:53:51 +02:00
jeremystretch
e6018cd38f Closes #9534: Add VLAN group selector to interface bulk edit forms 2022-06-17 14:51:45 -04:00
jeremystretch
92a6523bf3 Fixes #9549: Fix device counts for rack list under rack role view 2022-06-17 14:40:37 -04:00
jeremystretch
2815eca260 Fixes #9503: Hyperlinks in ack elevation SVGs must always use absolute URLs 2022-06-17 14:36:55 -04:00
jeremystretch
896ebf01b1 Changelog for #8704, #9533, #9374, #9466, #9537 2022-06-17 14:04:57 -04:00
Jeremy Stretch
a71b2e231b Merge pull request #9309 from CroogQT/multiselect
Multiselect
2022-06-17 14:00:54 -04:00
Jeremy Stretch
56f3aaf7c8 Merge pull request #9473 from kkthxbye-code/fix-9466
Fixes #9466 - Clear webhook queue on script failure
2022-06-17 13:58:26 -04:00
Jeremy Stretch
87a9cc0b9e Merge pull request #9527 from kkthxbye-code/fix-9374
Partially fixes #9374 - Implement a custom paginator for DeviceViewSet to improve config_context load times
2022-06-17 13:44:37 -04:00
Jeremy Stretch
972a1fdd14 Merge pull request #9543 from hagbarddenstore/fix-9537
Replace None in templates with placeholder filter
2022-06-17 13:16:46 -04:00
Jeremy Stretch
723954f0d9 Merge pull request #9547 from kkthxbye-code/fix-9533
Fixes #9533 - Move markdown documentation to docs
2022-06-17 13:14:44 -04:00
PieterL75
536239d272 Merge branch 'feature' into issue_8233 2022-06-17 16:31:13 +02:00
Pieter Lambrecht
d32bbd06cf Fix last_used=None error 2022-06-17 15:52:12 +02:00
Pieter Lambrecht
5d868168a5 Rename timediff to lasted_used_diff 2022-06-17 14:58:20 +02:00
Pieter Lambrecht
5d4575ed25 Only update every 60 seconds 2022-06-17 14:57:19 +02:00
Pieter Lambrecht
c04b4bbbfa Add last_used to Token model and update when used 2022-06-17 14:45:56 +02:00
kkthxbye-code
cf76d5c46a Move markdown documentation to docs 2022-06-16 22:26:37 +02:00
Kim Johansson
e8b970608e Replace None in templates with placeholder filter
To be consistent, all uses of &mdash; or None is replaced with the
placeholder filter.

Fixes #9537
2022-06-15 22:33:21 +02:00
Jeremy Stretch
83fdfaa0eb Fixes #9524: Correct order of VLAN fields under VM interface creation form 2022-06-13 19:14:29 -04:00
Jeremy Stretch
86c35a403a Changelog for #9501, #9512 2022-06-13 19:05:16 -04:00
Jeremy Stretch
e96c382138 Merge pull request #9520 from kkthxbye-code/fix-9501
Fixes #9501 - Add configuration option JINJA2_FILTERS
2022-06-13 18:55:25 -04:00
Craig Pund
6876c9878e added field definitions for device form 2022-06-13 17:06:08 -04:00
Craig Pund
29a5fb041f add fields for virtual chassis to device_edit form 2022-06-13 17:04:25 -04:00
kkthxbye-code
8ef74192ec Implement a custom paginator for DeviceViewSet
Running count on the annotated query for loading config_context is slow. The custom paginator removes the annotation before getting the count.
2022-06-13 20:45:08 +02:00
Jeremy Stretch
135ce93d03 Merge pull request #9523 from kkthxbye-code/fix-9512
Fixes #9512 -  Add distinct to Site search to prevent duplicates when search matches ASN
2022-06-13 12:12:34 -04:00
kkthxbye
f13b090b5c Add distinct to Site search to prevent duplicates when search matches ASN 2022-06-13 07:56:31 +02:00
kkthxbye-code
d1aa820856 Add configuration option JINJA2_FILTERS 2022-06-10 23:13:49 +02:00
jeremystretch
9b51c2a0b2 Fix typo 2022-06-09 12:45:48 -04:00
jeremystretch
87b3be26a0 Closes #9434: Enabled django-rich test runner for more user-friendly output 2022-06-09 11:48:32 -04:00
jeremystretch
a74dba865c Merge branch 'develop' into feature 2022-06-09 11:38:21 -04:00
jeremystretch
c81c3d11ed Fixes #9495: Correct link to contacts in contact groups table column 2022-06-09 10:20:44 -04:00
jeremystretch
180adb42a3 Use polylines to draw cable fanouts 2022-06-08 16:29:26 -04:00
jeremystretch
8d92ec2007 Add support for cable fan-outs 2022-06-07 16:43:22 -04:00
jeremystretch
ecba9699ed Introduce Node class for SVG boxes 2022-06-07 14:56:46 -04:00
jeremystretch
36c65b7b22 Closes #8893: Include count of IP ranges under tenant view 2022-06-07 11:12:40 -04:00
jeremystretch
8a4c808be5 Closes #8882: Support filtering IP addresses by multiple parent prefixes 2022-06-07 11:00:14 -04:00
jeremystretch
6ed2dbf172 Fixes #9486: Fix redirect URL when adding device components from the module view 2022-06-07 10:06:19 -04:00
jeremystretch
1b8350fe48 Add warning against bumping stale issues 2022-06-07 09:59:59 -04:00
jeremystretch
15080aad66 Changelog for #9480, #9484 2022-06-07 08:51:53 -04:00
Jeremy Stretch
7a7f7c5dec Merge pull request #9483 from kkthxbye-code/fix-9480
Fixes #9480 - Make the Service and ServiceTemplate tables sortable by ports
2022-06-07 08:46:13 -04:00
Jeremy Stretch
c958208c47 Merge pull request #9485 from kkthxbye-code/fix-9484
Fixes #9484 - List services listening on all IPs in IPAddressView
2022-06-07 08:43:14 -04:00
kkthxbye-code
9f4e565b8e List services listening on all IPs in IPAddressView 2022-06-06 16:28:33 +02:00
kkthxbye-code
bb2d21abdd Make the Service and ServiceTemplate tables sortable by ports 2022-06-05 10:31:21 +02:00
jeremystretch
0b0a646f87 Clean up cable termination changes 2022-06-03 14:15:28 -04:00
kkthxbye
e2eb7fdfb5 Clear webhook queue on script failure 2022-06-03 13:03:58 +02:00
jeremystretch
537383e071 Add cable topology tests 2022-06-02 12:40:31 -04:00
jeremystretch
bab6fb0de2 Update SVG trace rendering to support multiple terminations per cable end 2022-06-02 11:07:26 -04:00
jeremystretch
cf7a091319 Refactor SVG module 2022-06-02 08:28:27 -04:00
jeremystretch
3362bc3106 Remove link peer fields from cable termination models 2022-06-01 16:48:56 -04:00
jeremystretch
6befd2155a Clean up tests 2022-06-01 11:38:31 -04:00
jeremystretch
7b02070007 Merge branch 'feature' into 9102-cabling 2022-05-31 16:10:10 -04:00
jeremystretch
32322e95b6 Merge branch 'develop' into feature 2022-05-31 15:50:23 -04:00
jeremystretch
3fbf1f7e71 PRVB 2022-05-31 15:31:22 -04:00
Jeremy Stretch
9d308e6246 Merge pull request #9454 from netbox-community/develop
Release v3.2.4
2022-05-31 15:28:13 -04:00
jeremystretch
6c035eb13d Release v3.2.4 2022-05-31 15:08:33 -04:00
jeremystretch
b0a56a71bb Fixes #9291: Improve data validation for MultiObjectVar script fields 2022-05-31 13:37:14 -04:00
jeremystretch
201b9f635e Fixes #9402: Fix custom field population when creating a virtual chassis 2022-05-31 13:26:25 -04:00
jeremystretch
f1d0d8e57a Fixes #9407: Clean up display of prefixes values when exporting prefixes list 2022-05-31 12:23:22 -04:00
jeremystretch
5838a9f3a0 Closes #9451: Add export_raw argument for TemplateColumn 2022-05-31 12:20:39 -04:00
jeremystretch
998a392bd3 Fixes #9425: Fix bulk import for object and multi-object custom fields 2022-05-31 11:37:30 -04:00
jeremystretch
a0a87fc4c0 Changelog for #9420, #9430 2022-05-31 09:14:23 -04:00
Jeremy Stretch
6c0b4c66c0 Merge pull request #9438 from kkthxbye-code/fix-9420
Fixes #9420: Allow script inheritance
2022-05-31 09:12:49 -04:00
Jeremy Stretch
2c8a1ed69c Merge pull request #9435 from kkthxbye-code/fix-9430
Fixes #9435 - Make sure initial data is passed as array for DynamicModelChoiceFields
2022-05-31 09:09:42 -04:00
kkthxbye-code
fe899d9d7c Iterate base classes when searching for ScriptVariables 2022-05-28 11:29:18 +02:00
kkthxbye-code
6d3cded579 Make sure initial data is passed as array for DynamicModelChoiceFields 2022-05-27 20:41:50 +02:00
jeremystretch
6280398bc1 Clean up tests 2022-05-26 16:40:20 -04:00
jeremystretch
1bd39e6568 Fix filtering cables by connected device/rack/site 2022-05-26 16:01:20 -04:00
jeremystretch
bd950e9ca6 Merge branch 'feature' into 9102-cabling 2022-05-26 15:37:29 -04:00
jeremystretch
db42589cca Closes #5303: A virtual machine may be assigned to a site and/or cluster 2022-05-26 14:59:49 -04:00
jeremystretch
b331f047af Closes #8222: Enable the assignment of a VM to a specific host device within a cluster 2022-05-25 16:01:10 -04:00
jeremystretch
31024ce672 Changelog & cleanup for #9166 2022-05-24 16:39:05 -04:00
Jeremy Stretch
aea023357b Merge pull request #9411 from kkthxbye-code/fix-9166-2
Fixes #9166 - Add the option to make custom fields read-only or hidden in UI
2022-05-24 16:14:23 -04:00
jeremystretch
2e5a5f71ba Changelog for #9277 2022-05-24 16:00:18 -04:00
Jeremy Stretch
72516c00fb Merge pull request #9415 from tyler-8/csrf_cookie_setting
Add optional CSRF_COOKIE_NAME setting, update example config, and docs.
2022-05-24 15:58:00 -04:00
tyler-8
d34d5869be Add optional CSRF_COOKIE_NAME setting, update example config, and docs. 2022-05-24 10:57:38 -04:00
jeremystretch
72726c784a Clean up imports 2022-05-24 09:56:14 -04:00
jeremystretch
662b02e2d8 Closes #9347: Include services in global search 2022-05-24 09:49:36 -04:00
jeremystretch
a9ec1a7b4e Closes #9379: Redirect to virtual chassis view after adding a member device 2022-05-24 09:20:05 -04:00
jeremystretch
f03c5037c4 Fixes #9387: Ensure ActionsColumn extra_buttons are always displayed 2022-05-24 09:14:25 -04:00
Jeremy Stretch
a52c68f4c2 Merge pull request #9406 from lastorel/9365-rolefilter
add `role_id` attribute to filter form of InventoryItem
2022-05-24 08:52:06 -04:00
jeremystretch
a73dda35e8 Bump stale to v5 2022-05-24 08:39:43 -04:00
kkthxbye
6e7c5dcaed Remove whitespace from blank line 2022-05-24 10:38:55 +02:00
kkthxbye
c14a2a0a39 Exclude hidden custom fields from tables 2022-05-24 10:27:29 +02:00
kkthxbye
20eaa7d069 #9166 - Add UI Visibility setting for custom fields 2022-05-24 10:12:32 +02:00
jeremystretch
50c872c47c Clean up tests 2022-05-23 14:50:58 -04:00
jeremystretch
4ec26aa6aa Fix population of initial field selections when creating a cable 2022-05-23 13:52:39 -04:00
jeremystretch
a7d3e5e7f5 Merge all cable creation URLs into a single view 2022-05-23 13:22:45 -04:00
lastorel
0570203891 add role attribute to filter inventoryitems 2022-05-22 17:22:28 +03:00
jeremystretch
7b5ff4c1a5 Merge cable creation/edit views & forms 2022-05-20 16:53:23 -04:00
jeremystretch
64146b8cb1 Closes #8471: Add status field to Cluster 2022-05-19 16:13:22 -04:00
jeremystretch
d155c39f59 Update cable termination type/ID filters 2022-05-18 16:48:49 -04:00
jeremystretch
a909ceda84 Simplify assignment of new cable terminations 2022-05-18 15:49:52 -04:00
jeremystretch
922916ae99 Improve cable termination panel layout 2022-05-18 12:56:16 -04:00
jeremystretch
3b3247592e Changelog for #9098 2022-05-18 08:42:20 -04:00
Jeremy Stretch
17292324a3 Merge pull request #9383 from bluikko/patch-1
Add other power, front/rear port types
2022-05-18 08:41:01 -04:00
bluikko
e5aa9d47f7 Add other power, front/rear port types
Fixes #9098
2022-05-18 15:08:08 +07:00
jeremystretch
75eea50d71 Order CableTerminations by cable, cable_end 2022-05-16 16:35:32 -04:00
jeremystretch
9ef9443969 Add REST API endpoint for CableTermination 2022-05-16 16:21:15 -04:00
jeremystretch
1505369133 Update Cable API serializer 2022-05-16 15:33:57 -04:00
jeremystretch
9e1d8beaf0 Changelog for #9239, #9358 2022-05-16 09:56:02 -04:00
jeremystretch
17fb562740 #9239: Organize contact form fields 2022-05-16 09:55:17 -04:00
Jeremy Stretch
2910aaeec0 Merge pull request #9362 from kkthxbye-code/fix-9358
Fixes #9358 - Annotate provider table in ASN view with count_circuits
2022-05-16 09:31:45 -04:00
Jeremy Stretch
aeef12cdc0 Merge pull request #9364 from kkthxbye-code/fix-9239
Fixes #9239 - Add contact_group to ContactModelFilterSet
2022-05-16 09:28:46 -04:00
kkthxbye-code
8ad203f97a Added contact_group to region, site, manufacturer, tenant filters 2022-05-14 17:53:40 +02:00
kkthxbye-code
aba4e03d3b Add contact_group to ContactModelFilterSet 2022-05-14 17:48:37 +02:00
kkthxbye-code
6a99b36cce Fix provider table in ASN view when ordering by circuit_count 2022-05-14 12:01:49 +02:00
jeremystretch
399afffddf Fix CablePath migration 2022-05-13 16:46:55 -04:00
jeremystretch
906c3dca8b Tests cleanup 2022-05-13 16:29:19 -04:00
jeremystretch
1b593384e5 Restore reverse relation to CableTerminations from Cable 2022-05-13 15:45:58 -04:00
jeremystretch
951627093c Test cleanup 2022-05-13 15:34:01 -04:00
jeremystretch
6ff2e55ce4 Add origins, destinations properties on CablePath 2022-05-13 15:05:38 -04:00
jeremystretch
3082c76ec6 Update object trace() method 2022-05-13 14:37:20 -04:00
jeremystretch
4c51dbba80 Update connected_endpoint serializer field to support multiple objects 2022-05-13 11:04:38 -04:00
Daniel Sheppard
f415d81049 Fixes #8374 - Display device type and asset tag if name is blank but asset tag is populated 2022-05-13 09:49:07 -05:00
Daniel Sheppard
24ff360ee0 Fixes #8922 - Add service list to IP address view 2022-05-13 09:40:24 -05:00
Daniel Sheppard
2a4c728375 Merge remote-tracking branch 'origin/develop' into develop 2022-05-13 09:29:12 -05:00
Daniel Sheppard
752a497218 Fixes #9094 - Fix partial address search within Prefix and Aggregate filters 2022-05-13 09:28:24 -05:00
Daniel Sheppard
1d4409c703 Fixes #9094 - Fix partial address search within Prefix and Aggregate filters 2022-05-13 09:08:00 -05:00
jeremystretch
3a461d0279 Update Cable instantiations to match new signature 2022-05-13 09:33:00 -04:00
jeremystretch
594964aebe Simplify Cable init signature 2022-05-12 17:11:01 -04:00
jeremystretch
bb9eb119a4 Extend cable tracing tests 2022-05-12 16:08:44 -04:00
jeremystretch
4d5bcb65c8 Fix up pass-through port traversal 2022-05-12 16:08:44 -04:00
jeremystretch
c88f7b8408 Fix circuit termination tracing & update tests 2022-05-12 16:08:44 -04:00
jeremystretch
8bc6d8cb23 Introduce CablePath.retrace() to handle deleted cables 2022-05-12 16:08:44 -04:00
jeremystretch
eb4984afe6 Correct test queries 2022-05-12 16:08:44 -04:00
jeremystretch
d89f067c00 Update & restore rebuild_paths() 2022-05-12 16:08:44 -04:00
jeremystretch
5667a9c456 Refactor CablePath.from_origin() 2022-05-12 16:08:44 -04:00
jeremystretch
b44bfa1aa6 WIP 2022-05-12 16:08:44 -04:00
jeremystretch
304282bd4f Update tests 2022-05-12 16:08:44 -04:00
jeremystretch
93daa6406b Fix cable path tracing 2022-05-12 16:08:44 -04:00
jeremystretch
ecee7421ea Fix terminations assignment 2022-05-12 16:08:44 -04:00
jeremystretch
83fdab5feb Change CablePath.path to JSONField 2022-05-12 16:08:44 -04:00
jeremystretch
e129ae50f0 Start updating tests 2022-05-12 16:08:44 -04:00
jeremystretch
f0b722b0a5 Update cable tracing logic 2022-05-12 16:08:44 -04:00
jeremystretch
82706eb3a6 Migrate CablePath to use two-dimensional array 2022-05-12 16:08:44 -04:00
jeremystretch
c22007939b Ensure cable is cached on terminating endpoints 2022-05-12 16:08:44 -04:00
jeremystretch
f0fc8bf2cf Restrict A terminations by parent object 2022-05-12 16:08:44 -04:00
jeremystretch
c3742f63fd Update signal handlers (WIP) 2022-05-12 16:08:44 -04:00
jeremystretch
5d37f9f975 Update cable connection forms 2022-05-12 16:08:44 -04:00
jeremystretch
1f4ad444ae Introduce CableTermination model & migrate data 2022-05-12 16:08:44 -04:00
jeremystretch
907323d46f Revert initial model changes 2022-05-12 16:08:44 -04:00
jeremystretch
e0fc1b4f41 Remove errant print statement 2022-05-12 16:08:44 -04:00
jeremystretch
4bb9b6ee26 Extend Cable model to support multiple A/B terminations 2022-05-12 16:08:44 -04:00
jeremystretch
6c290353c1 Allow editing A side termination when creating cable 2022-05-12 16:08:44 -04:00
jeremystretch
c48c8cc353 Remove termination IDs from cable creation view paths 2022-05-12 16:08:44 -04:00
jeremystretch
e208404e3a Merge branch 'develop' into feature 2022-05-12 14:16:01 -04:00
jeremystretch
3c7c8c8776 PRVB 2022-05-12 14:14:40 -04:00
Jeremy Stretch
bb2235b05e Merge pull request #9354 from netbox-community/develop
Release v3.2.3
2022-05-12 14:09:30 -04:00
jeremystretch
a6aec9ebac Release v3.2.3 2022-05-12 13:53:26 -04:00
jeremystretch
5f3695d2d0 Closes #8805: Add "mixed" option for device airflow indication 2022-05-12 12:18:58 -04:00
jeremystretch
ad12ad4a77 Closes #9221: Add definition list support for Markdown 2022-05-12 11:05:34 -04:00
jeremystretch
37903776fd Fixes #9296: Improve Markdown link sanitization 2022-05-12 10:41:29 -04:00
jeremystretch
c4c93ee346 Closes #9343: Add Ubiquiti SmartPower power outlet type 2022-05-12 10:17:29 -04:00
jeremystretch
72b2ab03cc #9340: Introduce config parameters for Sentry sampling rates 2022-05-12 10:00:57 -04:00
jeremystretch
4cefe26f80 #9340: Add default Sentry DSN 2022-05-12 09:35:13 -04:00
jeremystretch
991950650b Add Sentry as a sponsor 2022-05-11 16:44:26 -04:00
Jeremy Stretch
8cc94689d8 Merge pull request #9342 from netbox-community/9340-sentry
Closes #9340: Enable Sentry integration
2022-05-11 16:26:46 -04:00
jeremystretch
01d2ede097 Closes #1202: Support overlapping assignment of NAT IP addresses 2022-05-11 16:22:07 -04:00
jeremystretch
e2a02de6e9 Remove erroneous field from prefetch 2022-05-11 16:13:35 -04:00
jeremystretch
ca10a7834a Merge branch 'develop' into feature 2022-05-11 16:09:25 -04:00
jeremystretch
312d6c890e Add sentry-sdk as a dependency 2022-05-11 15:20:18 -04:00
jeremystretch
c146596564 Implement a custom 404 handler to enable Sentry reporting 2022-05-11 14:27:18 -04:00
jeremystretch
6f5c2f1e29 Enable & document Sentry integration 2022-05-11 14:13:50 -04:00
jeremystretch
1726593fb0 Introduce MODULE_TOKEN constant 2022-05-11 10:37:04 -04:00
jeremystretch
e8575495db Changelog for #9190, #9314 2022-05-11 10:31:04 -04:00
devon-mar
cffc064a33 Add device & vm to FHRPGroupAssignmentFilterSet (#9314)
* Add device & vm to `FHRPGroupAssignmentFilterSet`

* Apply suggestions from code review

* Update netbox/ipam/tests/test_filtersets.py

* Update netbox/ipam/filtersets.py

Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
2022-05-11 10:27:50 -04:00
Jeremy Stretch
3dda7e2da2 Merge pull request #9331 from kkthxbye-code/fix-9001
Fixes #9001 & #9190 - Add form validation to model installation
2022-05-11 10:04:06 -04:00
jeremystretch
22f1863475 Add security document 2022-05-11 09:12:07 -04:00
jeremystretch
bdb21da26e Fixes #9330: Add missing module_type field to REST API serializers for modular device component templates 2022-05-11 08:57:19 -04:00
jeremystretch
e759e123ac Fixes #9333: Annotate unit on interface speed field 2022-05-11 08:09:51 -04:00
kkthxbye-code
d858eceb38 Fix pep8 2022-05-10 17:53:01 +02:00
kkthxbye-code
af126fe7e3 Added form validation to model installation
Raises a ValidationError whenever installation would cause a foreign key violation.
2022-05-10 17:50:33 +02:00
CroogQT
124e93f737 yarn bundle. 2022-05-06 12:16:45 -07:00
CroogQT
fbd933b56a prettier fixes 2022-05-06 11:44:34 -07:00
CroogQT
9c5355a300 added JSDoc comments 2022-05-06 11:43:18 -07:00
CroogQT
491a4e7d78 various punctuation and spacing fixes 2022-05-06 11:33:00 -07:00
jeremystretch
39a9ebaeee Fixes #9313: Remove HTML code from CSV output of many-to-many relationships 2022-05-06 10:26:02 -04:00
jeremystretch
9b4e016fe4 Fixes #9306: Include VC master interfaces when selecting a LAG/bridge for a VC member interface 2022-05-06 09:47:52 -04:00
jeremystretch
422ec7ecec Fixes #9311: Permit creating contact assignment without a priority via the REST API 2022-05-06 09:25:40 -04:00
kkthxbye
a06a280534 Merge pull request #9312 from kkthxbye-code/fix-9310
Fixes #9310 - Remove stray characters from Config Context tab
2022-05-06 13:58:47 +02:00
kkthxbye
1358469375 Remove stray characters from Config Context tab 2022-05-06 08:01:15 +02:00
CroogQT
90d8395a2c Fixed variable type issue...i think. 2022-05-05 15:24:16 -07:00
CroogQT
11f7e3099d fixed text deselection and refactor 2022-05-05 15:01:40 -07:00
CroogQT
ef29bffb72 is this supposed to be ignored? 2022-05-05 13:27:09 -07:00
CroogQT
3effa37fa7 click event calls multiselect function 2022-05-05 13:24:50 -07:00
CroogQT
1493c920fd silly text highlight workaround... 2022-05-05 13:24:12 -07:00
CroogQT
ea9258d36c added main multi-select function 2022-05-05 13:23:43 -07:00
CroogQT
db142061ff clicking a PkCheckbox updates state 2022-05-05 12:37:28 -07:00
CroogQT
c536944a10 now exports multiselect function 2022-05-05 12:36:17 -07:00
CroogQT
ae7ddecaa6 now exports previousPkCheck.ts 2022-05-05 12:14:15 -07:00
CroogQT
2e38e62101 create store to store previously checked element 2022-05-05 12:13:02 -07:00
CroogQT
2979a64ce3 add file, skeleton from "select all" 2022-05-05 12:11:02 -07:00
jeremystretch
bddca8e232 Changelog for #9280 2022-05-05 14:14:49 -04:00
Jeremy Stretch
e9bf6a7bc5 Merge pull request #9281 from kkthxbye-code/adopt-module-component
Fixes #9280 - Add option to adopt existing DeviceComponents
2022-05-05 10:29:20 -04:00
kkthxbye-code
9c3dfdfd14 Fix test_module_component_adoption 2022-05-05 09:30:13 +02:00
kkthxbye-code
c52aa2196d Prefetch installed components when adding modules 2022-05-04 23:21:03 +02:00
kkthxbye-code
81c7fe2084 Don't adopt components already belonging to a module 2022-05-04 22:59:28 +02:00
jeremystretch
0301aec409 Closes #9260: Apply user preferences to tables under object detail views 2022-05-04 15:46:13 -04:00
jeremystretch
015bc48345 #8998: Add region filter for rack reservations; Add filter tests 2022-05-04 14:29:36 -04:00
jeremystretch
da1aabdfc1 Changelog for #8894, #8998, #9122; PEP8 fix 2022-05-04 14:19:09 -04:00
Jeremy Stretch
c2fe2ba56f Merge pull request #9147 from minitriga/issue_8998
Closes #8998: Add site group filter to racks
2022-05-04 14:16:35 -04:00
Jeremy Stretch
52b18393eb Merge pull request #9150 from minitriga/issue_8894
Closes #8894: Add first and last name username user api select
2022-05-04 14:09:38 -04:00
Jeremy Stretch
b172ae65d2 Merge pull request #9256 from kkthxbye-code/fix-9122
Fix #9122 - Clear the cache when running the upgrade script
2022-05-04 14:03:48 -04:00
jeremystretch
eab187fb6b Changelog for #9267, #9278 2022-05-04 13:59:38 -04:00
Jeremy Stretch
502a14e820 Merge pull request #9288 from huntabyte/develop
Closes #9278: Linkify device type in manufacturer table
2022-05-04 13:43:16 -04:00
kkthxbye
7de27c69c0 Fix PEP8 2022-05-04 09:16:19 +02:00
kkthxbye
f455f91ea3 Add view test for module component adoption 2022-05-04 08:58:42 +02:00
Hunter Johnston
bdaefc0e4d Closes #9278: Linkify device type in manufacturer table 2022-05-03 18:34:32 -04:00
kkthxbye-code
8040804c75 Allow mixture of component replication and adoption 2022-05-03 22:03:12 +02:00
minitriga
7cd840610b Update netbox/dcim/forms/filtersets.py
Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
2022-05-03 11:47:37 +01:00
minitriga
15e91908e8 Update netbox/dcim/forms/filtersets.py
Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
2022-05-03 11:47:32 +01:00
Alex Gittings
0a9ba3b2e6 add get_display to users serializer 2022-05-03 10:45:08 +00:00
minitriga
535606a185 Update netbox/users/api/nested_serializers.py
Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
2022-05-03 09:01:06 +01:00
minitriga
25c266e4de Update netbox/users/api/nested_serializers.py
Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
2022-05-03 09:00:52 +01:00
kkthxbye-code
977ccb01f2 Formatting: Remove whitespace on blank line 2022-05-02 21:55:34 +02:00
kkthxbye-code
c2a6a1c125 Create module components in bulk 2022-05-02 21:37:37 +02:00
Jeremy Stretch
f6402a8b62 Merge pull request #9275 from kkthxbye-code/fix-9267
Fixes #9267 - Fix early terminated tuple in IPAddressRoleChoices
2022-05-02 09:19:11 -04:00
kkthxbye
30d4097fd8 Fix early terminated tuple in IPAddressRoleChoices 2022-05-02 12:09:49 +02:00
kkthxbye-code
3fb967b482 Add ability to adopt components when adding a module 2022-04-30 02:19:11 +02:00
jeremystretch
61d756c7c4 Closes #9261: NetBoxTable no longer automatically clears pre-existing calls to prefetch_related() on its queryset 2022-04-29 13:09:39 -04:00
jeremystretch
9ae25e9449 Merge branch 'develop' into feature 2022-04-29 09:05:52 -04:00
kkthxbye
9f3846ec5f Clear the cache when running the upgrade script 2022-04-29 09:19:37 +02:00
kkthxbye
7b5625a722 Add management command for clearing cache 2022-04-29 09:19:19 +02:00
jeremystretch
152d5a3b9a PRVB 2022-04-28 15:06:27 -04:00
Jeremy Stretch
50b6ded6f0 Merge pull request #9253 from netbox-community/develop
Release v3.2.2
2022-04-28 15:00:11 -04:00
jeremystretch
5ee3ee6181 Release v3.2.2 2022-04-28 14:39:02 -04:00
Jeremy Stretch
cd3e901a60 Merge pull request #9248 from kkthxbye-code/fix-9138
Fixes #9138 - Prevent searching when pressing enter in Quick Search
2022-04-28 12:24:07 -04:00
kkthxbye
314c41f47f Prevent searching when pressing enter in Quick Search 2022-04-28 07:47:04 +02:00
jeremystretch
a1c1532614 Changelog for #4264 2022-04-27 15:36:29 -04:00
Jeremy Stretch
ffef78d426 Merge pull request #9112 from sc68cal/rfc_4291
Closes #4264: Do not allocate subnet router anycast for IPv6 prefixes
2022-04-27 15:30:05 -04:00
jeremystretch
8153406dd0 Fixes #9227: Fix related object assignment when recording change record for interfaces 2022-04-27 14:12:20 -04:00
Sean M. Collins
b5613a2cc6 Do not allocate subnet router anycast in certain IPv6 prefixes 2022-04-26 14:54:52 -04:00
jeremystretch
6a225e53f5 Fixes #9222: Fix circuit ID display under cable view 2022-04-25 21:09:20 -04:00
jeremystretch
e2b32757d8 Merge branch 'develop' into feature 2022-04-25 12:20:46 -04:00
jeremystretch
6b73d22da1 Changelog for #8959 2022-04-25 10:11:51 -04:00
Jeremy Stretch
8b81c10f84 Merge pull request #9201 from kkthxbye-code/fix-8959
Fixes #8959: Add lock around script loading to prevent race condition
2022-04-25 10:10:06 -04:00
jeremystretch
a6a1bec437 Closes #9218: Update documentation links with docs.netbox.dev 2022-04-25 09:48:39 -04:00
jeremystretch
562d1bfcd0 Fixes #9194: Support position assignment when add module bays to multiple devices 2022-04-25 08:41:38 -04:00
jeremystretch
4f86d6a690 Fixes #9206: Show header for comments field under module & module type creation views 2022-04-25 08:33:41 -04:00
jeremystretch
e63a191373 Closes #9214: Linkify cluster counts in cluster type & group tables 2022-04-25 08:23:21 -04:00
Jeremy Stretch
74b5e55643 Merge pull request #9200 from kkthxbye-code/fix-9189
Fixes #9189:  Correct custom validators docs
2022-04-25 08:11:15 -04:00
Jeremy Stretch
405d0ab972 Merge pull request #9199 from kkthxbye-code/fix-8941
Fixes #8941: Fix apiSelect scrolling while zoomed in chrome
2022-04-25 08:09:04 -04:00
kkthxbye-code
84e4156259 Add lock around script loading to prevent race condition 2022-04-22 21:21:01 +02:00
kkthxbye-code
50428c3f01 Correct custom validators docs 2022-04-22 20:42:29 +02:00
kkthxbye-code
a91c46b4c0 UI: Fix apiSelect scrolling while zoomed in chrome 2022-04-22 20:33:46 +02:00
Kevin Meijer
8315883db9 Adds Ubiquiti SmartPower to the power port types (#9193)
Co-authored-by: Kevin Meijer <kevinmeijer@brightfish.nl>
2022-04-22 08:11:31 -04:00
Pieter Lambrecht
fa4807be8c Update releasenotes 2022-04-19 21:55:39 +02:00
Pieter Lambrecht
086e34f728 Updated docs relnotes to refer to 8233 2022-04-19 21:33:29 +02:00
jeremystretch
d22f9000d6 Add troubleshooting section to Azure AD guide 2022-04-19 10:00:41 -04:00
Pieter Lambrecht
2587720298 Fix 8878: Restrict API key usage by Source IP 2022-04-19 14:44:35 +02:00
jeremystretch
bb99cee48a Changelog & test for #9060 2022-04-18 13:14:30 -04:00
minitriga
a3805fe04d Closes #9060: Implement modulebay, iventory items and device bay filters (#9146)
* Closes #9060: Implement modulebay, iventory items and device bay filters

* add blank line
2022-04-18 13:07:41 -04:00
jeremystretch
d4f1cb5d6a Fixes #9158: Do not list tags field for CSV forms which do not support tag assignment 2022-04-18 09:39:36 -04:00
jeremystretch
118bf5152c Fixes #9132: Limit location options by selected site when creating a wireless link 2022-04-18 09:02:03 -04:00
jeremystretch
41244dc677 Closes #9152: Annotate related object type under custom field view 2022-04-18 08:56:28 -04:00
jeremystretch
671e1aed9f Fixes #9151: Child prefix counts not annotated on aggregates list under RIR view 2022-04-18 08:43:46 -04:00
jeremystretch
1636508a6a Fixes #9156: Fix loading UserConfig data from fixtures 2022-04-18 08:36:41 -04:00
Alex Gittings
bc2491e6b7 Closes #8894: Add first and last name to APISelect widget if set 2022-04-15 21:50:24 +00:00
Alex Gittings
69a1cc8759 Closes #8998: Add site group filter to racks 2022-04-15 20:36:40 +00:00
jeremystretch
c21db0ff6a Closes #9137: Add SSO configuration guide for Okta 2022-04-15 16:03:36 -04:00
jeremystretch
a889b3a4be Add title for missing okta-openidconnect backend 2022-04-15 15:04:44 -04:00
Jeremy Stretch
098ef91583 Merge pull request #9144 from netbox-community/8495-custom-field-groups
Closes #8495: Enable custom field grouping
2022-04-15 14:57:28 -04:00
jeremystretch
17df8a5c43 Closes #8495: Enable custom field grouping 2022-04-15 14:45:28 -04:00
jeremystretch
4fac10ac4a Merge branch 'develop' into feature 2022-04-15 12:09:28 -04:00
jeremystretch
10c7fdb618 Closes #9136: Add SSO configuration guide for Microsoft Azure AD 2022-04-14 21:42:47 -04:00
jeremystretch
7be0a1a55f Changelog for #9133 2022-04-14 15:51:26 -04:00
Jeremy Stretch
a98b2fabe0 Merge pull request #9134 from markkuleinio/python-version
Fixes #9133: Require Python 3.8+ to run upgrade.sh
2022-04-14 15:50:18 -04:00
Markku Leiniö
7779b66972 Require Python 3.8+ to run upgrade.sh 2022-04-14 22:01:21 +03:00
jeremystretch
7463c40c40 Restore documentation search function 2022-04-14 14:24:34 -04:00
jeremystretch
996221147e PRVB 2022-04-14 14:15:48 -04:00
Jeremy Stretch
7cd9bcd3f5 Merge pull request #9131 from netbox-community/develop
Release v3.2.1
2022-04-14 14:12:24 -04:00
jeremystretch
fdc018d809 Release v3.2.1 2022-04-14 13:58:18 -04:00
jeremystretch
fa5cf665ce Fixes #9128: Resolve component labels per module bay position when installing modules 2022-04-14 11:13:04 -04:00
jeremystretch
d6df6b444f Closes #9123: Improve appearance of SSO login providers 2022-04-14 10:54:07 -04:00
jeremystretch
78836389f0 Changelog for #8543 & cleanup 2022-04-14 08:37:58 -04:00
Jeremy Stretch
fa4b88a504 Merge pull request #9124 from tyler-8/wlan_site_filter_3_2
Add filters to VLAN selection group for WirelessLAN Form
2022-04-14 08:33:51 -04:00
Tyler Bigler
1a374a1669 Add filters to VLAN selection group 2022-04-14 00:58:17 -04:00
jeremystretch
01ba1b8c03 Fixes #9118: Fix validation error when importing VM child interfaces 2022-04-13 13:43:18 -04:00
jeremystretch
f09a5aacae Changelog for #9110 2022-04-12 14:17:08 -04:00
Jeremy Stretch
95d084d36d Merge pull request #9110 from JoeIzzard/develop
Closes #8415: Adds Neutrik power connectors
2022-04-12 12:40:31 -04:00
Joe Izzard
d35cd18745 fix: standardisation 2022-04-12 17:06:33 +01:00
jeremystretch
4e493d7836 Changelog for #8920, #8956 2022-04-12 12:05:09 -04:00
Jeremy Stretch
68b8cca540 Merge pull request #8957 from kkthxbye-code/save-job-results
Fix #8956: Save old JobResults
2022-04-12 11:57:48 -04:00
kkthxbye-code
c216405a81 Change default JOBRESULT_RETENTION from 0 to 90 2022-04-12 11:42:47 -04:00
kkthxbye
aa2ec3b9c9 Add dynamic config JOBRESULT_RETENTION
and cleanup functionality to the housekeeping script
2022-04-12 11:42:47 -04:00
kkthxbye
f13a00b2dd Save old JobResults 2022-04-12 11:42:47 -04:00
Jeremy Stretch
8781d03aa7 Merge pull request #9067 from jasonyates/FR8920-nonrackeddevices
Limit amount of nonracked devices displayed
2022-04-12 11:38:14 -04:00
jeremystretch
1266a2f753 Fixes #9116: assigned_to_interface filter for IP addresses should not match FHRP group assignments 2022-04-12 10:07:31 -04:00
jeremystretch
23d2cf1718 Closes #9081: Add fhrpgroup_id filter for IP addresses 2022-04-12 09:56:33 -04:00
jeremystretch
d11031c694 Closes #9099: Enable display of installed module serial & asset tag in module bays list 2022-04-12 09:00:19 -04:00
jeremystretch
916e976297 Tweak changelog for #9061 2022-04-12 08:22:17 -04:00
jeremystretch
27a9313396 #9096: Correct getattr() call 2022-04-12 08:13:08 -04:00
jeremystretch
517d0158b6 Fixes #9096: Remove duplicate filter tag when filtering by "none" 2022-04-11 08:51:11 -04:00
jeremystretch
a9e05aec7c Fixes #9100: Include position field in module type YAML export 2022-04-11 08:28:10 -04:00
Joe Izzard
9b3e43cb21 Closes #8415: Adds Neutrik power connectors 2022-04-11 12:20:44 +01:00
Jason Yates
23fddf74b6 Updating to use a single queryset
Updating to use a single queryset for both template variables
2022-04-10 09:06:14 +01:00
jeremystretch
03535ce50b Closes #8995: Enable arbitrary ordering of REST API results 2022-04-08 16:00:33 -04:00
Jeremy Stretch
9b8de19fe6 Merge pull request #9085 from stephanblanke/8913-improve-documentation-regarding-vcs
Closes #8913: Improve documentation regarding VC masters interfaces
2022-04-08 14:17:35 -04:00
jeremystretch
1d8b8aad3b Changelog & documentation for #5479 2022-04-08 14:10:21 -04:00
Jeremy Stretch
84c30580aa Merge pull request #9028 from kkthxbye-code/job-timeout
Fixes #5479 - Allow setting individual timeouts on scripts and reports
2022-04-08 13:54:08 -04:00
Stephan Blanke
a5f25726cd Closes #8913: Improve documentation regarding VC masters interfaces 2022-04-08 19:39:18 +02:00
Jeremy Stretch
7a6e047519 Merge pull request #9082 from danielestevez/doc-remote-auth-default-group
Conflicting documentation on remote default group
2022-04-08 10:44:38 -04:00
jeremystretch
1e65ef0c1a Fixes #9055: Restore ability to move inventory item to other device 2022-04-08 09:41:37 -04:00
jeremystretch
2269bf0167 Fixes #9079: Fail validation when an inventory item is assigned as its own parent 2022-04-08 09:08:55 -04:00
jeremystretch
5526f8e3dc Fix dumpdata ordering for VRFs 2022-04-07 21:19:38 -04:00
Jason Yates
2781b8535c Update nonracked_devices.html
Fixing issue where Displaying 10 of 10 would appear when it's not required.
2022-04-07 08:32:50 +01:00
Jason Yates
c3d9910e08 Limit amount of nonracked devices displayed
Fixes #8920

Limits the amount of non-racked devices on Site and Location view to 10 and provides a link to the device list this is pre-filtered to the relevant site or location.
2022-04-07 08:21:13 +01:00
jeremystretch
b9f6a5625f Update supported Python versions 2022-04-06 20:30:29 -04:00
jeremystretch
f4e78b0ea6 Fixes #9065: Min/max VID should not be required when filtering VLAN groups 2022-04-06 20:29:28 -04:00
jeremystretch
d93e944c07 Closes #8973: Display VLAN group count under site view 2022-04-06 20:12:14 -04:00
jeremystretch
6760533a10 Fixes #8931: Copy assigned tenant when cloning a location 2022-04-06 20:01:09 -04:00
Daniel Sheppard
85e65edb7d Fixes #9057 - Fix missing instance counts for module types 2022-04-06 13:46:31 -05:00
Daniel Sheppard
523390cd8e #9061 - Change inheritance order for DeviceComponentFilterSets 2022-04-06 13:35:22 -05:00
jeremystretch
ea197eff5f PRVB 2022-04-05 17:12:13 -04:00
Jeremy Stretch
d4938b7699 Merge pull request #9041 from netbox-community/develop
Release v3.2.0
2022-04-05 17:03:58 -04:00
jeremystretch
6ee6227b67 Pin Jinja2 to v3.0 2022-04-05 16:34:15 -04:00
jeremystretch
6f0ae8a5b8 Release v3.2.0 2022-04-05 16:26:07 -04:00
jeremystretch
c1b7f09530 Ensure legacy data checks run before other migrations 2022-04-05 15:56:21 -04:00
jeremystretch
9addde00e3 Merge branch 'feature' into develop 2022-04-05 14:51:26 -04:00
Jeremy Stretch
10f8a94399 Merge pull request #9039 from netbox-community/develop
Release v3.1.11
2022-04-05 14:45:41 -04:00
jeremystretch
631de20a8d Release v3.1.11 2022-04-05 14:35:27 -04:00
jeremystretch
66464fd807 Implement bypass for migration safeguard 2022-04-05 14:24:28 -04:00
jeremystretch
0f5fe746e0 Add warning for legacy ASN field on site 2022-04-05 10:22:42 -04:00
jeremystretch
a7fc8621a8 Closes #9036: Add bulk edit capability for site contact fields 2022-04-05 10:18:20 -04:00
jeremystretch
8b92bc6c4a Add migration safeguard to prevent accidental destruction of data 2022-04-05 10:07:48 -04:00
jeremystretch
830b56ac9e Check that ChoiceSet CHOICES is mutable if key is set 2022-04-05 08:40:30 -04:00
jeremystretch
fcfdbfc2b5 Merge branch 'develop' into feature 2022-04-05 08:21:39 -04:00
jeremystretch
e575279738 Changelog for #8365 2022-04-04 15:58:54 -04:00
Jeremy Stretch
796f7258cc Merge pull request #9018 from stephanblanke/8365-filering-for-child-devices-by-parent-device
Closes #8365: Filtering for child devices by parent device
2022-04-04 15:18:20 -04:00
jeremystretch
ea88b040ec Fixes #8658: Fix display of assigned components under inventory item lists 2022-04-04 14:40:22 -04:00
kkthxbye-code
69b4d0d44b #9028 - Fix pep8 syntax 2022-04-04 18:13:13 +02:00
kkthxbye-code
36d6ae33d1 Allow setting individual timeouts on scripts and reports 2022-04-04 18:00:38 +02:00
Stephan Blanke
8126087b3e Merge branch 'netbox-community:develop' into 8365-filering-for-child-devices-by-parent-device 2022-04-02 18:10:12 +02:00
Stephan Blanke
780459d2bf Closes #8365: Filtering for child devices by parent device 2022-04-02 18:08:48 +02:00
jeremystretch
e2b6d69596 Monkey-patch Django's force_text in lieu of graphene-django 2.16 release 2022-04-01 10:15:45 -04:00
jeremystretch
7fff1e6fe5 Closes #9003: Enable bulk module assignment/removal for device components 2022-04-01 09:42:30 -04:00
jeremystretch
b576ce72a1 Merge branch 'develop' into feature 2022-04-01 09:13:37 -04:00
jeremystretch
99a01207bc Closes #9012: Linkify circuits count in providers list 2022-04-01 09:06:44 -04:00
Jeremy Stretch
6d6457ad18 Merge pull request #9010 from kkthxbye-code/fix-9009
Annotate rack search queryset with device count
2022-04-01 08:43:22 -04:00
jeremystretch
35f3a42e7f Remove 2022 survey announcement 2022-04-01 08:31:53 -04:00
kkthxbye
a84ae88214 Annotate rack search queryset with device count 2022-04-01 09:34:16 +02:00
jeremystretch
4fae42de51 Fixes #9007: Fix FieldError exception when instantiating a device type with nested inventory items 2022-03-31 12:07:02 -04:00
jeremystretch
1d55c04c21 Closes #9006: Enable custom fields, custom links, and tags for journal entries 2022-03-31 11:40:02 -04:00
jeremystretch
7a54658710 Fixes #8978: Fix instantiation of front ports when provisioning a module 2022-03-31 09:03:01 -04:00
jeremystretch
bddc35bbc7 Closes #8496: Enable assigning multiple ASNs to a provider 2022-03-30 17:17:36 -04:00
jeremystretch
cdacd2a951 Closes #8593: Add link field to contact model 2022-03-30 16:19:12 -04:00
jeremystretch
58e4d08bb0 Closes #8790: Include site and prefixes columns in VLAN group VLANs table 2022-03-30 15:51:12 -04:00
jeremystretch
3ff4fd814e Merge branch 'develop' into feature 2022-03-30 15:45:40 -04:00
jeremystretch
91e8f57afb Change log & cleanup for #8163, #8866 2022-03-30 15:39:28 -04:00
Jeremy Stretch
e3d0628a06 Merge pull request #8870 from minitriga/issue_8866
APISelect JavaScript only perform fetch if Django substitutes have been replaced.
2022-03-30 15:37:14 -04:00
Jeremy Stretch
9fca9ca7ec Merge pull request #8983 from stephanblanke/8163-bridge-members-panel-in-interface-view
Closes #8163: Add bridge members panel to interface view
2022-03-30 15:27:37 -04:00
jeremystretch
2d09a40663 Closes #8601: Include group when displaying tenant assigned to cluster 2022-03-30 15:04:13 -04:00
jeremystretch
1eaf55c555 Closes #8336: Add note about referening object in custom link template 2022-03-30 14:14:49 -04:00
jeremystretch
db535e6453 Closes #8436: Update token permissions documentation 2022-03-30 14:05:27 -04:00
jeremystretch
dadec9d3cb Add instruction for checking out an older release 2022-03-30 13:03:08 -04:00
jeremystretch
ff780177d0 Clean up exception templates 2022-03-29 16:01:10 -04:00
Stephan Blanke
b7e2ea1ca5 Closes #8163: Add bridge members panel to interface view 2022-03-28 20:37:00 +02:00
jeremystretch
bf50134d94 #8976: Set required=False on serializer field 2022-03-28 14:18:45 -04:00
jeremystretch
227bac7c60 Fixes #8976: Add missing object_type field on CustomField REST API serializer 2022-03-28 13:34:37 -04:00
jeremystretch
340ff82487 Fixes #8970: Permit nested inventory item templates on device types 2022-03-28 13:22:43 -04:00
jeremystretch
894665b067 Changelog for #8785, #8830 2022-03-28 10:35:49 -04:00
jeremystretch
48b7294ff1 #8785: Tweak regex validator to avoid creating no-op migration file 2022-03-28 10:35:00 -04:00
Jeremy Stretch
cde8ff282d Merge pull request #8962 from apellini/patch-2
#8830 Adding ClusterXL
2022-03-28 10:06:50 -04:00
Jeremy Stretch
0b44a595e2 Merge pull request #8945 from fmlshai/develop
Fix #8785 - allow wildcard dns records
2022-03-28 10:04:33 -04:00
Jeremy Stretch
37781bd208 Fix parentheses 2022-03-28 09:37:33 -04:00
fmlshai
e0344e9251 Update validators.py
Updated DNSValidator regex
2022-03-28 15:20:19 +02:00
jeremystretch
a1808a54a4 Fixes #8974: Use monospace font for text areas in config revision form 2022-03-28 09:13:15 -04:00
neope
1cef513f6c Adding ClusterXL as FHRPGroupProtocolChoices
Adding in choices group standard, checkpoint and cisco and ungroupped other.
2022-03-25 19:41:35 +01:00
jeremystretch
22908a12e9 Merge branch 'develop' into feature 2022-03-25 10:38:44 -04:00
jeremystretch
57759aa4a3 PRVB 2022-03-25 10:29:44 -04:00
Jeremy Stretch
d50148fab7 Merge pull request #8968 from netbox-community/develop
Release v3.1.10
2022-03-25 10:28:38 -04:00
jeremystretch
271c2ea3e3 Correct changelog 2022-03-25 10:16:40 -04:00
jeremystretch
20a6f6ac79 Release v3.1.10 2022-03-25 10:14:37 -04:00
jeremystretch
8924d5fa05 Correct change log 2022-03-25 10:04:48 -04:00
jeremystretch
26637d934b Change log for #8232, #8926 2022-03-25 10:02:21 -04:00
jeremystretch
dde4495e20 #8232: Cleanup & test fix 2022-03-25 09:59:58 -04:00
tranthang2404
1278429518 Closes #8232: Add color show full 100% utilization (#8816)
* Closes #8232: Add color show full 100% utilization

* change rounding

* change rounding

* fix hard code html

* format
2022-03-25 09:52:13 -04:00
Jeremy Stretch
421f5a03aa Merge pull request #8963 from minitriga/issue_8926
Closes #8926: Implement type and roll to device bay table
2022-03-25 09:12:45 -04:00
Alex Gittings
a433d5d59d Closes #8926: Implement type and roll to device bay table 2022-03-25 09:25:55 +00:00
neope
934493bf5f #8830 Adding ClusterXL
Adding ClusterCL Choice to FHRP Group
2022-03-25 08:35:57 +01:00
jeremystretch
58f97bc0e7 Merge develop into feature 2022-03-24 16:35:35 -04:00
jeremystretch
a5820e27a6 Fixes #8905: Disable ordering by assigned tags to prevent erroneous results 2022-03-24 11:56:18 -04:00
jeremystretch
d312fe7c2b Fixes #8696: Fix help link under FHRP group assigment creation view 2022-03-24 11:14:24 -04:00
Jeremy Stretch
124fc73386 Merge pull request #8953 from 991jo/fix-8952
Fixed #8952: rack rear faces link not clickable
2022-03-24 10:53:42 -04:00
jeremystretch
c78e7c14d3 Fixes #8947: Retain filter parameters when handling an export template exception 2022-03-24 10:47:39 -04:00
jeremystretch
30a6dc2f64 Fixes #8951: Allow changing device type & platform to different manufacturer simultaneously 2022-03-24 10:34:09 -04:00
Johannes Erwerle
6ceb78fd4c Fixed #8952: rack rear faces link not clickable 2022-03-24 09:34:23 +01:00
jeremystretch
e09ab79a1a Changelog for #8924 2022-03-23 17:01:57 -04:00
Jeremy Stretch
b6587c00ce Merge pull request #8925 from kkthxbye-code/fast_script_list
Fix #8924 - Speed up rendering of the script list
2022-03-23 16:43:15 -04:00
jeremystretch
df2f6d4a7d Fixes #8872: Enable filtering by custom object fields 2022-03-23 14:34:42 -04:00
jeremystretch
3b69f07b86 Clean up module template 2022-03-23 14:00:56 -04:00
jeremystretch
fdc0036872 Closes #8846: Enable image attachments for module types 2022-03-23 13:58:35 -04:00
jeremystretch
fab90ecbe5 Closes #8803: Enable adding components from module view 2022-03-23 13:50:03 -04:00
jeremystretch
f72d160249 Add form examples to plugin dev docs 2022-03-23 12:12:31 -04:00
jeremystretch
b65404a8a9 Fix cable creation view 2022-03-23 10:55:09 -04:00
jeremystretch
42446cb87b Clean up interface template 2022-03-23 10:51:38 -04:00
fmlshai
f45e64c756 Fix #8785 - allow wildcard dns records
Added * to the DNSValidator regex to allow wildcard domains like *.example.com
2022-03-23 14:38:26 +01:00
kkthxbye
ae46cd33b6 - Move do_not_call_in_templates to BaseScript
- Fix the name classproperty
2022-03-23 12:18:14 +01:00
Jeremy Stretch
61eb22f4f7 Merge pull request #8943 from netbox-community/8912-linkify-filter
Closes #8912: Add linkify template filter
2022-03-22 15:47:29 -04:00
jeremystretch
7c14b8d97b Clean up display of tenant groups 2022-03-22 15:29:05 -04:00
jeremystretch
8d682041a4 Extend linkify() to accept an attr name for the link text 2022-03-22 15:17:34 -04:00
jeremystretch
75dae5fbe8 Introduce linkify template filter 2022-03-22 14:51:20 -04:00
jeremystretch
dc92e19f76 Limit custom field object types to suitable models 2022-03-22 13:12:31 -04:00
jeremystretch
ce87e0dfa4 Merge branch 'develop' into feature 2022-03-22 12:57:23 -04:00
jeremystretch
41efad4056 Fixes #8919: Fix filtering of VLAN groups by site under prefix edit form 2022-03-22 11:39:26 -04:00
jeremystretch
5f89226cd7 Update testing instructions 2022-03-22 10:59:43 -04:00
jeremystretch
197dfca5b2 Fixes #8935: Correct ordering of next/previous racks to use naturalized names 2022-03-22 09:50:38 -04:00
jeremystretch
e6980626d8 Fixes #8932: Fix error when setting null value for interface rf_role via REST API 2022-03-22 09:37:57 -04:00
jeremystretch
ca44a654a5 Closes #8794: Support dynamic configuration for JournalEntry kinds 2022-03-21 16:35:24 -04:00
jeremystretch
48dc76a694 Closes #8685: Add modules, module types to global search 2022-03-21 16:27:38 -04:00
jeremystretch
0c5eab680b Document the use of WritableNestedSerializer 2022-03-21 15:22:45 -04:00
jeremystretch
3dc671395e Introduce local ChoiceField and MultipleChoiceField classes 2022-03-21 15:08:05 -04:00
jeremystretch
ba1e6e91b9 Rename ObjectEditView.model_form to form 2022-03-21 10:22:30 -04:00
kkthxbye
22980cea7b Speed up rendering of the script list 2022-03-21 10:46:51 +01:00
jeremystretch
ed0c19807a Link to plugin tutorial in development docs 2022-03-18 13:43:58 -04:00
jeremystretch
15005209d1 Merge branch 'develop' into feature 2022-03-18 13:34:31 -04:00
jeremystretch
f64987d0c4 Changelog for #8813 2022-03-18 13:25:47 -04:00
PieterL75
0da04232f3 Fixes #8813 Retain search value after submitting (#8907)
* Fixes #8813 Retain search value after submitting

* remove autofocus from searchbar

Co-authored-by: Pieter Lambrecht <pieter.lambrecht@sentia.com>
2022-03-18 13:23:39 -04:00
jeremystretch
8d53b46e82 Merge branch 'develop' into feature 2022-03-18 13:17:11 -04:00
jeremystretch
9a0bb14e76 Install tblib to fix tracebacks during parallel test runs 2022-03-18 11:47:43 -04:00
jeremystretch
900825a2af Changelog for #8457, #8575, #8645 2022-03-18 11:46:49 -04:00
Jeremy Stretch
52de50aa64 Merge pull request #8873 from minitriga/issue_8457
Closes: #8457 - Nonracked  Devices Location/Site
2022-03-18 11:32:24 -04:00
Jeremy Stretch
1541060091 Merge pull request #8742 from minitriga/issue_8645
Allow filtering on Core models for Contacts
2022-03-18 11:24:09 -04:00
Alex Gittings
50bc0caccf Fix issues with ordering and add field_groups 2022-03-18 14:58:51 +00:00
minitriga
8f5b14ec84 Update netbox/dcim/forms/filtersets.py
Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
2022-03-18 14:39:37 +00:00
minitriga
da37db1ea9 Update netbox/circuits/filtersets.py
Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
2022-03-18 14:39:22 +00:00
Alex Gittings
5abde866f1 Closes: #8457 - implement nonracked devices on locations and sites 2022-03-18 14:34:42 +00:00
Jeremy Stretch
32eed72d2b Merge pull request #8874 from minitriga/issue_8575
Closes: #8575 - Show Racks on Cable Table and Cable Page
2022-03-18 10:14:40 -04:00
jeremystretch
585b5a221d Changelog for #8553 2022-03-17 17:06:21 -04:00
Jeremy Stretch
db52fe475a Merge pull request #8573 from 991jo/asn_search_fix
Fixes 8553: Fix contacts and ASNs missing in the search dropdown and …
2022-03-17 16:43:30 -04:00
jeremystretch
57ad730f74 Fixes #8888: Use HTTPS to pull graphene-django branch from GitHub 2022-03-17 08:57:13 -04:00
Jeremy Stretch
c5db99f383 Merge pull request #8887 from sc68cal/sc68cal-patch-1
Update GitHub link for Netaddr
2022-03-16 20:18:47 -04:00
Sean M. Collins
fd6d3205d0 Update GitHub link for Netaddr
The project was renamed/moved to a new location in GitHub and we should update the link
in case the redirect stops functioning
2022-03-16 11:45:14 -04:00
Alex Gittings
9548cf32ff add new line 2022-03-15 00:05:10 +00:00
Alex Gittings
bdbfff911b add new line 2022-03-15 00:04:22 +00:00
Alex Gittings
a143eca57d Closes: #8575 Implement rack_a and rack_b for cable table 2022-03-15 00:02:16 +00:00
jeremystretch
2101f714cc Closes #8848: Show module bay & type in API serilizer display 2022-03-14 14:06:14 -04:00
Alex Gittings
3edff89a4d Fixes: #8866 - Does not perform API Select Search if a django peramiter has not been replaced 2022-03-14 17:57:33 +00:00
jeremystretch
f2079de2cb Fixes #8838: Fix FieldError exception during global search 2022-03-14 13:55:35 -04:00
jeremystretch
93527d892b Fixes #8845: Correct default ASN formatting in table 2022-03-14 13:49:54 -04:00
jeremystretch
b91218308b Fixes #8869: Fix NoReverseMatch exception when displaying tag w/assignments 2022-03-14 13:47:41 -04:00
jeremystretch
6170138124 Rename ActionsColumn sequence to actions 2022-03-14 13:45:21 -04:00
jeremystretch
1add5accf2 Fixes #8844: Correct VLAN ID max value 2022-03-14 09:57:51 -04:00
jeremystretch
faba6c9bdc Fixes #8850: Show airflow field on device REST API serializer when config context data is included 2022-03-14 09:54:11 -04:00
jeremystretch
4eb7cd06b4 Adjust font size for serial number under device status view 2022-03-14 09:46:40 -04:00
jeremystretch
245cff887c Move q filter to NetBoxModelFilterSet 2022-03-11 16:16:58 -05:00
jeremystretch
59aba52b03 Rename OrderedDefaultRouter to NetBoxRouter & document for plugins 2022-03-11 15:59:03 -05:00
jeremystretch
6d05a4117a Update plugins documentation 2022-03-11 15:47:52 -05:00
jeremystretch
49e5268d48 Fitlerset class declration on ObjectListField should be optional 2022-03-11 15:46:16 -05:00
jeremystretch
76445bd19c Move bulk edit/delete buttons to template tags 2022-03-10 16:27:53 -05:00
jeremystretch
5a3e99626d Simplify add/import/export button invocation 2022-03-10 15:56:09 -05:00
jeremystretch
ffc29d14a8 Add tags field to NetBoxModelForm 2022-03-10 15:08:23 -05:00
jeremystretch
7cffa6ebcc Release v3.2.0-beta2 2022-03-09 12:56:20 -05:00
Alex Gittings
342f1d31be fix pycodestyle issues 2022-03-09 17:55:45 +00:00
Alex Gittings
b779bbfc9d add contacts to site table 2022-03-09 17:49:02 +00:00
Alex Gittings
ef6576bdd6 merge develop into issue 2022-03-09 17:47:58 +00:00
Alex Gittings
27dab262de add columns for each model table that has contacts 2022-03-09 17:35:25 +00:00
Jeremy Stretch
f559ceeb7f Merge pull request #8833 from netbox-community/8823-api-serializers
Closes #8823: Add plugin support for REST API components
2022-03-09 12:31:01 -05:00
jeremystretch
e36ae4f0f7 Document support for NetBoxModelSerializer, NetBoxModelViewSet 2022-03-09 11:52:14 -05:00
Alex Gittings
412c1df15a acidentally removed NestedContactAssignmentSerializer in previous commit 2022-03-09 16:48:29 +00:00
Alex Gittings
73af3ba095 remove contacts from api endpoints 2022-03-09 16:45:19 +00:00
jeremystretch
bbdeae0ed9 Move CustomFieldModelViewSet functionality into NetBoxModelViewSet 2022-03-09 11:44:55 -05:00
Alex Gittings
21b7564976 Merge branch 'issue_8645' of https://github.com/minitriga/netbox into issue_8645 2022-03-09 16:36:16 +00:00
Alex Gittings
bf22b820bf Fixes #8645; Allow filtering on core models in the UI 2022-03-09 16:35:47 +00:00
jeremystretch
efd5a73a18 Refactor API views 2022-03-09 11:27:42 -05:00
jeremystretch
a11abf87ec Refactor API serializers 2022-03-09 10:59:22 -05:00
thatmattlove
8cd24b1a67 Fixes #8820: correct navbar color in dark mode 2022-03-08 14:28:52 -07:00
jeremystretch
28f7b411ed Revise plugins documentation 2022-03-08 15:44:35 -05:00
jeremystretch
655bc49fad Clean up form select widgets 2022-03-07 15:11:57 -05:00
jeremystretch
18c9ee2f9d Closes #8804: Include module type count on manufacturer view 2022-03-07 13:44:27 -05:00
jeremystretch
07f2cdac58 Fixes #8810: Enable filtering modules by type 2022-03-07 13:40:49 -05:00
jeremystretch
06781beb81 Fixes #8815: Fix display of custom object fields in table columns 2022-03-07 13:30:52 -05:00
jeremystretch
cd29293dd6 Merge v3.1.9 2022-03-07 10:55:30 -05:00
jeremystretch
1fdc7a9163 Merge branch 'master' into develop 2022-03-07 10:49:06 -05:00
Jeremy Stretch
6807db4967 Merge pull request #8818 from netbox-community/fix-tzdata
Add tzdata dependency
2022-03-07 10:48:12 -05:00
jeremystretch
b0ea416d6d Add tzdata dependency 2022-03-07 10:38:05 -05:00
jeremystretch
c515218760 PRVB 2022-03-07 10:07:07 -05:00
Jeremy Stretch
8053ea0a22 Merge pull request #8814 from netbox-community/develop
Release v3.1.9
2022-03-07 09:59:16 -05:00
jeremystretch
a5603c9953 Release v3.1.9 2022-03-07 09:47:31 -05:00
Jeremy Stretch
bffe63a233 Merge pull request #8793 from seros1521/fix_8715
Fixes #8715: eliminates duplicates when used in many-to-many field constraints
2022-03-07 09:27:14 -05:00
jeremystretch
2cfbfe473e Fixes #8807: Correct REST API URL for FHRP group assignments 2022-03-07 09:02:47 -05:00
jeremystretch
3c78c100b5 Fixes #8808: Fix members count under FHRP group list 2022-03-07 09:00:00 -05:00
jeremystretch
2451b0a5b1 Clean up search results layout 2022-03-07 08:50:58 -05:00
Jeremy Stretch
85e9438ff7 Merge pull request #8734 from emersonfelipesp/add_pluginfooter_block
Closes #8733: Add {% block pluginfooter %} to 'base/layout.html' template
2022-03-04 16:07:54 -05:00
jeremystretch
81610ba86e Fixes #8724: Fix exception during device import with invalid device type 2022-03-04 13:45:59 -05:00
jeremystretch
6423b386d2 Closes #8758: Allow empty string substitution when renaming objects in bulk 2022-03-04 13:30:32 -05:00
jeremystretch
5c48d116eb Closes #8664: Show assigned ASNs/sites under list views 2022-03-04 13:20:17 -05:00
seros1521
90257e9dee Fixes #8715: eliminates duplicates when used in many-to-many field constraints
When using permissions that use tags, a user may receive multiple permissions
of the same type if multiple tags are assigned to the device. This causes the
RestrictedQuerySet class to generate a query similar to this:

>>> dcim.models.Device.objects.filter(Q(tags__name='tag1')|Q(tags__name='tag2'))
<ConfigContextModelQuerySet [<Device: device1>, <Device: device1>]>

This query returns the same object twice if both tags are assigned to it. This
is due to the use of the django-taggit library. The library's documentation
describes this behavior as expected and suggests using an explicit distinct()
call in queries to avoid duplicates.

However, the use of DISTINCT in queries has a global side effect -
deduplication of responses, which may or may not be acceptable behavior
(depending on further use). Since it is not known how RestrictedQuerySet will
be used in the rest of the code, it was decided to dedupe using a subquery.
2022-03-04 14:37:05 +07:00
jeremystretch
a740203444 Fixes #8792: Fix creation of circuit terminations via UI 2022-03-03 16:42:48 -05:00
jeremystretch
25dc9cc14a Fixes #7891: Fix display of form validation failures during device component creation 2022-03-03 16:18:24 -05:00
jeremystretch
d4d2af46ac Refactor tables modules 2022-03-03 15:16:23 -05:00
jeremystretch
64acfc3187 #8787: Fix toggling of PK table column 2022-03-03 14:09:32 -05:00
jeremystretch
62a1d4b3e0 Fixes #8763: Fix inventory item component assignment 2022-03-03 11:52:36 -05:00
jeremystretch
e6072a51f8 Closes #8765: Display and enable bulk clearing of user's table preferences 2022-03-03 10:03:43 -05:00
jeremystretch
21e3159711 Hide table checkboxes when no bulk actions are enabled 2022-03-02 16:13:59 -05:00
jeremystretch
dadd8cb93a Support the direct use of TagFilter 2022-03-02 12:06:07 -05:00
jeremystretch
5f8af6ad66 Closes #8779: Enable the use of ChoiceSet by plugins 2022-03-02 11:43:28 -05:00
Jeremy Stretch
3436905744 Merge pull request #8771 from jasonyates/8770-documentation
Updating mkdocs to automatically adjust theme
2022-03-02 08:38:04 -05:00
Jason Yates
e3258bcf5a Updating mkdocs to automatically adjust theme
Automatically adjusts documentation theme between default/slate based on users preference for dark mode.
2022-03-02 08:45:22 +00:00
jeremystretch
2b6e0405a5 Closes #8736: Add PC and UPC fiber end faces for LC/SC/LSH port types 2022-03-01 11:43:00 -05:00
jeremystretch
7f752d9102 Closes #8762: Link to rack elevations list from site view 2022-03-01 11:32:17 -05:00
jeremystretch
df430394b0 Closes #8766: Add SCTP to service protocols list 2022-03-01 11:07:19 -05:00
Jeremy Stretch
638d89e73b Merge pull request #8767 from peteeckel/fix/plugin-api-endpoint
Correct the endpoint for plugin API view names
2022-03-01 10:11:49 -05:00
jeremystretch
1ab51ca04e Announce 2022 community survey 2022-03-01 09:29:58 -05:00
jeremystretch
cb0386779c Announce 2022 community survey 2022-03-01 09:17:24 -05:00
Peter Eckel
4dc428d75b Closes #8764: Correct the endpoint for plugin API view names 2022-03-01 13:11:49 +01:00
jeremystretch
e7496c8840 Use get_viewname() to resolve view name under ObjectDeleteView 2022-02-28 15:20:41 -05:00
jeremystretch
d6c272cfd6 Fixes #8764: Correct view name resolution for dynamic form fields 2022-02-28 15:17:49 -05:00
jeremystretch
da6ed8ea11 Fixes #8761: Correct view name resolution under journal entry views 2022-02-28 12:10:22 -05:00
Emerson Pereira
28de330b50 Replace 'pluginfooter' block with 'footer' and 'footer_links' blocks
- 'footer' blocks represents the <footer> html tag
- 'footer_links' are the anchor tags inside nav
2022-02-26 01:13:11 -03:00
jeremystretch
7823fa05ef Fix changelog table column ordering 2022-02-25 14:19:50 -05:00
jeremystretch
fab4d95156 Merge branch 'develop' into feature 2022-02-25 14:06:45 -05:00
jeremystretch
06cb7f35f1 Update changelog 2022-02-25 13:26:02 -05:00
thatmattlove
796c5d785e Fix navbar-toggler-icon visibility in dark mode 2022-02-25 11:23:14 -07:00
thatmattlove
c88db77814 Fixes #8633: Recheck sidenav state on window resize
* Recheck sidenav state on window resize
* Remove `data-sidenav-pinned` attribute when hiding sidenav
* Remove `data-sidenav-hidden` attribute when showing sidenav
2022-02-25 11:23:14 -07:00
Jeremy Stretch
6fe0f4cd7d Merge pull request #8741 from djothi/develop
Closes #8594: Add description filter for all models with a description field
2022-02-25 13:18:40 -05:00
Jeremy Stretch
3bf90c3c38 Merge pull request #8735 from minitriga/issue_8629
Add description to tag table search function
2022-02-25 13:13:14 -05:00
Matt Love
992f3535b7 Merge pull request #8722 from stephanblanke/develop
Generalize scopeSelector js to allow easy reuse of existing layout configurations
2022-02-25 10:55:18 -07:00
Djothi Carpentier
06eacb5a5c Add description filter to WirelessLAN & WirelessLink 2022-02-25 18:15:33 +01:00
Djothi Carpentier
c0152ce52f Add description filter to VMInterface 2022-02-25 18:15:33 +01:00
Djothi Carpentier
5a60224d77 Add description filter for Token & ObjectPermission 2022-02-25 18:15:33 +01:00
Djothi Carpentier
c137fa2022 Add description filter for Tenant & ContactRole 2022-02-25 18:15:33 +01:00
Djothi Carpentier
879d01a750 Add description filter for VRF, RouteTarget, Aggregate, ASN, Role, Prefix, IPRange, VLAN & Service 2022-02-25 18:15:33 +01:00
Djothi Carpentier
6db878743c Add description filter for CustomField, ExportTemplate & Tag 2022-02-25 18:15:33 +01:00
Djothi Carpentier
08b90090f5 Add description filter for Site, RackRole, RackReservation & DeviceRole 2022-02-25 18:15:33 +01:00
Djothi Carpentier
42466d5fc4 Add description filter for ProviderNetwork, CircuitType, Circuit & CircuitTermination 2022-02-25 18:15:22 +01:00
Daniel Estévez
a3f172fc77 Conflicting documentation on remote default group
In the current documentation we have two seemingly conflicting sentences:
* REMOTE_AUTH_DEFAULT_GROUPS: (Requires REMOTE_AUTH_ENABLED.)
* REMOTE_AUTH_ENABLED: (REMOTE_AUTH_DEFAULT_GROUPS will not function if REMOTE_AUTH_ENABLED is enabled)
2022-02-25 11:30:13 -05:00
jeremystretch
0953bba0a3 Closes #8747: Rename ObjectListView action_buttons to actions 2022-02-24 16:33:51 -05:00
Alex Gittings
36d6dd1ca9 Fixes #8645; Allow filtering on core models in the UI and API for contact assignments 2022-02-24 17:08:38 +00:00
Alex Gittings
4863591bc8 Fixes #8629; Add description to tag table search function 2022-02-24 10:02:21 +00:00
Emerson Pereira
c489501441 Add {% block pluginfooter %} to 'base/layout.html' template
Makes it easy to insert footer information into Netbox footer.
2022-02-24 00:38:11 -03:00
jeremystretch
6638f560f8 Fixes #8683: Fix ZoneInfoNotFoundError exception under Python 3.9+ 2022-02-23 14:16:12 -05:00
jeremystretch
a2fe23549b Closes #8667: Support position patterning when creating module bays & templates 2022-02-23 13:02:14 -05:00
Stephan Blanke
1a7438acfd Fixed code comments 2022-02-22 23:32:34 +01:00
Stephan Blanke
b1de85a44f Fixes #8710: Show/hide form elements based on scope selection 2022-02-22 23:27:11 +01:00
jeremystretch
6604ebfd01 Fix tag background color 2022-02-22 13:10:04 -05:00
jeremystretch
7872460162 Fixes #8682: Limit available VLANs by group min/max VIDs 2022-02-22 11:39:05 -05:00
jeremystretch
d9696ae34c Fixes #8714: Remove label from comments form field 2022-02-22 10:47:02 -05:00
jeremystretch
7c937bf8b8 Fixes #8692: Restore misisng tabs under cluster, VM views 2022-02-22 09:35:21 -05:00
jeremystretch
4913d7ee39 Fixes #8713: Restore missing "add" button on services list view 2022-02-22 09:05:31 -05:00
jeremystretch
2503a3e3ca Fixes #8717: Fix redirection after bulk edit/delete of prefixes from aggregate view 2022-02-22 09:02:31 -05:00
Johannes Erwerle
538984c6d2 Fixes 8553: Fix Provider network, ASN, and contact options missings from global search selector 2022-02-21 12:26:12 +01:00
jeremystretch
5f92ed492b Update development docs 2022-02-18 15:35:08 -05:00
jeremystretch
bca0978434 Clean up component template creation for ModuleTypes 2022-02-18 11:56:49 -05:00
jeremystretch
e1f06ec862 Enable adding inventory items to components from device component list views 2022-02-18 10:09:51 -05:00
jeremystretch
a5c8bbf79e Closes #8684: Change custom link template context variable 'obj' to 'object' (backward-compatible) 2022-02-18 09:50:02 -05:00
jeremystretch
e8df373abf Change results tab name for clarity 2022-02-18 09:28:34 -05:00
jeremystretch
39b8eb0ae0 Fixes #8656: Fix migration error when upgrading from a v2.11 database 2022-02-17 14:14:23 -05:00
jeremystretch
eb02f6137e Fixes #8670: Fix filtering device components by installed module 2022-02-17 11:42:18 -05:00
jeremystretch
90ee689d5a Closes #8678: Validate minimum required Python version 2022-02-17 10:31:28 -05:00
jeremystretch
90558a2e80 Fixes #8671: Fix AttributeError when viewing console/power/interface connection lists 2022-02-16 16:45:56 -05:00
jeremystretch
b343035060 Fixes #8674: Fix rendering of tabbed content in documentation 2022-02-16 16:21:32 -05:00
jeremystretch
bcdd006dd5 Fixes #8661: Fix ValueError exception when trying to connect a cable 2022-02-16 09:27:16 -05:00
jeremystretch
92c4e5bfaf Fixes #8659: Fix display of multi-object custom fields after deleting related object 2022-02-16 09:07:01 -05:00
jeremystretch
fdbdf26afc Fixes #8655: Fix AttributeError when viewing cabled interfaces 2022-02-16 08:23:57 -05:00
jeremystretch
1aa295dc84 Release v3.2-beta1 2022-02-15 14:56:01 -05:00
Jeremy Stretch
85b534a0b0 Merge pull request #8650 from netbox-community/8649-config-module
Closes #8649: Enable customization of configuration module
2022-02-15 13:11:50 -05:00
jeremystretch
e728738e34 Closes #8649: Enable customization of configuration module using NETBOX_CONFIGURATION environment variable 2022-02-15 12:36:03 -05:00
Daniel Sheppard
6bbf168cec Fixes #8546 - Fix import to restrict bridge, parent, lag to device interfaces 2022-02-15 09:27:55 -06:00
jeremystretch
aa85ae89c1 Merge v3.1.8 2022-02-15 10:05:07 -05:00
jeremystretch
b5e4fdc3d8 PRVB 2022-02-15 09:32:52 -05:00
Jeremy Stretch
90f91eeea4 Merge pull request #8640 from netbox-community/develop
Release v3.1.8
2022-02-15 09:31:00 -05:00
jeremystretch
ae0ae5fd4e Remove outdated installation video 2022-02-15 09:20:19 -05:00
jeremystretch
5b7486cff8 Release v3.1.8 2022-02-15 09:01:58 -05:00
jeremystretch
14240318f1 Fixes #8609: Display validation error when attempting to assign VLANs to interface with no mode during bulk edit 2022-02-15 08:39:45 -05:00
jeremystretch
18eb9ffae6 Changelog for #8391 2022-02-14 10:34:30 -05:00
Jeremy Stretch
c0a62793c4 Merge pull request #8441 from seulsale/8391-install-date-null
Fixes #8391: Install date should appear empty when exported
2022-02-14 10:32:56 -05:00
jeremystretch
dd848d754f Changelog & cleanup for #8556 2022-02-14 10:06:56 -05:00
Jeremy Stretch
f058850598 Merge pull request #8581 from mathieu-mp/8556-add-full-name-to-change-log-tables
Closes #8556: Add 'Full Name' column to Change Log table
2022-02-14 09:49:36 -05:00
Jeremy Stretch
0c7220016b Merge pull request #8621 from JonathonReinhart/nbshell-tab-complete
Enable tab completion in nbshell
2022-02-14 09:27:35 -05:00
jeremystretch
8c19124717 Fixes #8622: Correct help text of status field on VM import form 2022-02-14 08:54:36 -05:00
Mathieu PAYROL
46f4359e1f Closes #8556: Add 'Full Name' column to Change Log table 2022-02-14 09:07:57 +01:00
Sergio Saucedo
f80452c7d9 Update import order 2022-02-14 00:47:48 -06:00
Sergio Saucedo
611f1b57dd Implement custom DateTimeColumn improving null values handling 2022-02-14 00:44:50 -06:00
Jonathon Reinhart
d1b1a45725 Enable tab completion in nbshell 2022-02-13 03:00:57 -05:00
jeremystretch
6e38f7e532 Changelog for #8577 2022-02-11 16:00:01 -05:00
Jeremy Stretch
2c1e681984 Merge pull request #8584 from 991jo/assigned_contacts_fix
Fixes #8577: Contact assignment amounts not shown during contact glob…
2022-02-11 15:49:02 -05:00
jeremystretch
f11ad99983 Fixes #8611: Fix bulk editing for certain custom link, webhook, and journal entry fields 2022-02-11 15:34:41 -05:00
jeremystretch
e1ef911d40 #8564: Fix deepmerge logic to allow nullifying dicts 2022-02-11 15:22:50 -05:00
jeremystretch
b40afd1006 Create custom RTD configuration 2022-02-11 14:49:45 -05:00
jeremystretch
af01122f33 Fix mkdocs requirements specification 2022-02-11 14:43:43 -05:00
jeremystretch
189e835499 Use project requirements to build docs 2022-02-11 14:36:03 -05:00
jeremystretch
1319b62acb Standardize on get_FOO_color() method for returning ChoiceField colors 2022-02-11 14:25:13 -05:00
jeremystretch
9cf9f1bdba Update documentation for v3.2 2022-02-11 12:57:08 -05:00
jeremystretch
0bf1789464 Fix template context for API token views 2022-02-11 12:28:49 -05:00
jeremystretch
fe6acf07a5 Fix component column on InventoryItemTemplateTable 2022-02-11 12:26:26 -05:00
jeremystretch
8e888b4435 Use ColoredLabelColumn for InventoryItem role 2022-02-11 12:08:16 -05:00
jeremystretch
47e99ecb54 Use ContentTypeChoiceField for object_type 2022-02-11 11:33:16 -05:00
jeremystretch
3b80f67e4d #7844: Show module when viewing/editing device components 2022-02-11 11:09:07 -05:00
jeremystretch
71d3dc6e44 Improve ChoiceFieldColumn to not rely on model method to derive label color 2022-02-10 16:29:19 -05:00
jeremystretch
f111380674 Disable I10N to restore pre-4.0 datetime formatting 2022-02-10 15:30:29 -05:00
jeremystretch
d52105b3b8 Merge branch 'develop' into feature 2022-02-10 15:05:54 -05:00
jeremystretch
a4ca585ef2 Remove references to the old mailing list 2022-02-10 14:56:21 -05:00
jeremystretch
076461a1b6 Change notes for #7150, #8398 2022-02-10 14:22:40 -05:00
Jeremy Stretch
0c7407ebb6 Merge pull request #8592 from 991jo/fix_rack_svg_url
Fixes #7150: Devices on the elevations opposite side should be clickable
2022-02-10 14:21:01 -05:00
Jeremy Stretch
f13a3fa549 Merge pull request #8589 from ITJamie/patch-1
small documentation upgrade regarding group syncs
2022-02-10 14:11:12 -05:00
Markku Leiniö
c0a65eb593 Fixes #8398: Add ConfigParam.size to enlarge specific config fields (#8565)
* Fixes #8398: Add ConfigParam.size to enlarge specific config fields

* Revert "Fixes #8398: Add ConfigParam.size to enlarge specific config fields"

This reverts commit 05e8fff458.

* Use forms.Textarea for the banner config fields
2022-02-10 12:15:02 -05:00
jeremystretch
450a7730d3 Fixes #8578: Object change log tables should honor user's configured preferences 2022-02-10 12:07:09 -05:00
jeremystretch
41ee4b642f Fixes #8604: Fix tag filter on config context list filter form 2022-02-10 11:56:41 -05:00
jeremystretch
d42c59792f #8334: Move object changelog & journaling to generic views 2022-02-09 16:24:10 -05:00
jeremystretch
7c105019d8 Closes #8600: Document built-in template tags & filters 2022-02-09 16:01:58 -05:00
jeremystretch
ee566723d7 Document supported table columns 2022-02-09 14:31:40 -05:00
jeremystretch
23a80770e1 Move configure_table() logic to NetBoxTable.configure() 2022-02-09 14:10:54 -05:00
jeremystretch
10e6ae2094 Introduce get_viewname() as a standard utility 2022-02-09 13:47:12 -05:00
jeremystretch
e2286a4c48 Fix plugin name resolution 2022-02-09 12:55:10 -05:00
thatmattlove
3ee3c52e14 Improve CI performance 2022-02-09 10:26:09 -07:00
Johannes Erwerle
e76a5bfd85 Fixes #7150: Devices on the elevations opposite side should be clickable 2022-02-09 15:07:36 +01:00
Jamie (Bear) Murphy
59c89a3b9d small documentation upgrade regarding group syncs
small documentation upgrade regarding group syncs
2022-02-09 13:05:51 +00:00
jeremystretch
272d6e7437 Closes #8463: Change the created field on all change-logged models from date to datetime 2022-02-08 14:41:44 -05:00
Jeremy Stretch
45e5c4eb46 Merge pull request #8586 from netbox-community/template-cleanup
Closes #8585: Support generic templates for plugins
2022-02-08 13:22:44 -05:00
jeremystretch
d9b7c012a6 Document templates supported for plugin use 2022-02-08 12:14:37 -05:00
jeremystretch
270288f730 Rename bulk operation templates 2022-02-08 11:49:18 -05:00
jeremystretch
1e55d064ab Document the base layout template 2022-02-08 11:45:23 -05:00
jeremystretch
e796fd1e11 Clean up and document the bulk import/edit/delete templates 2022-02-08 11:23:52 -05:00
jeremystretch
b0039e938e Clean up and document object edit & delete templates 2022-02-08 11:19:33 -05:00
Sergio Saucedo
8fc605037a Implement custom DateColumn improving null values handling 2022-02-08 01:26:26 -06:00
Johannes Erwerle
311ddf82c5 Fixes #8577: Contact assignment amounts not shown during contact global search 2022-02-08 08:03:48 +01:00
thatmattlove
9d65486c64 Fixes #8564: reset the table config to an empty object when reset is clicked 2022-02-07 16:03:09 -07:00
jeremystretch
624eda297f Clean up and document object, object list templates 2022-02-07 16:50:17 -05:00
thatmattlove
ccce7751a0 Fixes #8564: only use columns form field in user table config form submit 2022-02-07 14:36:28 -07:00
thatmattlove
7252f0b490 Add optional selector to getSelectedOptions for more specific field selection 2022-02-07 14:34:35 -07:00
thatmattlove
094d2e586a Fix code formatting 2022-02-07 14:14:43 -07:00
thatmattlove
6c1507c88c Implement replaceAll utility function
add #8331 release notes
2022-02-07 14:04:58 -07:00
mathieu-mp
60f48326e1 #8331 Maximize browser compatibility 2022-02-07 14:04:49 -07:00
jeremystretch
26db326483 Fix field group header 2022-02-07 15:09:09 -05:00
jeremystretch
d816f797a4 Clean up release notes 2022-02-07 14:31:49 -05:00
Jeremy Stretch
0e827b6ae6 Merge pull request #8562 from netbox-community/8405-plugins-graphql
Closes #8405: GraphQL support for plugins
2022-02-07 13:08:32 -05:00
jeremystretch
049acde5b0 Closes #8572: Add a pre_run() method for reports 2022-02-07 12:57:02 -05:00
Jeremy Stretch
733a9bb2e1 Merge pull request #8510 from netbox-community/8032-django-40
Closes #8032: Upgrade to Django 4.0
2022-02-07 11:47:38 -05:00
jeremystretch
9ac769e4f8 Pull graphene-django from v2 branch 2022-02-07 11:32:02 -05:00
jeremystretch
2157f93f36 Clean up merge conflict remnants 2022-02-07 10:47:07 -05:00
jeremystretch
5b985a924b Changelog for #8548 & misc cleanup 2022-02-07 10:37:11 -05:00
Jeremy Stretch
ee74989f74 Merge pull request #8566 from tijshuisman/develop
Fixes #8548: Virtual Chassis position zero not shown in device page
2022-02-07 10:32:44 -05:00
jeremystretch
3651ef53e3 #7852: Extend VRF assignment to VM interfaces 2022-02-07 09:54:00 -05:00
Tijs Huisman
e2fc7e8cd7 Fixes #8548: Virtual Chassis position zero not shown in device page 2022-02-05 15:10:03 +01:00
jeremystretch
aff55881df Changelog for #8561 2022-02-04 16:22:30 -05:00
Jeremy Stretch
4d066a075d Merge pull request #8563 from jasonyates/8561-rear-console
Fixes #8561 - Unable to connect a cable from rear ports of a patch panel to a device console port
2022-02-04 16:17:07 -05:00
Jason Yates
201077b6f6 Fixes #8561 - Unable to connect a cable from rear ports of a patch panel to a device console port 2022-02-04 20:44:43 +00:00
jeremystretch
dae5c94be0 Expose BaseObjectType and NetBoxObjectType for plugins 2022-02-04 15:07:35 -05:00
jeremystretch
03ea257711 Initial work on GraphQL 2022-02-04 15:06:58 -05:00
jeremystretch
df95115e2e Refactor plugins registry 2022-02-04 14:37:29 -05:00
jeremystretch
5fea012eab Fix GitHub templates 2022-02-04 13:57:30 -05:00
jeremystretch
a2981870ce #7844: Allow installing modules via UI without replicating components 2022-02-04 11:51:30 -05:00
jeremystretch
60e87cd496 Enable the use of fieldsets on bulk edit forms 2022-02-04 09:59:53 -05:00
jeremystretch
ac1c0b0715 #8054: Allow replacing default static choices 2022-02-03 13:52:42 -05:00
jeremystretch
6575af6b93 Fix saving interfaces 2022-02-03 13:25:27 -05:00
jeremystretch
0e95ca7b69 Fix ProgrammingError exception when annotating config context data 2022-02-03 12:58:54 -05:00
jeremystretch
630ff2abb4 Remove dependency on is_safe_url() 2022-02-03 12:58:54 -05:00
jeremystretch
7611cfddae Tweak related names in old migrations to avoid creating new ones 2022-02-03 12:58:54 -05:00
jeremystretch
ef75f7e650 Upgrade to Django 4.0 2022-02-03 12:58:54 -05:00
jeremystretch
478eefb74c Merge v3.1.7 2022-02-03 12:55:34 -05:00
jeremystretch
795134c084 PRVB 2022-02-03 11:34:36 -05:00
Jeremy Stretch
4f689223b4 Merge pull request #8540 from netbox-community/develop
Release v3.1.7
2022-02-03 11:31:48 -05:00
jeremystretch
70ce7293ac Release v3.1.7 2022-02-03 10:51:41 -05:00
jeremystretch
94a0a3b568 Closes #8502: Omit [all] from social-auth-core in base requirements 2022-02-03 10:39:39 -05:00
jeremystretch
69305f0509 Fixes #8315: Fix display of NAT link for primary IPv4 address under device view 2022-02-03 10:30:26 -05:00
jeremystretch
24f48b11e6 Closes #8530: Indicate CSV or YAML as format for "all data" export 2022-02-03 10:22:38 -05:00
jeremystretch
ff3b48fa59 Fixes #8527: Fix display of changelog retention period 2022-02-03 09:48:21 -05:00
jeremystretch
db3f478598 Closes #8517: Render boolean custom fields as icons in object tables 2022-02-02 16:24:51 -05:00
jeremystretch
e20ac803f3 Fixes #8498: Fix display of selected content type filters in object list views 2022-02-02 16:08:12 -05:00
Daniel Sheppard
ea283365e7 Fixes #8425 - Fix exception when viewing change list/records with removed plugins 2022-02-02 11:18:41 -06:00
jeremystretch
8211830bd8 Fixes #8514: Correct several links to config parameters 2022-02-02 09:27:29 -05:00
jeremystretch
2a8e0f9404 Update table accessors to use dunders in path 2022-02-02 09:18:50 -05:00
jeremystretch
c15cfc26f1 Fixes #8512: Correct file permissions to allow execution of housekeeping script 2022-02-01 16:58:09 -05:00
jeremystretch
4f4e6938eb Closes #7504: Include IP range data under IPAM role views 2022-02-01 16:47:29 -05:00
jeremystretch
8545a547b9 Closes #8494: Include locations count under tenant view 2022-02-01 16:31:34 -05:00
jeremystretch
3bb7184f28 Fixes #8499: Content types REST API endpoint should not require model permission 2022-02-01 15:14:13 -05:00
jeremystretch
74c4f12b27 Closes #8509: CSRF_TRUSTED_ORIGINS is now a discrete configuration parameter 2022-02-01 14:29:52 -05:00
jeremystretch
5af18c2d8a Move pk field declaration under NetBoxModelBulkEditForm 2022-02-01 11:40:23 -05:00
jeremystretch
d38620bad2 Fix bulk nullification of custom fields 2022-02-01 11:31:11 -05:00
jeremystretch
3621b1a0d0 Set model as attribute on bulk edit forms 2022-02-01 11:00:18 -05:00
Jeremy Stretch
4347f624d8 Merge pull request #8504 from netbox-community/8488-plugins-forms
Closes #8488: Support form components for plugins
2022-01-31 16:46:33 -05:00
jeremystretch
bfb1a82754 Update docstrings for base form classes 2022-01-31 16:23:23 -05:00
jeremystretch
d1672f8818 Move nullable_fields out of Meta for bulk edit forms 2022-01-31 16:15:40 -05:00
jeremystretch
353e132cf9 Replace filter_groups with fieldsets on filter forms 2022-01-31 16:03:26 -05:00
jeremystretch
ccb3a75281 Move fieldsets out of Meta for model forms 2022-01-31 15:52:36 -05:00
jeremystretch
cf3ca5a661 Refactor & document supported form fields 2022-01-31 14:10:13 -05:00
jeremystretch
e4eee1cdfc Clean up nullable fields declaration for bulk edit forms 2022-01-28 16:47:54 -05:00
jeremystretch
f4776731ec Establish 4 core forms in netbox.forms.base 2022-01-28 15:48:15 -05:00
Jeremy Stretch
dd71942a5e Merge pull request #8489 from 991jo/fix-unittest-docs
Fixes #8477: The commands for running the tests in the development se…
2022-01-28 14:19:57 -05:00
jeremystretch
19fdd5e151 Fixes #8465: Accept empty string values for Interface rf_channel in REST API 2022-01-28 14:03:36 -05:00
jeremystretch
f537dc632e Fixes #8456: Fix redundant display of VRF RD in prefix view 2022-01-28 13:19:23 -05:00
jeremystretch
2221006970 Closes #8462: Linkify manufacturer column in device type table 2022-01-28 13:09:57 -05:00
Johannes Erwerle
5d29c5958b Fixes #8477: The commands for running the tests in the development section are not working 2022-01-28 17:54:37 +01:00
jeremystretch
0fe72376b1 Remove unused form attribute from BulkDeleteView 2022-01-28 10:00:36 -05:00
Jeremy Stretch
64dd46c7e4 Merge pull request #8482 from 991jo/feature-asn-ui-improvement
Fixes #8476: Bring the ASN Web UI up to the standard set by other obj…
2022-01-28 09:37:54 -05:00
Johannes Erwerle
8df382d976 Fixes #8476: Bring the ASN Web UI up to the standard set by other objects 2022-01-28 11:58:29 +01:00
Jeremy Stretch
3a447d5515 Merge pull request #8473 from netbox-community/6221-pluginviews
Closes #8472: Make view name resolution plugin-safe
2022-01-27 16:56:20 -05:00
jeremystretch
75aa1c7b80 Merge feature 2022-01-27 16:38:36 -05:00
jeremystretch
f1697c6856 Add change log for plugins framework additions 2022-01-27 16:21:19 -05:00
jeremystretch
3c1ea5d0fb Closes #8470: Expose NetBoxTable in the plugins framework 2022-01-27 16:14:02 -05:00
jeremystretch
59d3f5c4ea Split out NetBoxTable from BaseTable 2022-01-27 16:00:38 -05:00
jeremystretch
4a1b4e0485 Closes #8469: Move BaseTable, columns to netbox core app 2022-01-27 15:00:10 -05:00
jeremystretch
083d1acb81 Closes #8453: Rename PrimaryModelFilterSet to NetBoxModelFilterSet & expose for plugins 2022-01-27 09:27:33 -05:00
jeremystretch
c5650bb278 Rename PrimaryModel to NetBoxModel 2022-01-26 20:57:14 -05:00
jeremystretch
a795b95f7e Closes #8451: Include ChangeLoggingMixin in BaseModel 2022-01-26 20:41:41 -05:00
jeremystretch
b67859832a Refactor to_objectchange() 2022-01-26 20:25:23 -05:00
jeremystretch
eb00e20269 Revert "Refactor ChangeLoggedModelFilterSet"
This reverts commit 28de9b8913.
2022-01-26 09:03:30 -05:00
jeremystretch
b797b08bcf Remove BigIDModel 2022-01-26 09:02:04 -05:00
jeremystretch
e4abbfb2c6 Closes #8454: Set DEFAULT_AUTO_FIELD to BigAutoField 2022-01-25 17:37:06 -05:00
jeremystretch
28de9b8913 Refactor ChangeLoggedModelFilterSet 2022-01-25 16:18:07 -05:00
jeremystretch
acc9ca7d7d Move TagFilter to PrimaryFilterSet 2022-01-25 16:11:49 -05:00
jeremystretch
497afcc1e4 Rearrange plugins documentation 2022-01-25 13:53:31 -05:00
jeremystretch
571e9801f3 Closes #8195: Ensure all GenericForeignKey ID fields employ PositiveBigIntegerField 2022-01-24 16:02:54 -05:00
Sergio Saucedo
31c58409e1 Set install_date default value as empty string 2022-01-24 02:36:27 -06:00
jeremystretch
5abfe821bc Changelog cnad cleanup for #7853 2022-01-21 15:43:53 -05:00
Jeremy Stretch
05d4c127ee Merge pull request #8428 from netbox-community/8334-plugins-views
Closes #8334: Formally support use of generic views by plugins
2022-01-21 15:37:20 -05:00
jeremystretch
1c94625042 Remove widget_attrs from BulkImportView 2022-01-21 14:48:27 -05:00
jeremystretch
a74ed33b0e Move get_object() to BaseObjectView 2022-01-21 14:41:37 -05:00
jeremystretch
e03593d86f Move get_extra_context() to base views 2022-01-21 14:01:14 -05:00
Jeremy Stretch
3d6c2c5fef Merge pull request #8420 from netbox-community/7853-speed_duplex
Fixes #7853 - Add speed and duplex
2022-01-21 13:07:23 -05:00
jeremystretch
54834c47f8 Refactor generic views; add plugins dev documentation 2022-01-20 16:31:55 -05:00
Daniel Sheppard
d0bfd7e19a #7853 - Add tests 2022-01-20 14:13:13 -06:00
Daniel Sheppard
1a807416b8 #7853 - Add columns to tables 2022-01-20 13:58:37 -06:00
Daniel Sheppard
5f8870d448 #7853 - Change Duplex Filterset to allow multivalues 2022-01-20 13:58:11 -06:00
Daniel Sheppard
375a140343 Merge branch 'feature' of https://github.com/netbox-community/netbox into 7853-speed_duplex 2022-01-20 13:12:04 -06:00
Jeremy Stretch
7002319cc8 Merge pull request #8414 from netbox-community/8392-plugins-features
Closes #8392: Enable NetBox features for plugin models
2022-01-20 12:23:52 -05:00
jeremystretch
e6acae5f94 Omit job results as a supported feature 2022-01-20 11:41:00 -05:00
jeremystretch
1a8f144f5c Include custom validation in BaseModel 2022-01-20 10:53:00 -05:00
jeremystretch
b7682ca9e8 Fix documentation build 2022-01-20 09:27:37 -05:00
jeremystretch
196784474d Update documentation requirements 2022-01-19 16:58:06 -05:00
jeremystretch
d104544d6f Add mkdocstrings 2022-01-19 16:52:00 -05:00
jeremystretch
dd55226455 Draft documentation for model features 2022-01-19 16:47:41 -05:00
jeremystretch
047bed2a86 Tweak registry initialization 2022-01-19 15:22:28 -05:00
jeremystretch
cdae0c2bef Remove extras_features() decorator 2022-01-19 15:16:10 -05:00
jeremystretch
c7825e391c Designate feature mixin classes & employ class_prepared signal to register features 2022-01-19 14:46:50 -05:00
jeremystretch
bf6345aa90 Closes #5429: Enable toggling the placement of table paginators 2022-01-19 09:14:38 -05:00
jeremystretch
3fcae36cf1 Closes #8307: Add data_type indicator to REST API serializer for custom fields 2022-01-18 16:57:54 -05:00
jeremystretch
69eb6b11d0 Closes #8368: Enable controlling the order of custom script form fields with field_order 2022-01-18 16:01:40 -05:00
jeremystretch
1f2d4fd2b3 Closes #8381: Add contacts to global search function 2022-01-18 15:40:19 -05:00
jeremystretch
21468fff25 Closes #8367: Add ASNs to global search function 2022-01-18 15:36:21 -05:00
jeremystretch
4711b4d529 Correct FeatureQuery invocations 2022-01-18 15:17:05 -05:00
Daniel Sheppard
29d4859e02 Fixes #8375 - Change ASN display column from ASDOT to ASPLAIN. Add ASDOT display column. 2022-01-18 11:23:52 -06:00
jeremystretch
4b81d86311 Closes #8376: Correct example condition defitinions; call out value vs label ealuation for choice fields 2022-01-18 11:31:39 -05:00
jeremystretch
38963e7960 Fixes #8377: Fix calculation of absolute cable lengths when specified in fractional units 2022-01-18 11:09:12 -05:00
jeremystretch
3e3880823b Merge v3.1.6 2022-01-17 11:12:54 -05:00
jeremystretch
1584d51433 PRVB 2022-01-17 10:16:37 -05:00
Jeremy Stretch
98571c62a6 Merge pull request #8372 from netbox-community/develop
Release v3.1.6
2022-01-17 10:15:24 -05:00
jeremystretch
69f525bfd3 Release v3.1.6 2022-01-17 09:49:16 -05:00
jeremystretch
2b31154834 Fixes #8358: Fix inconsistent styling of custom fields on filter & bulk edit forms 2022-01-14 14:23:58 -05:00
jeremystretch
b0948ea018 Changelog for #8342, #8357 2022-01-14 11:51:02 -05:00
Jeremy Stretch
a50e4e3380 Merge pull request #8352 from jasonyates/8342-created-updated
Fixes #8342
2022-01-14 11:48:52 -05:00
Jeremy Stretch
5564664b13 Merge pull request #8360 from jasonyates/8357-location-filter
Fixes #8357 - Filter view for Locations is missing tags field
2022-01-14 11:48:36 -05:00
Jason Yates
1ae5a2c808 Fixes #8357 - Filter view for Locations is missing tags field
Adding tag field to Locations filter view
2022-01-14 06:19:25 -08:00
Jason Yates
0181a25d70 Fixes #8342
created & last_updated fields are missing from some REST API calls. Added missing fields to the following API calls

/api/dcim/virtual-chassis/
/api/dcim/cables/
/api/dcim/power-panels/
/api/dcim/rack-reservations/
/api/circuits/circuit-terminations/
/api/extras/webhooks/
/api/extras/custom-fields/
/api/extras/custom-links/
/api/extras/export-templates/
/api/extras/tags/
2022-01-13 19:13:28 -08:00
jeremystretch
60ba4a9830 Changelog for #8337 2022-01-13 15:24:15 -05:00
Jeremy Stretch
3802a78c9d Merge pull request #8341 from jasonyates/8337-created-updated
Add created & last updated as available fields to all tables
2022-01-13 15:23:12 -05:00
jeremystretch
0ca6d73614 #8293: Tweak table column output & add changelog 2022-01-13 15:10:06 -05:00
Jeremy Stretch
aa77f8f0d2 Merge pull request #8329 from jasonyates/8293-asdot
Adding asdot notation to ASN views
2022-01-13 15:02:21 -05:00
jeremystretch
7767692394 Changelog for #8295 2022-01-13 12:10:25 -05:00
Jeremy Stretch
5077ff169e Merge pull request #8343 from netbox-community/1591-service-templates
Closes #1591: Service templates
2022-01-13 12:09:36 -05:00
jeremystretch
b21b6238cf Fix test permissions 2022-01-13 11:52:06 -05:00
Jeremy Stretch
cf89984c7a Merge pull request #8339 from rodvand/feature
Fixes: #8295 Render the payload_url of a Webhook with Jinja2
2022-01-13 11:36:56 -05:00
jeremystretch
707aad234e Add view test for creating service from template 2022-01-13 11:27:29 -05:00
jeremystretch
5b851a2d09 Changelog for #1591 2022-01-13 10:48:08 -05:00
jeremystretch
bb5ded2039 Enable creating services from templates in the UI 2022-01-13 10:32:42 -05:00
Jason Yates
381796e708 Add created & last updated as available fields to all tables
Adds two fields to all relevant tables to allow the addition of Created & Last Updated columns.

All tables with a Configure Table option were updated.

Some sections reformatted to comply with E501 line length as a result of changes
2022-01-13 09:22:32 +00:00
Jason Yates
62fc7717c8 Suggested changes
* Updating asdot computation to use an fstring
* Cleaning code. Custom property now returns either the ASN with ASDOT notation or just the ASN. asn_with_asdot can now be referenced in ASNTable & objet template.
2022-01-13 04:58:51 +00:00
jeremystretch
b07a7ba9bc Fix display of custom object fields within tables 2022-01-12 17:07:54 -05:00
jeremystretch
97e7ef9a3f Introduce ServiceTemplate 2022-01-12 16:42:28 -05:00
Martin Rødvand
5cbc978cad Render the payload_url of the Webhook with Jinja2
- Update markdown documentation
- Expand on the help text for the Webhook model
2022-01-12 21:58:19 +01:00
jeremystretch
e19451bb4f Plug WG8333 in the plugins development docs 2022-01-12 14:40:33 -05:00
Jason Yates
85f588e8c9 Updating page title to include asdot notation 2022-01-12 16:44:22 +00:00
Jason Yates
ea644868a6 Adding asdot notation to ASN views
Adds custom property to asn model to compute asdot notation if required.
Updates asn view to show asdot notation if one exists in the format xxxxx (yyy.yyy)
Adds a custom column renderer to asn table to display asdot notation if one exists
2022-01-12 14:06:22 +00:00
jeremystretch
d08accaaf1 Changelog for #8279 2022-01-11 16:27:30 -05:00
Jeremy Stretch
f49272cacb Merge pull request #8321 from jasonyates/8279-vc-rack-view
Fixes #8279 - No virtual chassis name in rack view
2022-01-11 16:25:50 -05:00
jeremystretch
c8713d94d8 Merge branch 'develop' into feature 2022-01-11 16:16:13 -05:00
Jason Yates
be8fef0228 Fixes #8279
A device that is part of a VC that has no name should display [virtual-chassis name]:[virtual-chassis position] as opposed to [device_type] in the rack rendering.
2022-01-11 21:03:18 +00:00
jeremystretch
b584f09223 Fixes #8319: Custom URL fields should honor ALLOWED_URL_SCHEMES config parameter 2022-01-11 15:32:04 -05:00
jeremystretch
d2968c95df Fixes #8314: Prevent custom fields with default values from appearing as applied filters erroneously 2022-01-11 15:02:10 -05:00
jeremystretch
7421e5f7d7 Fixes #8317: Fix CSV import of multi-select custom field values 2022-01-11 14:52:47 -05:00
jeremystretch
0b2a43cfcc Document formal release cycle 2022-01-11 12:54:07 -05:00
jeremystretch
50309d3ab3 Reference netbox-demo-data repo in development guide 2022-01-10 15:34:27 -05:00
jeremystretch
dd0b16bff5 Fixes #8305: Fix assignment of custom field data to FHRP groups via UI 2022-01-10 15:26:01 -05:00
jeremystretch
d5443adc74 Tweak sidebar colors & remove hover delay 2022-01-10 15:13:12 -05:00
jeremystretch
9152ba72f1 Fixes #8306: Redirect user to previous page after login 2022-01-10 14:44:25 -05:00
jeremystretch
ff396b5953 Fix CSV import test & form cleanup 2022-01-10 14:27:52 -05:00
jeremystretch
21e0e6e495 Closes #6954: Remember users' table ordering preferences 2022-01-10 14:03:07 -05:00
jeremystretch
72e17914e2 Closes #8296: Allow disabling custom links 2022-01-10 12:11:37 -05:00
Jeremy Stretch
17aa37ae21 Merge pull request #8303 from netbox-community/7679-table-actions
Closes #7679: Object table actions menus
2022-01-10 11:38:07 -05:00
jeremystretch
94c116617a Changelog for #7679 2022-01-10 11:20:06 -05:00
jeremystretch
aed23d61fc Replace ButtonsColumn with ActionsColumn 2022-01-10 11:17:40 -05:00
jeremystretch
076ca46ab4 Closes #8302: Linkify role column in device & VM tables 2022-01-10 09:48:14 -05:00
jeremystretch
02519b270e Fixes #8301: Fix delete button for various object children views 2022-01-10 09:30:50 -05:00
jeremystretch
5aa7dedccb Changelog for #8246, #8285 2022-01-10 08:38:08 -05:00
Jeremy Stretch
6383dfa854 Merge pull request #8292 from jasonyates/8246-commit-rate
Fixes #8246 - Circuits list view to display formatted commit rate
2022-01-10 08:36:47 -05:00
Jeremy Stretch
5a4fb0323b Merge pull request #8286 from jasonyates/8285-cluster-count-tenant
Fixes #8285 tenant cluster count
2022-01-10 08:34:02 -05:00
jeremystretch
e84a282aa6 Revert REST API changes from #8284 2022-01-10 08:24:45 -05:00
Jason Yates
f732493473 Fixing code style E302 2022-01-08 22:24:25 +00:00
Jason Yates
f66a265fcf Fixes #8246 - Circuits list view to display formatted commit rate
Adds a custom column class to format the commit rate in the circuits table view using humanize_speed template helper. Export still exports the raw number.
2022-01-08 21:55:07 +00:00
Daniel Sheppard
0f58faaddb #7853 - Initial work on Speed/Duplex.
TODO: Documentation, Tests, Form order
2022-01-08 12:25:30 -06:00
Daniel Sheppard
f1472d218e Update changelog for #8262 and #8265 2022-01-08 00:21:38 -06:00
Daniel Sheppard
d65c05aacd Merge pull request #8269 from bluikko/cisco-stackwise-n
Merge PR from bluikko for #8265
2022-01-08 00:20:43 -06:00
Daniel Sheppard
2b28ffa2f4 Merge pull request #8284 from jasonyates/8262-tenant-cable-stat
Fixes #8262 - Add Cable stat for Tenant
2022-01-08 00:15:35 -06:00
Daniel Sheppard
10ec31df3e Fix #8287 - Correct label in export template form 2022-01-08 00:13:58 -06:00
Jason Yates
184b1055dc Fixes #8285 - Cluster count missing from tenant api output 2022-01-07 20:17:43 +00:00
Jeremy Stretch
447a5f01a9 Merge pull request #8282 from netbox-community/7852-interface-vrf
Closes #7852: Interface VRF assignment
2022-01-07 15:16:11 -05:00
Jason Yates
eaec25e6c2 Fixes #8262 - Add Cable stat for Tenant 2022-01-07 20:02:45 +00:00
jeremystretch
3e277de82d Closes #7852: Enable assigning interfaces to VRFs 2022-01-07 14:57:43 -05:00
jeremystretch
8b07fbc554 Allow passing additional columns & specifying a sequence 2022-01-07 11:56:18 -05:00
jeremystretch
bff7400de4 Convert ActionsMenuItem to dataclass 2022-01-07 11:23:04 -05:00
jeremystretch
1024adca72 Exclude actions column from export 2022-01-07 11:00:35 -05:00
jeremystretch
ededa69e4a Only show relevant links for user permissions 2022-01-07 10:53:00 -05:00
jeremystretch
6d48ce4a25 Always include actions as a default column 2022-01-07 10:36:58 -05:00
jeremystretch
00a8fd654e Refactor table utilities 2022-01-07 09:12:48 -05:00
bluikko
b63e29610e Add Cisco StackWise-n choices 2022-01-07 11:56:54 +07:00
jeremystretch
58f7eb319f Initial work on #7679 2022-01-06 16:53:24 -05:00
Jeremy Stretch
453f2ab02d Merge pull request #8261 from netbox-community/7006-custom-object-fields
Closes #7006: Custom object fields
2022-01-06 14:09:40 -05:00
jeremystretch
3002382edc Documentation and changelog for #7006 2022-01-06 13:44:21 -05:00
jeremystretch
bfc695434c Add object_type validation 2022-01-06 13:43:40 -05:00
jeremystretch
1e80cc6db5 Clean up & extend custom field tests 2022-01-06 13:24:37 -05:00
jeremystretch
b0db5a8b0a PRVB 2022-01-06 09:58:50 -05:00
Jeremy Stretch
d3e2241ff7 Merge pull request #8257 from netbox-community/develop
Release v3.1.5
2022-01-06 09:52:54 -05:00
jeremystretch
e90b9f6c19 Release v3.1.5 2022-01-06 09:24:28 -05:00
jeremystretch
4c1199e009 Fixes #8255: Fix bulk editing of authentication parameters for wireless LANs and links 2022-01-06 08:54:05 -05:00
jeremystretch
65471068b6 Closes #8252: Linkify type and group columns in clusters table 2022-01-05 21:36:20 -05:00
jeremystretch
7aa1fabbd7 Fix tests 2022-01-05 21:21:23 -05:00
jeremystretch
85c06372ff Fix bulk editing for custom object fields 2022-01-05 21:04:44 -05:00
jeremystretch
c6467a824b #8228: Always add a blank choice 2022-01-05 17:10:59 -05:00
jeremystretch
271b7adeb8 Extend to support the assignment of multiple objects per field 2022-01-05 17:05:54 -05:00
jeremystretch
b1d1f3c6b2 Fixes #8228: Optional ChoiceVar fields should not force a selection 2022-01-05 15:46:04 -05:00
jeremystretch
574c2e2770 Closes #8244: Add length & length unit fields to cable filter form 2022-01-05 15:32:34 -05:00
jeremystretch
aec2d233c9 Changelog for #8231 2022-01-05 15:18:49 -05:00
Jeremy Stretch
39418f2bbe Merge pull request #8247 from netbox-community/8231-htmx-confirmation-dialogs
Closes #8231: Use HTMX for object deletion confirmations
2022-01-05 15:14:51 -05:00
jeremystretch
ccda73494f Center modal dialog vertically 2022-01-05 14:57:56 -05:00
jeremystretch
443b4ccc57 Initial work on #8231 2022-01-05 14:06:56 -05:00
Daniel Sheppard
88ac0f5d34 Work on #6221 - Make templatetags safe for consumption when using plugins and update ButtonColumn to use viewname helper. 2022-01-05 11:31:00 -06:00
jeremystretch
511aedd5db Omit table configuration form from rack elevations view 2022-01-05 11:39:58 -05:00
jeremystretch
2524290099 Introduce modals template block 2022-01-05 09:21:48 -05:00
jeremystretch
01e8017265 Clean up template blocks 2022-01-05 09:09:39 -05:00
jeremystretch
8338fc405f Simplify theme color palette 2022-01-04 20:51:10 -05:00
jeremystretch
0a22b3990f #7450: Clean up footer and navbar styles 2022-01-04 20:42:44 -05:00
jeremystretch
954d81147e Reindex migrations 2022-01-04 17:07:37 -05:00
jeremystretch
fa1e28e860 Initial work on #7006 2022-01-04 16:59:52 -05:00
jeremystretch
662cafe416 Form widgets & style cleanup 2022-01-04 15:01:16 -05:00
jeremystretch
ea961ba8f2 Fixes #8224: Fix KeyError exception when creating FHRP group with IP address and protocol "other" 2022-01-04 13:49:07 -05:00
jeremystretch
8c8774cd2f Fixes #8226: Honor return URL after populating a device bay 2022-01-04 13:24:15 -05:00
jeremystretch
2fe02ddb1f Add tests for IPAM object children views 2022-01-04 09:32:41 -05:00
jeremystretch
e11e8a5d64 Fixes #8213: Fix ValueError exception under prefix IP addresses view 2022-01-04 09:15:25 -05:00
jeremystretch
0978777eec Merge v3.1.4 2022-01-03 11:20:58 -05:00
jeremystretch
79bebf7c9b PRVB 2022-01-03 11:18:46 -05:00
Jeremy Stretch
8d3b660ce0 Merge pull request #8212 from netbox-community/develop
Release v3.1.4
2022-01-03 11:16:27 -05:00
jeremystretch
9de53fe070 Release v3.1.4 2022-01-03 11:00:23 -05:00
jeremystretch
ecb9fc65b7 Closes #8197: Allow filtering sites by group when connecting a cable 2022-01-03 10:41:43 -05:00
Jeremy Stretch
7b25d0379f Merge pull request #8202 from netbja/patch-1
Small syntax error
2022-01-03 10:39:56 -05:00
jeremystretch
05d4176d34 Fixes #8201: Custom integer fields should allow negative integers as minimum/maximum values 2022-01-03 10:07:19 -05:00
jeremystretch
7b0dff88ae Closes #8210: Establish netbox/local/ as a path for local resources 2022-01-03 09:45:30 -05:00
jeremystretch
1c7604e0fe Fixes #8200: Correct typo in navigation menu 2022-01-03 09:20:26 -05:00
jeremystretch
e18dc43aae Fixes #8196: Fix IndexError exception when viewing large IPv6 prefixes in UI 2022-01-03 09:17:15 -05:00
netbja
caaad684a4 Small syntax error
No double quotes after password.
2021-12-31 11:25:12 +01:00
jeremystretch
cdd51aee75 Closes #8194: Enable bulk user assignment to groups under admin UI 2021-12-30 13:19:18 -05:00
jeremystretch
51851f6c99 Refactor users.admin 2021-12-30 13:08:09 -05:00
jeremystretch
ab98aa489c Related objects should be prefetched for Prefix/IPRange child object views 2021-12-30 12:43:37 -05:00
jeremystretch
5829985ca8 Remove power utilization as default column from racks table 2021-12-30 12:02:20 -05:00
jeremystretch
2fa8e27f05 Fixes #8192: Add "add prefix" button to aggregate child prefixes view 2021-12-30 12:00:37 -05:00
jeremystretch
68f92dfd5d Fix redirection URL for prefix IP ranges view 2021-12-30 11:47:21 -05:00
jeremystretch
67aeb380e7 Fix DNS name label in IP address bulk edit form 2021-12-30 11:46:09 -05:00
jeremystretch
f7d91b7139 Extend "Adding models" documentation 2021-12-30 10:12:28 -05:00
jeremystretch
b6e157f393 Add features summary to README 2021-12-30 10:08:31 -05:00
jeremystretch
2319fce092 Add tab to cable connect view 2021-12-30 09:51:30 -05:00
jeremystretch
a5f1707662 Fixes #8191: Fix return URL when adding IP addresses to VM interfaces 2021-12-30 09:46:02 -05:00
jeremystretch
6cda55da06 Fixes #8187: Fix rendering of tags column in object tables 2021-12-30 09:41:35 -05:00
jeremystretch
8e69961744 Fix CustomLinkButtonClassChoices references in tests 2021-12-30 08:15:43 -05:00
jeremystretch
9f53497e39 Clean up & expand button color choices 2021-12-29 20:28:12 -05:00
Jeremy Stretch
ae3c871438 Merge pull request #8186 from netbox-community/8118-inventoryitem-template
Closes #8118: Inventory item templates
2021-12-29 16:58:57 -05:00
jeremystretch
1edf80db8e Changelog & documentation for #8118 2021-12-29 16:40:03 -05:00
jeremystretch
791cc093f4 Enable the association of inventory item templates with component templates 2021-12-29 16:30:44 -05:00
jeremystretch
4c15f4a84f Initial work on #8118 2021-12-29 15:37:01 -05:00
jeremystretch
3bb485d0b8 Merge v3.1.3 2021-12-29 12:41:56 -05:00
jeremystretch
c3f2fee633 PRVB 2021-12-29 12:40:04 -05:00
Jeremy Stretch
1f575a2a47 Merge pull request #8185 from netbox-community/develop
Release v3.1.3
2021-12-29 12:31:07 -05:00
jeremystretch
13c4d13157 Release NetBox v3.1.3 2021-12-29 12:10:46 -05:00
jeremystretch
43fadab3bb Closes #8034: Enable specifying custom field validators during CSV import 2021-12-29 11:57:27 -05:00
jeremystretch
82a0240d2e Closes #8182: Introduce checkmark template tag 2021-12-29 10:26:42 -05:00
jeremystretch
f2aa35d3d2 Closes #7600: Include count of available IPs on prefix view 2021-12-29 09:59:25 -05:00
jeremystretch
9c9fcaf42f Fixes #7290: Defer loading API-backed form fields 2021-12-29 09:30:43 -05:00
jeremystretch
146a51ceba Clean up API tokens view 2021-12-29 09:10:56 -05:00
jeremystretch
b0350e9e96 Remove navbar background color 2021-12-29 08:56:59 -05:00
Jeremy Stretch
e0126d971c Merge pull request #8179 from netbox-community/8089-choice-colors
Closes #8089: Color names
2021-12-28 21:23:01 -05:00
jeremystretch
b60ace80be Update documentation for FIELD_CHOICES 2021-12-28 20:21:35 -05:00
jeremystretch
b3ea007e0a Update ChoiceSets to use base colors 2021-12-28 20:18:07 -05:00
jeremystretch
a0d6cb1fd3 Simplify theme color palette 2021-12-28 17:14:04 -05:00
jeremystretch
7b66dae2f0 Merge branch 'develop' into feature 2021-12-28 16:14:24 -05:00
jeremystretch
35e346c4b9 Fix circuit termination button style 2021-12-28 16:13:58 -05:00
jeremystretch
3982f13569 Show parent device/VM when creating new components 2021-12-28 15:19:41 -05:00
jeremystretch
21356b487a #7846: Show assigned component (if any) when creating inventory item 2021-12-28 14:15:06 -05:00
jeremystretch
1987647cc3 Closes #8175: Display parent object when attaching an image 2021-12-28 13:06:27 -05:00
Jeremy Stretch
e9910d1fe2 Merge pull request #8176 from netbox-community/7846-inventoryitem-component
Closes #7846: Associate inventory items with device components
2021-12-28 11:48:36 -05:00
jeremystretch
4c5a5c70b0 Changelog for #7846 2021-12-28 11:19:46 -05:00
jeremystretch
a0836b6876 Add inventory items panel to device component views 2021-12-28 11:06:34 -05:00
jeremystretch
e0319cc894 Clean up form rendering 2021-12-28 10:22:00 -05:00
jeremystretch
4075cc8518 Restore front port component creation 2021-12-28 09:53:56 -05:00
jeremystretch
8ca09ec07f Clean up form display 2021-12-28 08:54:03 -05:00
jeremystretch
ba85101d30 Update component model forms to use DynamicModelChoiceField query_params for related objects 2021-12-27 21:25:47 -05:00
jeremystretch
a237c01b4b Refactor ComponentCreateView to use separate forms for names/labels and model creation 2021-12-27 21:04:29 -05:00
jeremystretch
99d5013de3 Initial work on #7846 2021-12-27 14:01:25 -05:00
Jeremy Stretch
a58f1c6a7d Merge pull request #8172 from netbox-community/3087-inventory-item-roles
Closes #3087: Add inventory item roles
2021-12-27 11:06:50 -05:00
jeremystretch
a748083f26 Changelog for #3087 2021-12-27 10:52:04 -05:00
jeremystretch
6e9afccfd7 #8037: Add role field to InventoryItem 2021-12-27 10:45:33 -05:00
jeremystretch
04fb5e544d #3087: Add InvetoryItemRole 2021-12-27 10:18:39 -05:00
jeremystretch
542534aeba Add direct link to preferences in user menu 2021-12-23 14:41:39 -05:00
jeremystretch
908a2824ba Reduce saturation of 'info' theme color 2021-12-23 14:34:09 -05:00
jeremystretch
77dd684916 Closes #7784: Support cluster type assignment for config contexts 2021-12-23 14:20:03 -05:00
jeremystretch
bffd22038b Closes #7681: Add service_id field for provider networks 2021-12-23 13:50:01 -05:00
jeremystretch
a03ae295f6 Update release notes 2021-12-23 11:39:56 -05:00
jeremystretch
544d991e1e Closes #8168: Add min/max VID fields to VLANGroup 2021-12-23 11:22:10 -05:00
jeremystretch
083fda3172 #2658: Fix test permissions 2021-12-23 10:46:57 -05:00
jeremystretch
e0cfd5e49b Closes #2658: Avalable VLANs API endpoint for VLAN groups 2021-12-23 10:14:28 -05:00
jeremystretch
2dd165bbef Merge branch 'develop' into feature 2021-12-23 08:32:40 -05:00
Jeremy Stretch
cab9733b60 Merge pull request #8159 from netbox-community/6782-custom-link-columns
Closes #6782: Custom link columns
2021-12-22 21:13:13 -05:00
jeremystretch
99e0dcec76 Changelog & docs for #6782 2021-12-22 20:57:59 -05:00
jeremystretch
9dafb36c88 Introduce CustomLinkColumn 2021-12-22 20:56:11 -05:00
jeremystretch
3d7d19b608 Move rendering logic under CustomLink class 2021-12-22 20:25:57 -05:00
jeremystretch
d650d10cb2 #7449: Apply distinctive styling to top navbar 2021-12-22 15:32:35 -05:00
jeremystretch
7fe45018e9 #7449: Remove red color from logout link 2021-12-22 15:22:06 -05:00
jeremystretch
4c4cab87fb #7449: Don't color valid form fields 2021-12-22 15:18:24 -05:00
jeremystretch
94c7f64baf Relocate confirmation_form.html 2021-12-22 15:08:04 -05:00
jeremystretch
f369b5f588 Reorganize & clean up templatetag templates 2021-12-22 15:05:24 -05:00
jeremystretch
37065b7c50 Remove obsolete template 2021-12-22 14:47:42 -05:00
jeremystretch
0a7372460f Changelog for #7887 2021-12-22 12:48:24 -05:00
Jeremy Stretch
063abc8ef7 Merge pull request #8153 from davama/develop
Add missing HTTP_X_FORWARDED_FOR
2021-12-22 12:46:22 -05:00
Jeremy Stretch
d64c88786e Merge pull request #8143 from netbox-community/7759-user-preferences
Closes #7759: User preferences framework
2021-12-22 11:00:18 -05:00
jeremystretch
fb4511d099 Fixes #8140: Restore missing fields on wireless LAN & link REST API serializers 2021-12-22 10:55:06 -05:00
jeremystretch
7343ae7339 Fix invalid key retrieval 2021-12-22 10:45:21 -05:00
jeremystretch
cb6342c874 Reference DEFAULT_USER_PREFERENCES for undefined preferences 2021-12-22 10:13:08 -05:00
jeremystretch
01997efcbe Add tests & cleanup 2021-12-22 09:51:31 -05:00
jeremystretch
7926225e9b Improve preferences form rendering 2021-12-22 09:35:29 -05:00
jeremystretch
1aafcf241f Enable plugins to define user preferences 2021-12-22 09:10:50 -05:00
jeremystretch
1eeac7f4f4 Introduce DEFAULT_USER_PREFERENCES dynamic config setting 2021-12-21 20:30:59 -05:00
jeremystretch
2c01e178c7 Update config context display to reference data_format preference 2021-12-21 19:59:33 -05:00
jeremystretch
36d2422eef Introduce UserPreference to define user preferences 2021-12-21 17:05:06 -05:00
jeremystretch
70f257b1ea Introduce UserConfigForm for managing user preferences 2021-12-21 16:29:01 -05:00
jeremystretch
275560698f Fixes #8139: Fix rendering of table configuration form under VM interfaces view 2021-12-21 14:10:12 -05:00
jeremystretch
d4b6fe14c3 Fixes #8138: Fix alignment of tags panel within IP address view 2021-12-21 14:04:15 -05:00
jeremystretch
f1350a1022 FIxes #7972: Standardize name of RemoteUserBackend logger 2021-12-21 13:57:12 -05:00
jeremystretch
344fb638fd Fixes #8127: Fix disassociation of interface under IP address edit view 2021-12-21 13:17:54 -05:00
thatmattlove
373cc74a33 Fixes #8134: reinitialize event listeners when HTMX swaps elements 2021-12-21 11:11:33 -07:00
jeremystretch
8e95ac42c2 Closes #8100: Add "other" choice for FHRP group protocol 2021-12-21 13:05:38 -05:00
jeremystretch
ceb941df81 Closes #8135: Append version when fetching static assets 2021-12-21 13:00:52 -05:00
jeremystretch
d275538116 Changelog & cleanup for #7246, #8097 2021-12-21 11:53:31 -05:00
Jeremy Stretch
fa38cdbc0d Merge pull request #8121 from kkthxbye-code/fix-8097
Fix #8097: Re-fix markdown table rendering
2021-12-21 11:50:24 -05:00
Jeremy Stretch
7569544b7b Merge pull request #8063 from rizlas/develop
Get_Environment from napalm should not need any decoding
2021-12-21 11:43:23 -05:00
Jeremy Stretch
853a52f3ca Merge branch 'develop' into fix-8097 2021-12-21 11:37:58 -05:00
jeremystretch
5e32c69e0e Merge branch 'develop' into feature 2021-12-21 11:28:16 -05:00
rizlas
39a0b15df4 Update netbox/dcim/api/views.py
Test without decode_dict function

Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
2021-12-21 17:15:54 +01:00
jeremystretch
a0db10838b Fixes #8131: Restore annotation of available IPs under prefix IPs view 2021-12-21 11:09:30 -05:00
jeremystretch
f2f10dff92 Fix RearPortTemplateTable buttons 2021-12-21 10:57:46 -05:00
jeremystretch
7ba45b2887 Clean up imports 2021-12-21 10:48:10 -05:00
jeremystretch
c91eb8f406 Remove extraneous output from service edit template 2021-12-21 10:30:30 -05:00
jeremystretch
57a78b3cad Clean up device/devicetype tab views 2021-12-21 10:28:28 -05:00
jeremystretch
b755c7dab3 Add changelog for #7962 (via #8114) 2021-12-21 09:03:36 -05:00
Jeremy Stretch
9ffd791ae4 Merge pull request #8130 from netbox-community/8114-htmx-jobs
Closes #8114: Use HTMX to update report/script results
2021-12-21 09:01:15 -05:00
jeremystretch
8af12b22bb Clean up report & script templates 2021-12-21 08:43:01 -05:00
jeremystretch
17ba0a97d5 Remove jobs Javascript 2021-12-20 20:59:14 -05:00
jeremystretch
4ae2b4e0b9 Convert reports to use HTMX 2021-12-20 20:52:29 -05:00
jeremystretch
872691a138 Convert scripts to use HTMX 2021-12-20 20:45:32 -05:00
kkthxbye-code
3a54ecb522 Fix #8097: Re-fix markdown table rendering 2021-12-20 23:31:24 +01:00
jeremystretch
71b4641e18 Merge v3.1.2 2021-12-20 16:28:11 -05:00
jeremystretch
42b590af77 PRVB 2021-12-20 16:06:42 -05:00
jeremystretch
ae55ca7fd7 Changelog for #7844 2021-12-20 11:02:56 -05:00
Jeremy Stretch
d69a314bbf Merge pull request #8105 from netbox-community/7844-modules
Closes #7844: Add support for device modules
2021-12-20 10:55:50 -05:00
jeremystretch
e35aa4bd1e Add documentation for modules 2021-12-20 10:31:18 -05:00
jeremystretch
eaa1165611 Add position field for module bays 2021-12-20 09:51:55 -05:00
jeremystretch
ed6a160372 Add modules to device component serializers 2021-12-17 20:31:15 -05:00
jeremystretch
7dc4e00b4d Add module, module_bay columns to device component tables 2021-12-17 20:15:49 -05:00
jeremystretch
e0d7511eaa Misc cleanup 2021-12-17 16:34:51 -05:00
jeremystretch
7777922bef Add Module model 2021-12-17 16:12:03 -05:00
jeremystretch
5bd223a468 Fix YAML import for ModuleTypes 2021-12-17 13:28:17 -05:00
jeremystretch
7c60e3c0ff Add Module model 2021-12-17 12:18:37 -05:00
jeremystretch
e529d7fd3b Add ModuleBay and ModuleBayTemplate models 2021-12-17 09:35:57 -05:00
jeremystretch
5f9f0e3ed3 Split generic views into separate modules 2021-12-16 16:41:43 -05:00
jeremystretch
e91a76c936 Refactor bulk generic views 2021-12-16 16:28:23 -05:00
jeremystretch
1dd3d2ec48 Changelog for #8054 2021-12-16 11:32:31 -05:00
jeremystretch
ea6cdc9673 Closes #7650: Add support for local account password validation 2021-12-16 11:28:57 -05:00
Jeremy Stretch
134742a8b7 Merge pull request #8090 from netbox-community/8054-configurable-choice-fields
Closes #8054: Configurable choice fields
2021-12-16 11:17:32 -05:00
jeremystretch
d8be8e25a5 ChoiceSet cleanup 2021-12-16 10:31:32 -05:00
jeremystretch
1902ecb8ca Drop as_dict() method from ChoiceSet 2021-12-16 10:22:05 -05:00
jeremystretch
124302908a Support nested choice groups 2021-12-16 10:19:16 -05:00
jeremystretch
0d3b50a5e5 Support CSS class definition directly in CHOICES iterable 2021-12-16 10:03:23 -05:00
jeremystretch
419f86a4a5 #8054: Support configurable status choices 2021-12-16 09:36:15 -05:00
jeremystretch
28f577738a Merge branch 'develop' into feature 2021-12-15 13:19:17 -05:00
jeremystretch
997e88af00 Merge branch 'develop' into feature 2021-12-15 10:53:21 -05:00
jeremystretch
2dad35186a Generic view cleanup 2021-12-14 11:28:13 -05:00
rizlas
2ec64a2ea2 Get_Environment from napalm should not need any decoding 2021-12-14 10:17:00 +01:00
jeremystretch
f2f6edabf9 Merge branch 'develop' into feature 2021-12-13 11:29:54 -05:00
jeremystretch
7d99e15dc3 Closes #7743: Remove legacy ASN field from site model 2021-12-09 17:01:27 -05:00
jeremystretch
d2d2978288 Closes #7748: Remove legacy contact fields from site model 2021-12-09 16:23:39 -05:00
jeremystretch
8680981990 Closes #8031: Remove automatic redirection of legacy slug-based URLs 2021-12-09 15:43:41 -05:00
jeremystretch
78ca6f1a87 Use strings for build matrix 2021-12-09 15:39:50 -05:00
jeremystretch
62e5680eaf Closes #7731: Require Python 3.8 or later 2021-12-09 15:35:40 -05:00
Dave
038d7e0fa6 Add missing HTTP_X_FORWARDED_FOR
See discussion [here](https://github.com/netbox-community/netbox/discussions/7876) for background.

From the [doc](https://netbox.readthedocs.io/en/stable/customization/custom-scripts/) i should be able to access `META.HTTP_X_FORWARDED_FOR` but i was not able to since they were not being sent downstream
2021-11-19 15:20:00 -05:00
798 changed files with 36573 additions and 18529 deletions

View File

@@ -14,7 +14,7 @@ body:
attributes:
label: NetBox version
description: What version of NetBox are you currently running?
placeholder: v3.1.2
placeholder: v3.3-beta2
validations:
required: true
- type: dropdown
@@ -22,9 +22,9 @@ body:
label: Python version
description: What version of Python are you currently running?
options:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
validations:
required: true
- type: textarea

View File

@@ -14,7 +14,7 @@ body:
attributes:
label: NetBox version
description: What version of NetBox are you currently running?
placeholder: v3.1.2
placeholder: v3.3-beta2
validations:
required: true
- type: dropdown

View File

@@ -3,10 +3,12 @@ on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
env:
NETBOX_CONFIGURATION: netbox.configuration_testing
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
node-version: [14.x]
python-version: ['3.8', '3.9', '3.10']
node-version: ['14.x']
services:
redis:
image: redis
@@ -38,14 +40,25 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install Yarn Package Manager
run: npm install -g yarn
- name: Setup Node.js with Yarn Caching
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: yarn
cache-dependency-path: netbox/project-static/yarn.lock
- name: Install Frontend Dependencies
run: yarn --cwd netbox/project-static
- name: Install dependencies & set up configuration
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pycodestyle coverage
ln -s configuration.testing.py netbox/netbox/configuration.py
yarn --cwd netbox/project-static
pip install pycodestyle coverage tblib
- name: Build documentation
run: mkdocs build
@@ -63,7 +76,7 @@ jobs:
run: scripts/verify-bundles.sh
- name: Run tests
run: coverage run --source="netbox/" netbox/manage.py test netbox/
run: coverage run --source="netbox/" netbox/manage.py test netbox/ --parallel
- name: Show coverage report
run: coverage report --skip-covered --omit *migrations*

View File

@@ -8,7 +8,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v4
- uses: actions/stale@v5
with:
close-issue-message: >
This issue has been automatically closed due to lack of activity. In an
@@ -27,7 +27,10 @@ jobs:
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. NetBox
is governed by a small group of core maintainers which means not all opened
issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
issues may receive direct feedback. **Do not** attempt to circumvent this
process by "bumping" the issue; doing so will result in its immediate closure
and you may be barred from participating in any future discussions. Please see
our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
stale-pr-label: 'pending closure'
stale-pr-message: >
This PR has been automatically marked as stale because it has not had

1
.gitignore vendored
View File

@@ -8,6 +8,7 @@ yarn-error.log*
!/netbox/project-static/docs/.info
/netbox/netbox/configuration.py
/netbox/netbox/ldap_config.py
/netbox/local/*
/netbox/reports/*
!/netbox/reports/__init__.py
/netbox/scripts/*

10
.readthedocs.yaml Normal file
View File

@@ -0,0 +1,10 @@
version: 2
build:
os: ubuntu-20.04
tools:
python: "3.9"
mkdocs:
configuration: mkdocs.yml
python:
install:
- requirements: requirements.txt

View File

@@ -1 +1 @@
The changelog has been moved to the [project release notes](https://netbox.readthedocs.io/en/stable/release-notes/).
The changelog has been moved to the [project release notes](https://docs.netbox.dev/en/stable/release-notes/).

View File

@@ -16,13 +16,6 @@ categories for discussions:
feature request
* **Q&A** - Request help with installing or using NetBox
### Mailing List
We also have a Google Groups [mailing list](https://groups.google.com/g/netbox-discuss)
for general discussion, however we're encouraging people to use GitHub
discussions where possible, as it's much easier for newcomers to review past
discussions.
### Slack
For real-time chat, you can join the **#netbox** Slack channel on [NetDev Community](https://netdev.chat/).
@@ -106,7 +99,7 @@ appropriate labels will be applied for categorization.
## Submitting Pull Requests
* If you're interested in contributing to NetBox, be sure to check out our
[getting started](https://netbox.readthedocs.io/en/stable/development/getting-started/)
[getting started](https://docs.netbox.dev/en/stable/development/getting-started/)
documentation for tips on setting up your development environment.
* Be sure to open an issue **before** starting work on a pull request, and
@@ -167,9 +160,9 @@ to aid in issue management.
It is natural that some new issues get more attention than others. The stale
bot helps bring renewed attention to potentially valuable issues that may have
been overlooked. **Do not** comment on an issue that has been marked stale in
an effort to circumvent the bot: Doing so will not remove the stale label.
(Stale labels can be removed only by maintainers.)
been overlooked. **Do not** comment on a stale issue merely to "bump" it in an
effort to circumvent the bot: This will result in the immediate closure of the
issue, and you may be barred from participating in future discussions.
## Maintainer Guidance
@@ -178,7 +171,7 @@ an effort to circumvent the bot: Doing so will not remove the stale label.
the understanding that all contributions are submitted under the Apache 2.0
license and that your employer may not make claim to any contributions.
Contributions include code work, issue management, and community support. All
development must be in accordance with our [development guidance](https://netbox.readthedocs.io/en/stable/development/).
development must be in accordance with our [development guidance](https://docs.netbox.dev/en/stable/development/).
* Maintainers are expected to attend (where feasible) our biweekly ~30-minute
sync to review agenda items. This meeting provides opportunity to present and

6
NOTICE
View File

@@ -1 +1,7 @@
Copyrighted and licensed under Apache License 2.0 by DigitalOcean, LLC.
This project contains code developed expressly for NetBox, and its reuse in
other projects may introduce issues affecting performance, data integrity,
and security.
For more information, please see https://github.com/netbox-community/netbox.

View File

@@ -5,16 +5,51 @@
![Master branch build status](https://github.com/netbox-community/netbox/workflows/CI/badge.svg?branch=master)
NetBox is an infrastructure resource modeling (IRM) tool designed to empower
network automation. Initially conceived by the network engineering team at
network automation, used by thousands of organizations around the world.
Initially conceived by the network engineering team at
[DigitalOcean](https://www.digitalocean.com/), NetBox was developed specifically
to address the needs of network and infrastructure engineers. It is intended to
function as a domain-specific source of truth for network operations.
Myriad infrastructure components can be modeled in NetBox, including:
* Hierarchical regions, site groups, sites, and locations
* Racks, devices, and device components
* Cables and wireless connections
* Power distribution
* Data circuits and providers
* Virtual machines and clusters
* IP prefixes, ranges, and addresses
* VRFs and route targets
* FHRP groups (VRRP, HSRP, etc.)
* AS numbers
* VLANs and scoped VLAN groups
* Organizational tenants and contacts
In addition to its extensive built-in models and functionality, NetBox can be
customized and extended through the use of:
* Custom fields
* Custom links
* Configuration contexts
* Custom model validation rules
* Reports
* Custom scripts
* Export templates
* Conditional webhooks
* Plugins
* Single sign-on (SSO) authentication
* NAPALM integration
* Detailed change logging
NetBox also features a complete REST API as well as a GraphQL API for easily
integrating with other tools and systems.
NetBox runs as a web application atop the [Django](https://www.djangoproject.com/)
Python framework with a [PostgreSQL](https://www.postgresql.org/) database. For a
complete list of requirements, see `requirements.txt`. The code is available [on GitHub](https://github.com/netbox-community/netbox).
The complete documentation for NetBox can be found at [Read the Docs](https://netbox.readthedocs.io/en/stable/). A public demo instance is available at https://demo.netbox.dev.
The complete documentation for NetBox can be found at [docs.netbox.dev](https://docs.netbox.dev/). A public demo instance is available at https://demo.netbox.dev.
<div align="center">
<h4>Thank you to our sponsors!</h4>
@@ -25,6 +60,8 @@ The complete documentation for NetBox can be found at [Read the Docs](https://ne
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[![NS1](https://raw.githubusercontent.com/wiki/netbox-community/netbox/images/sponsors/ns1.png)](https://ns1.com/)
<br />
[![Sentry](https://raw.githubusercontent.com/wiki/netbox-community/netbox/images/sponsors/sentry.png)](https://sentry.io/)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
[![Stellar Technologies](https://raw.githubusercontent.com/wiki/netbox-community/netbox/images/sponsors/stellar.png)](https://stellar.tech/)
</div>
@@ -33,11 +70,10 @@ The complete documentation for NetBox can be found at [Read the Docs](https://ne
* [GitHub Discussions](https://github.com/netbox-community/netbox/discussions) - Discussion forum hosted by GitHub; ideal for Q&A and other structured discussions
* [Slack](https://netdev.chat/) - Real-time chat hosted by the NetDev Community; best for unstructured discussion or just hanging out
* [Google Group](https://groups.google.com/g/netbox-discuss) - Legacy mailing list; slowly being replaced by GitHub discussions
### Installation
Please see [the documentation](https://netbox.readthedocs.io/en/stable/) for
Please see [the documentation](https://docs.netbox.dev/) for
instructions on installing NetBox. To upgrade NetBox, please download the
[latest release](https://github.com/netbox-community/netbox/releases) and
run `upgrade.sh`.

31
SECURITY.md Normal file
View File

@@ -0,0 +1,31 @@
# Security Policy
## No Warranty
Per the terms of the Apache 2 license, NetBox is offered "as is" and without any guarantee or warranty pertaining to its operation. While every reasonable effort is made by its maintainers to ensure the product remains free of security vulnerabilities, users are ultimately responsible for conducting their own evaluations of each software release.
## Recommendations
Administrators are encouraged to adhere to industry best practices concerning the secure operation of software, such as:
* Do not expose your NetBox installation to the public Internet
* Do not permit multiple users to share an account
* Enforce minimum password complexity requirements for local accounts
* Prohibit access to your database from clients other than the NetBox application
* Keep your deployment updated to the most recent stable release
## Reporting a Suspected Vulnerability
If you believe you've uncovered a security vulnerability and wish to report it confidentially, you may do so via email. Please note that any reported vulnerabilities **MUST** meet all the following conditions:
* Affects the most recent stable release of NetBox, or a current beta release
* Affects a NetBox instance installed and configured per the official documentation
* Is reproducible following a prescribed set of instructions
Please note that we **DO NOT** accept reports generated by automated tooling which merely suggest that a file or file(s) _may_ be vulnerable under certain conditions, as these are most often innocuous.
If you believe that you've found a vulnerability which meets all of these conditions, please email a brief description of the suspected bug and instructions for reproduction to **security@netbox.dev**. For any security concerns regarding NetBox deployed via Docker, please see the [netbox-docker](https://github.com/netbox-community/netbox-docker) project.
### Bug Bounties
As NetBox is provided as free open source software, we do not offer any monetary compensation for vulnerability or bug reports, however your contributions are greatly appreciated.

View File

@@ -1,6 +1,10 @@
# HTML sanitizer
# https://github.com/mozilla/bleach
bleach
# The Python web framework on which NetBox is built
# https://github.com/django/django
Django<4.0
Django
# Django middleware which permits cross-domain API requests
# https://github.com/OttoYiu/django-cors-headers
@@ -30,10 +34,14 @@ django-pglocks
# https://github.com/korfuri/django-prometheus
django-prometheus
# Django chaching backend using Redis
# Django caching backend using Redis
# https://github.com/jazzband/django-redis
django-redis
# Django extensions for Rich (terminal text rendering)
# https://github.com/adamchainz/django-rich
django-rich
# Django integration for RQ (Reqis queuing)
# https://github.com/rq/django-rq
django-rq
@@ -82,8 +90,12 @@ markdown-include
# https://github.com/squidfunk/mkdocs-material
mkdocs-material
# Introspection for embedded code
# https://github.com/mkdocstrings/mkdocstrings
mkdocstrings[python-legacy]
# Library for manipulating IP prefixes and addresses
# https://github.com/drkjam/netaddr
# https://github.com/netaddr/netaddr
netaddr
# Fork of PIL (Python Imaging Library) for image processing
@@ -98,13 +110,13 @@ psycopg2-binary
# https://github.com/yaml/pyyaml
PyYAML
# In-memory key/value store used for caching and queuing
# https://github.com/andymccurdy/redis-py
redis
# Sentry SDK
# https://github.com/getsentry/sentry-python
sentry-sdk
# Social authentication framework
# https://github.com/python-social-auth/social-core
social-auth-core[all]
social-auth-core
# Django app for social-auth-core
# https://github.com/python-social-auth/social-app-django
@@ -117,3 +129,7 @@ svgwrite
# Tabular dataset library (for table-based exports)
# https://github.com/jazzband/tablib
tablib
# Timezone data (required by django-timezone-field on Python 3.9+)
# https://github.com/python/tzdata
tzdata

0
contrib/netbox-housekeeping.sh Normal file → Executable file
View File

View File

@@ -1,6 +1,6 @@
[Unit]
Description=NetBox Request Queue Worker
Documentation=https://netbox.readthedocs.io/en/stable/
Documentation=https://docs.netbox.dev/
After=network-online.target
Wants=network-online.target

View File

@@ -1,6 +1,6 @@
[Unit]
Description=NetBox WSGI Service
Documentation=https://netbox.readthedocs.io/en/stable/
Documentation=https://docs.netbox.dev/
After=network-online.target
Wants=network-online.target

View File

@@ -1,5 +1,22 @@
{!models/extras/webhook.md!}
## Conditional Webhooks
A webhook may include a set of conditional logic expressed in JSON used to control whether a webhook triggers for a specific object. For example, you may wish to trigger a webhook for devices only when the `status` field of an object is "active":
```json
{
"and": [
{
"attr": "status.value",
"value": "active"
}
]
}
```
For more detail, see the reference documentation for NetBox's [conditional logic](../reference/conditions.md).
## Webhook Processing
When a change is detected, any resulting webhooks are placed into a Redis queue for processing. This allows the user's request to complete without needing to wait for the outgoing webhook(s) to be processed. The webhooks are then extracted from the queue by the `rqworker` process and HTTP requests are sent to their respective destinations. The current webhook queue and any failed webhooks can be inspected in the admin UI under System > Background Tasks.

View File

@@ -0,0 +1,88 @@
# Microsoft Azure AD
This guide explains how to configure single sign-on (SSO) support for NetBox using [Microsoft Azure Active Directory (AD)](https://azure.microsoft.com/en-us/services/active-directory/) as an authentication backend.
## Azure AD Configuration
### 1. Create a test user (optional)
Create a new user in AD to be used for testing. You can skip this step if you already have a suitable account created.
### 2. Create an app registration
Under the Azure Active Directory dashboard, navigate to **Add > App registration**.
![Add an app registration](../../media/authentication/azure_ad_add_app_registration.png)
Enter a name for the registration (e.g. "NetBox") and ensure that the "single tenant" option is selected.
Under "Redirect URI", select "Web" for the platform and enter the path to your NetBox installation, ending with `/oauth/complete/azuread-oauth2/`. Note that this URI **must** begin with `https://` unless you are referencing localhost (for development purposes).
![App registration parameters](../../media/authentication/azure_ad_app_registration.png)
Once finished, make note of the application (client) ID; this will be used when configuring NetBox.
![Completed app registration](../../media/authentication/azure_ad_app_registration_created.png)
!!! tip "Multitenant authentication"
NetBox also supports multitenant authentication via Azure AD, however it requires a different backend and an additional configuration parameter. Please see the [`python-social-auth` documentation](https://python-social-auth.readthedocs.io/en/latest/backends/azuread.html#tenant-support) for details concerning multitenant authentication.
### 3. Create a secret
When viewing the newly-created app registration, click the "Add a certificate or secret" link under "Client credentials". Under the "Client secrets" tab, click the "New client secret" button.
![Add a client secret](../../media/authentication/azure_ad_add_client_secret.png)
You can optionally specify a description and select a lifetime for the secret.
![Client secret parameters](../../media/authentication/azure_ad_client_secret.png)
Once finished, make note of the secret value (not the secret ID); this will be used when configuring NetBox.
![Client secret parameters](../../media/authentication/azure_ad_client_secret_created.png)
## NetBox Configuration
### 1. Enter configuration parameters
Enter the following configuration parameters in `configuration.py`, substituting your own values:
```python
REMOTE_AUTH_BACKEND = 'social_core.backends.azuread.AzureADOAuth2'
SOCIAL_AUTH_AZUREAD_OAUTH2_KEY = '{APPLICATION_ID}'
SOCIAL_AUTH_AZUREAD_OAUTH2_SECRET = '{SECRET_VALUE}'
```
### 2. Restart NetBox
Restart the NetBox services so that the new configuration takes effect. This is typically done with the command below:
```no-highlight
sudo systemctl restart netbox
```
## Testing
Log out of NetBox if already authenticated, and click the "Log In" button at top right. You should see the normal login form as well as an option to authenticate using Azure AD. Click that link.
![NetBox Azure AD login form](../../media/authentication/netbox_azure_ad_login.png)
You should be redirected to Microsoft's authentication portal. Enter the username/email and password of your test account to continue. You may also be prompted to grant this application access to your account.
![NetBox Azure AD login form](../../media/authentication/azure_ad_login_portal.png)
If successful, you will be redirected back to the NetBox UI, and will be logged in as the AD user. You can verify this by navigating to your profile (using the button at top right).
This user account has been replicated locally to NetBox, and can now be assigned groups and permissions within the NetBox admin UI.
## Troubleshooting
### Redirect URI does not Match
Azure requires that the authenticating client request a redirect URI that matches what you've configured for the app in step two. This URI **must** begin with `https://` (unless using `localhost` for the domain).
If Azure complains that the requested URI starts with `http://` (not HTTPS), it's likely that your HTTP server is misconfigured or sitting behind a load balancer, so NetBox is not aware that HTTPS is being use. To force the use of an HTTPS redirect URI, set `SOCIAL_AUTH_REDIRECT_IS_HTTPS = True` in `configuration.py` per the [python-social-auth docs](https://python-social-auth.readthedocs.io/en/latest/configuration/settings.html#processing-redirects-and-urlopen).
### Not Logged in After Authenticating
If you are redirected to the NetBox UI after authenticating successfully, but are _not_ logged in, double-check the configured backend and app registration. The instructions in this guide pertain only to the `azuread.AzureADOAuth2` backend using a single-tenant app registration.

View File

@@ -0,0 +1,70 @@
# Okta
This guide explains how to configure single sign-on (SSO) support for NetBox using [Okta](https://www.okta.com/) as an authentication backend.
## Okta Configuration
!!! tip "Okta developer account"
Okta offers free developer accounts at <https://developer.okta.com/>.
### 1. Create a test user (optional)
Create a new user in the Okta admin portal to be used for testing. You can skip this step if you already have a suitable account created.
### 2. Create an app registration
Within the Okta administration dashboard, navigate to **Applications > Applications**, and click the "Create App Integration" button. Select "OIDC" as the sign-in method, and "Web application" for the application type.
![Create an app registration](../../media/authentication/okta_create_app_registration.png)
On the next page, give the app integration a name (e.g. "NetBox") and specify the sign-in and sign-out URIs. These URIs should follow the formats below:
* Sign-in URI: `https://{netbox}/oauth/complete/okta-openidconnect/`
* Sign-out URI: `https://{netbox}/oauth/disconnect/okta-openidconnect/`
![Web app integration](../../media/authentication/okta_web_app_integration.png)
Under "Assignments," select the controlled access setting most appropriate for your organization. Click "Save" to complete the creation.
Once finished, note the following parameters. These will be used to configured NetBox.
* Client ID
* Client secret
* Okta domain
![Okta integration parameters](../../media/authentication/okta_integration_parameters.png)
## NetBox Configuration
### 1. Enter configuration parameters
Enter the following configuration parameters in `configuration.py`, substituting your own values:
```python
REMOTE_AUTH_BACKEND = 'social_core.backends.okta_openidconnect.OktaOpenIdConnect'
SOCIAL_AUTH_OKTA_OPENIDCONNECT_KEY = '{Client ID}'
SOCIAL_AUTH_OKTA_OPENIDCONNECT_SECRET = '{Client secret}'
SOCIAL_AUTH_OKTA_OPENIDCONNECT_API_URL = 'https://{Okta domain}/oauth2/'
```
### 2. Restart NetBox
Restart the NetBox services so that the new configuration takes effect. This is typically done with the command below:
```no-highlight
sudo systemctl restart netbox
```
## Testing
Log out of NetBox if already authenticated, and click the "Log In" button at top right. You should see the normal login form as well as an option to authenticate using Okta. Click that link.
![NetBox Okta login form](../../media/authentication/netbox_okta_login.png)
You should be redirected to Okta's authentication portal. Enter the username/email and password of your test account to continue. You may also be prompted to grant this application access to your account.
![Okta login portal](../../media/authentication/okta_login_portal.png)
If successful, you will be redirected back to the NetBox UI, and will be logged in as the Okta user. You can verify this by navigating to your profile (using the button at top right).
This user account has been replicated locally to NetBox, and can now be assigned groups and permissions within the NetBox admin UI.

View File

@@ -4,7 +4,7 @@
Local user accounts and groups can be created in NetBox under the "Authentication and Authorization" section of the administrative user interface. This interface is available only to users with the "staff" permission enabled.
At a minimum, each user account must have a username and password set. User accounts may also denote a first name, last name, and email address. [Permissions](./permissions.md) may also be assigned to users and/or groups within the admin UI.
At a minimum, each user account must have a username and password set. User accounts may also denote a first name, last name, and email address. [Permissions](../permissions.md) may also be assigned to users and/or groups within the admin UI.
## Remote Authentication
@@ -16,7 +16,7 @@ NetBox may be configured to provide user authenticate via a remote backend in ad
REMOTE_AUTH_BACKEND = 'netbox.authentication.LDAPBackend'
```
NetBox includes an authentication backend which supports LDAP. See the [LDAP installation docs](../installation/6-ldap.md) for more detail about this backend.
NetBox includes an authentication backend which supports LDAP. See the [LDAP installation docs](../../installation/6-ldap.md) for more detail about this backend.
### HTTP Header Authentication
@@ -34,4 +34,4 @@ REMOTE_AUTH_BACKEND = 'social_core.backends.google.GoogleOAuth2'
NetBox supports single sign-on authentication via the [python-social-auth](https://github.com/python-social-auth) library. To enable SSO, specify the path to the desired authentication backend within the `social_core` Python package. Please see the complete list of [supported authentication backends](https://github.com/python-social-auth/social-core/tree/master/social_core/backends) for the available options.
Most remote authentication backends require some additional configuration through settings prefixed with `SOCIAL_AUTH_`. These will be automatically imported from NetBox's `configuration.py` file. Additionally, the [authentication pipeline](https://python-social-auth.readthedocs.io/en/latest/pipeline.html) can be customized via the `SOCIAL_AUTH_PIPELINE` parameter.
Most remote authentication backends require some additional configuration through settings prefixed with `SOCIAL_AUTH_`. These will be automatically imported from NetBox's `configuration.py` file. Additionally, the [authentication pipeline](https://python-social-auth.readthedocs.io/en/latest/pipeline.html) can be customized via the `SOCIAL_AUTH_PIPELINE` parameter. (NetBox's default pipeline is defined in `netbox/settings.py` for your reference.)

View File

@@ -0,0 +1,46 @@
# Error Reporting
## Sentry
### Enabling Error Reporting
NetBox v3.2.3 and later support native integration with [Sentry](https://sentry.io/) for automatic error reporting. To enable this functionality, simply set `SENTRY_ENABLED` to True in `configuration.py`. Errors will be sent to a Sentry ingestor maintained by the NetBox team for analysis.
```python
SENTRY_ENABLED = True
```
### Using a Custom DSN
If you prefer instead to use your own Sentry ingestor, you'll need to first create a new project under your Sentry account to represent your NetBox deployment and obtain its corresponding data source name (DSN). This looks like a URL similar to the example below:
```
https://examplePublicKey@o0.ingest.sentry.io/0
```
Once you have obtained a DSN, configure Sentry in NetBox's `configuration.py` file with the following parameters:
```python
SENTRY_ENABLED = True
SENTRY_DSN = "https://examplePublicKey@o0.ingest.sentry.io/0"
```
### Assigning Tags
You can optionally attach one or more arbitrary tags to the outgoing error reports if desired by setting the `SENTRY_TAGS` parameter:
```python
SENTRY_TAGS = {
"custom.foo": "123",
"custom.bar": "abc",
}
```
!!! warning "Reserved tag prefixes"
Avoid using any tag names which begin with `netbox.`, as this prefix is reserved by the NetBox application.
### Testing
Once the configuration has been saved, restart the NetBox service.
To test Sentry operation, try generating a 404 (page not found) error by navigating to an invalid URL, such as `https://netbox/404-error-testing`. (Be sure that debug mode has been disabled.) After receiving a 404 response from the NetBox server, you should see the issue appear shortly in Sentry.

View File

@@ -3,7 +3,8 @@
NetBox includes a `housekeeping` management command that should be run nightly. This command handles:
* Clearing expired authentication sessions from the database
* Deleting changelog records older than the configured [retention time](../configuration/optional-settings.md#changelog_retention)
* Deleting changelog records older than the configured [retention time](../configuration/dynamic-settings.md#changelog_retention)
* Deleting job result records older than the configured [retention time](../configuration/dynamic-settings.md#jobresult_retention)
This command can be invoked directly, or by using the shell script provided at `/opt/netbox/contrib/netbox-housekeeping.sh`. This script can be linked from your cron scheduler's daily jobs directory (e.g. `/etc/cron.daily`) or referenced directly within the cron configuration file.

View File

@@ -4,7 +4,7 @@ NetBox v2.9 introduced a new object-based permissions framework, which replaces
{!models/users/objectpermission.md!}
### Example Constraint Definitions
#### Example Constraint Definitions
| Constraints | Description |
| ----------- | ----------- |

View File

@@ -66,6 +66,22 @@ CUSTOM_VALIDATORS = {
---
## DEFAULT_USER_PREFERENCES
This is a dictionary defining the default preferences to be set for newly-created user accounts. For example, to set the default page size for all users to 100, define the following:
```python
DEFAULT_USER_PREFERENCES = {
"pagination": {
"per_page": 100
}
}
```
For a complete list of available preferences, log into NetBox and navigate to `/user/preferences/`. A period in a preference name indicates a level of nesting in the JSON data. The example above maps to `pagination.per_page`.
---
## ENFORCE_GLOBAL_UNIQUE
Default: False
@@ -82,6 +98,18 @@ Setting this to False will disable the GraphQL API.
---
## JOBRESULT_RETENTION
Default: 90
The number of days to retain job results (scripts and reports). Set this to `0` to retain
job results in the database indefinitely.
!!! warning
If enabling indefinite job results retention, it is recommended to periodically delete old entries. Otherwise, the database may eventually exceed capacity.
---
## MAINTENANCE_MODE
Default: False
@@ -157,6 +185,30 @@ The default maximum number of objects to display per page within each list of ob
---
## POWERFEED_DEFAULT_AMPERAGE
Default: 15
The default value for the `amperage` field when creating new power feeds.
---
## POWERFEED_DEFAULT_MAX_UTILIZATION
Default: 80
The default value (percentage) for the `max_utilization` field when creating new power feeds.
---
## POWERFEED_DEFAULT_VOLTAGE
Default: 120
The default value for the `voltage` field when creating new power feeds.
---
## PREFER_IPV4
Default: False

View File

@@ -0,0 +1,54 @@
# Error Reporting Settings
## SENTRY_DSN
Default: None
Defines a Sentry data source name (DSN) for automated error reporting. `SENTRY_ENABLED` must be True for this parameter to take effect. For example:
```
SENTRY_DSN = "https://examplePublicKey@o0.ingest.sentry.io/0"
```
---
## SENTRY_ENABLED
Default: False
Set to True to enable automatic error reporting via [Sentry](https://sentry.io/).
---
## SENTRY_SAMPLE_RATE
Default: 1.0 (all)
The sampling rate for errors. Must be a value between 0 (disabled) and 1.0 (report on all errors).
---
## SENTRY_TAGS
An optional dictionary of tag names and values to apply to Sentry error reports.For example:
```
SENTRY_TAGS = {
"custom.foo": "123",
"custom.bar": "abc",
}
```
!!! warning "Reserved tag prefixes"
Avoid using any tag names which begin with `netbox.`, as this prefix is reserved by the NetBox application.
---
## SENTRY_TRACES_SAMPLE_RATE
Default: 0 (disabled)
The sampling rate for transactions. Must be a value between 0 (disabled) and 1.0 (report on all transactions).
!!! warning "Consider performance implications"
A high sampling rate for transactions can induce significant performance penalties. If transaction reporting is desired, it is recommended to use a relatively low sample rate of 10% to 20% (0.1 to 0.2).

View File

@@ -1,6 +1,11 @@
# NetBox Configuration
NetBox's local configuration is stored in `$INSTALL_ROOT/netbox/netbox/configuration.py`. An example configuration is provided as `configuration.example.py`. You may copy or rename the example configuration and make changes as appropriate. NetBox will not run without a configuration file. While NetBox has many configuration settings, only a few of them must be defined at the time of installation: these are defined under "required settings" below.
NetBox's local configuration is stored in `$INSTALL_ROOT/netbox/netbox/configuration.py` by default. An example configuration is provided as `configuration_example.py`. You may copy or rename the example configuration and make changes as appropriate. NetBox will not run without a configuration file. While NetBox has many configuration settings, only a few of them must be defined at the time of installation: these are defined under "required settings" below.
!!! info "Customizing the Configuration Module"
A custom configuration module may be specified by setting the `NETBOX_CONFIGURATION` environment variable. This must be a dotted path to the desired Python module. For example, a file named `my_config.py` in the same directory as `settings.py` would be referenced as `netbox.my_config`.
For the sake of brevity, the NetBox documentation refers to the configuration file simply as `configuration.py`.
Some configuration parameters may alternatively be defined either in `configuration.py` or within the administrative section of the user interface. Settings which are "hard-coded" in the configuration file take precedence over those defined via the UI.

View File

@@ -13,6 +13,23 @@ ADMINS = [
---
## AUTH_PASSWORD_VALIDATORS
This parameter acts as a pass-through for configuring Django's built-in password validators for local user accounts. If configured, these will be applied whenever a user's password is updated to ensure that it meets minimum criteria such as length or complexity. An example is provided below. For more detail on the available options, please see [the Django documentation](https://docs.djangoproject.com/en/stable/topics/auth/passwords/#password-validation).
```python
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
'OPTIONS': {
'min_length': 10,
}
},
]
```
---
## BASE_PATH
Default: None
@@ -49,6 +66,29 @@ CORS_ORIGIN_WHITELIST = [
---
## CSRF_COOKIE_NAME
Default: `csrftoken`
The name of the cookie to use for the cross-site request forgery (CSRF) authentication token. See the [Django documentation](https://docs.djangoproject.com/en/stable/ref/settings/#csrf-cookie-name) for more detail.
---
## CSRF_TRUSTED_ORIGINS
Default: `[]`
Defines a list of trusted origins for unsafe (e.g. `POST`) requests. This is a pass-through to Django's [`CSRF_TRUSTED_ORIGINS`](https://docs.djangoproject.com/en/4.0/ref/settings/#std:setting-CSRF_TRUSTED_ORIGINS) setting. Note that each host listed must specify a scheme (e.g. `http://` or `https://).
```python
CSRF_TRUSTED_ORIGINS = (
'http://netbox.local',
'https://netbox.local',
)
```
---
## DEBUG
Default: False
@@ -140,6 +180,68 @@ EXEMPT_VIEW_PERMISSIONS = ['*']
---
## FIELD_CHOICES
Some static choice fields on models can be configured with custom values. This is done by defining `FIELD_CHOICES` as a dictionary mapping model fields to their choices. Each choice in the list must have a database value and a human-friendly label, and may optionally specify a color. (A list of available colors is provided below.)
The choices provided can either replace the stock choices provided by NetBox, or append to them. To _replace_ the available choices, specify the app, model, and field name separated by dots. For example, the site model would be referenced as `dcim.Site.status`. To _extend_ the available choices, append a plus sign to the end of this string (e.g. `dcim.Site.status+`).
For example, the following configuration would replace the default site status choices with the options Foo, Bar, and Baz:
```python
FIELD_CHOICES = {
'dcim.Site.status': (
('foo', 'Foo', 'red'),
('bar', 'Bar', 'green'),
('baz', 'Baz', 'blue'),
)
}
```
Appending a plus sign to the field identifier would instead _add_ these choices to the ones already offered:
```python
FIELD_CHOICES = {
'dcim.Site.status+': (
...
)
}
```
The following model fields support configurable choices:
* `circuits.Circuit.status`
* `dcim.Device.status`
* `dcim.Location.status`
* `dcim.PowerFeed.status`
* `dcim.Rack.status`
* `dcim.Site.status`
* `extras.JournalEntry.kind`
* `ipam.IPAddress.status`
* `ipam.IPRange.status`
* `ipam.Prefix.status`
* `ipam.VLAN.status`
* `virtualization.Cluster.status`
* `virtualization.VirtualMachine.status`
The following colors are supported:
* `blue`
* `indigo`
* `purple`
* `pink`
* `red`
* `orange`
* `yellow`
* `green`
* `teal`
* `cyan`
* `gray`
* `black`
* `white`
---
## HTTP_PROXIES
Default: None
@@ -155,6 +257,23 @@ HTTP_PROXIES = {
---
## JINJA2_FILTERS
Default: `{}`
A dictionary of custom jinja2 filters with the key being the filter name and the value being a callable. For more information see the [Jinja2 documentation](https://jinja.palletsprojects.com/en/3.1.x/api/#custom-filters). For example:
```python
def uppercase(x):
return str(x).upper()
JINJA2_FILTERS = {
'uppercase': uppercase,
}
```
---
## INTERNAL_IPS
Default: `('127.0.0.1', '::1')`

View File

@@ -35,7 +35,7 @@ The list of groups to assign a new user account when created using remote authen
Default: `{}` (Empty dictionary)
A mapping of permissions to assign a new user account when created using remote authentication. Each key in the dictionary should be set to a dictionary of the attributes to be applied to the permission, or `None` to allow all objects. (Requires `REMOTE_AUTH_ENABLED`.)
A mapping of permissions to assign a new user account when created using remote authentication. Each key in the dictionary should be set to a dictionary of the attributes to be applied to the permission, or `None` to allow all objects. (Requires `REMOTE_AUTH_ENABLED` as True and `REMOTE_AUTH_GROUP_SYNC_ENABLED` as False.)
---
@@ -43,7 +43,7 @@ A mapping of permissions to assign a new user account when created using remote
Default: `False`
NetBox can be configured to support remote user authentication by inferring user authentication from an HTTP header set by the HTTP reverse proxy (e.g. nginx or Apache). Set this to `True` to enable this functionality. (Local authentication will still take effect as a fallback.)
NetBox can be configured to support remote user authentication by inferring user authentication from an HTTP header set by the HTTP reverse proxy (e.g. nginx or Apache). Set this to `True` to enable this functionality. (Local authentication will still take effect as a fallback.) (`REMOTE_AUTH_DEFAULT_GROUPS` will not function if `REMOTE_AUTH_ENABLED` is disabled)
---

View File

@@ -37,4 +37,5 @@ Once component templates have been created, every new device that you create as
{!models/dcim/interfacetemplate.md!}
{!models/dcim/frontporttemplate.md!}
{!models/dcim/rearporttemplate.md!}
{!models/dcim/modulebaytemplate.md!}
{!models/dcim/devicebaytemplate.md!}

View File

@@ -17,6 +17,7 @@ Device components represent discrete objects within a device which are used to t
{!models/dcim/interface.md!}
{!models/dcim/frontport.md!}
{!models/dcim/rearport.md!}
{!models/dcim/modulebay.md!}
{!models/dcim/devicebay.md!}
{!models/dcim/inventoryitem.md!}

View File

@@ -21,7 +21,13 @@
---
{!models/ipam/fhrpgroup.md!}
{!models/ipam/fhrpgroupassignment.md!}
---
{!models/ipam/asn.md!}
---
{!models/ipam/l2vpn.md!}
{!models/ipam/l2vpntermination.md!}

View File

@@ -0,0 +1,4 @@
# Modules
{!models/dcim/moduletype.md!}
{!models/dcim/module.md!}

View File

@@ -1,3 +1,4 @@
# Service Mapping
{!models/ipam/servicetemplate.md!}
{!models/ipam/service.md!}

View File

@@ -77,6 +77,10 @@ This is the human-friendly names of your script. If omitted, the class name will
A human-friendly description of what your script does.
### `field_order`
By default, script variables will be ordered in the form as they are defined in the script. `field_order` may be defined as an iterable of field names to determine the order in which variables are rendered. Any fields not included in this iterable be listed last.
### `commit_default`
The checkbox to commit database changes when executing a script is checked by default. Set `commit_default` to False under the script's Meta class to leave this option unchecked by default.
@@ -85,6 +89,12 @@ The checkbox to commit database changes when executing a script is checked by de
commit_default = False
```
### `job_timeout`
Set the maximum allowed runtime for the script. If not set, `RQ_DEFAULT_TIMEOUT` will be used.
!!! info "This feature was introduced in v3.2.1"
## Accessing Request Data
Details of the current HTTP request (the one being made to execute the script) are available as the instance attribute `self.request`. This can be used to infer, for example, the user executing the script and the client IP address:

View File

@@ -50,7 +50,7 @@ The `fail()` method may optionally specify a field with which to associate the s
## Assigning Custom Validators
Custom validators are associated with specific NetBox models under the [CUSTOM_VALIDATORS](../configuration/optional-settings.md#custom_validators) configuration parameter. There are three manners by which custom validation rules can be defined:
Custom validators are associated with specific NetBox models under the [CUSTOM_VALIDATORS](../configuration/dynamic-settings.md#custom_validators) configuration parameter. There are three manners by which custom validation rules can be defined:
1. Plain JSON mapping (no custom logic)
2. Dotted path to a custom validator class
@@ -105,11 +105,11 @@ from my_validators import Validator1, Validator2, Validator3
CUSTOM_VALIDATORS = {
'dcim.site': (
Validator1,
Validator2,
Validator1(),
Validator2(),
),
'dcim.device': (
Validator3,
Validator3(),
)
}
```

View File

@@ -85,6 +85,20 @@ As you can see, reports are completely customizable. Validation logic can be as
!!! warning
Reports should never alter data: If you find yourself using the `create()`, `save()`, `update()`, or `delete()` methods on objects within reports, stop and re-evaluate what you're trying to accomplish. Note that there are no safeguards against the accidental alteration or destruction of data.
## Report Attributes
### `description`
A human-friendly description of what your report does.
### `job_timeout`
Set the maximum allowed runtime for the report. If not set, `RQ_DEFAULT_TIMEOUT` will be used.
!!! info "This feature was introduced in v3.2.1"
## Logging
The following methods are available to log results within a report:
* log(message)
@@ -95,7 +109,7 @@ The following methods are available to log results within a report:
The recording of one or more failure messages will automatically flag a report as failed. It is advised to log a success for each object that is evaluated so that the results will reflect how many objects are being reported on. (The inclusion of a log message is optional for successes.) Messages recorded with `log()` will appear in a report's results but are not associated with a particular object or status. Log messages also support using markdown syntax and will be rendered on the report result page.
To perform additional tasks, such as sending an email or calling a webhook, after a report has been run, extend the `post_run()` method. The status of the report is available as `self.failed` and the results object is `self.result`.
To perform additional tasks, such as sending an email or calling a webhook, before or after a report is run, extend the `pre_run()` and/or `post_run()` methods, respectively. The status of a completed report is available as `self.failed` and the results object is `self.result`.
By default, reports within a module are ordered alphabetically in the reports list page. To return reports in a specific order, you can define the `report_order` variable at the end of your module. The `report_order` variable is a tuple which contains each Report class in the desired order. Any reports that are omitted from this list will be listed last.

View File

@@ -2,7 +2,7 @@
## 1. Define the model class
Models within each app are stored in either `models.py` or within a submodule under the `models/` directory. When creating a model, be sure to subclass the [appropriate base model](models.md) from `netbox.models`. This will typically be PrimaryModel or OrganizationalModel. Remember to add the model class to the `__all__` listing for the module.
Models within each app are stored in either `models.py` or within a submodule under the `models/` directory. When creating a model, be sure to subclass the [appropriate base model](models.md) from `netbox.models`. This will typically be NetBoxModel or OrganizationalModel. Remember to add the model class to the `__all__` listing for the module.
Each model should define, at a minimum:
@@ -37,23 +37,32 @@ Most models will need view classes created in `views.py` to serve the following
Add the relevant URL path for each view created in the previous step to `urls.py`.
## 6. Create the FilterSet
## 6. Add relevant forms
Depending on the type of model being added, you may need to define several types of form classes. These include:
* A base model form (for creating/editing individual objects)
* A bulk edit form
* A bulk import form (for CSV-based import)
* A filterset form (for filtering the object list view)
## 7. Create the FilterSet
Each model should have a corresponding FilterSet class defined. This is used to filter UI and API queries. Subclass the appropriate class from `netbox.filtersets` that matches the model's parent class.
## 7. Create the table class
## 8. Create the table class
Create a table class for the model in `tables.py` by subclassing `utilities.tables.BaseTable`. Under the table's `Meta` class, be sure to list both the fields and default columns.
## 8. Create the object template
## 9. Create the object template
Create the HTML template for the object view. (The other views each typically employ a generic template.) This template should extend `generic/object.html`.
## 9. Add the model to the navigation menu
## 10. Add the model to the navigation menu
Add the relevant navigation menu items in `netbox/netbox/navigation_menu.py`.
## 10. REST API components
## 11. REST API components
Create the following for each model:
@@ -62,13 +71,13 @@ Create the following for each model:
* API view in `api/views.py`
* Endpoint route in `api/urls.py`
## 11. GraphQL API components
## 12. GraphQL API components
Create a Graphene object type for the model in `graphql/types.py` by subclassing the appropriate class from `netbox.graphql.types`.
Also extend the schema class defined in `graphql/schema.py` with the individual object and object list fields per the established convention.
## 12. Add tests
## 13. Add tests
Add tests for the following:
@@ -76,7 +85,7 @@ Add tests for the following:
* API views
* Filter sets
## 13. Documentation
## 14. Documentation
Create a new documentation page for the model in `docs/models/<app_label>/<model_name>.md`. Include this file under the "features" documentation where appropriate.

View File

@@ -11,17 +11,25 @@ Getting started with NetBox development is pretty straightforward, and should fe
### Fork the Repo
Assuming you'll be working on your own fork, your first step will be to fork the [official git repository](https://github.com/netbox-community/netbox). (If you're a maintainer who's going to be working directly with the official repo, skip this step.) You can then clone your GitHub fork locally for development:
Assuming you'll be working on your own fork, your first step will be to fork the [official git repository](https://github.com/netbox-community/netbox). (If you're a maintainer who's going to be working directly with the official repo, skip this step.) Click the "fork" button at top right (be sure that you've logged into GitHub first).
![GitHub fork button](../media/development/github_fork_button.png)
Copy the URL provided in the dialog box.
![GitHub fork dialog](../media/development/github_fork_dialog.png)
You can then clone your GitHub fork locally for development:
```no-highlight
$ git clone https://github.com/youruseraccount/netbox.git
$ git clone https://github.com/$username/netbox.git
Cloning into 'netbox'...
remote: Enumerating objects: 231, done.
remote: Counting objects: 100% (231/231), done.
remote: Compressing objects: 100% (147/147), done.
remote: Total 56705 (delta 134), reused 145 (delta 84), pack-reused 56474
Receiving objects: 100% (56705/56705), 27.96 MiB | 34.92 MiB/s, done.
Resolving deltas: 100% (44177/44177), done.
remote: Enumerating objects: 85949, done.
remote: Counting objects: 100% (4672/4672), done.
remote: Compressing objects: 100% (1224/1224), done.
remote: Total 85949 (delta 3538), reused 4332 (delta 3438), pack-reused 81277
Receiving objects: 100% (85949/85949), 55.16 MiB | 44.90 MiB/s, done.
Resolving deltas: 100% (68008/68008), done.
$ ls netbox/
base_requirements.txt contrib docs mkdocs.yml NOTICE requirements.txt upgrade.sh
CHANGELOG.md CONTRIBUTING.md LICENSE.txt netbox README.md scripts
@@ -33,7 +41,7 @@ The NetBox project utilizes three persistent git branches to track work:
* `develop` - All development on the upcoming stable release occurs here
* `feature` - Tracks work on an upcoming major release
Typically, you'll base pull requests off of the `develop` branch, or off of `feature` if you're working on a new major release. **Never** merge pull requests into the `master` branch, which receives merged only from the `develop` branch.
Typically, you'll base pull requests off of the `develop` branch, or off of `feature` if you're working on a new major release. **Never** merge pull requests into the `master` branch: This branch only ever merges pull requests from the `develop` branch, to effect a new release.
For example, assume that the current NetBox release is v3.1.1. Work applied to the `develop` branch will appear in v3.1.2, and work done under the `feature` branch will be included in the next minor release (v3.2.0).
@@ -60,7 +68,7 @@ $ python3 -m venv ~/.venv/netbox
This will create a directory named `.venv/netbox/` in your home directory, which houses a virtual copy of the Python executable and its related libraries and tooling. When running NetBox for development, it will be run using the Python binary at `~/.venv/netbox/bin/python`.
!!! info "Where to Create Your Virtual Environments"
Keeping virtual environments in `~/.venv/` is a common convention but entirely optional: Virtual environments can be created almost wherever you please.
Keeping virtual environments in `~/.venv/` is a common convention but entirely optional: Virtual environments can be created almost wherever you please. Also consider using [`virtualenvwrapper`](https://virtualenvwrapper.readthedocs.io/en/stable/) to simplify the management of multiple venvs.
Once created, activate the virtual environment:
@@ -85,7 +93,7 @@ Collecting Django==3.1 (from -r requirements.txt (line 1))
### Configure NetBox
Within the `netbox/netbox/` directory, copy `configuration.example.py` to `configuration.py` and update the following parameters:
Within the `netbox/netbox/` directory, copy `configuration_example.py` to `configuration.py` and update the following parameters:
* `ALLOWED_HOSTS`: This can be set to `['*']` for development purposes
* `DATABASE`: PostgreSQL database connection parameters
@@ -99,12 +107,13 @@ Within the `netbox/netbox/` directory, copy `configuration.example.py` to `confi
Django provides a lightweight, auto-updating HTTP/WSGI server for development use. It is started with the `runserver` management command:
```no-highlight
$ python netbox/manage.py runserver
$ ./manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
November 18, 2020 - 15:52:31
Django version 3.1, using settings 'netbox.settings'
February 18, 2022 - 20:29:57
Django version 4.0.2, using settings 'netbox.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
```
@@ -114,26 +123,44 @@ This ensures that your development environment is now complete and operational.
!!! info "IDE Integration"
Some IDEs, such as PyCharm, will integrate with Django's development server and allow you to run it directly within the IDE. This is strongly encouraged as it makes for a much more convenient development environment.
## Populating Demo Data
Once you have your development environment up and running, it might be helpful to populate some "dummy" data to make interacting with the UI and APIs more convenient. Check out the [netbox-demo-data](https://github.com/netbox-community/netbox-demo-data) repo on GitHub, which houses a collection of sample data that can be easily imported to any new NetBox deployment. (This sample data is used to populate the public demo instance at <https://demo.netbox.dev>.)
The demo data is provided in JSON format and loaded into an empty database using Django's `loaddata` management command. Consult the demo data repo's `README` file for complete instructions on populating the data.
## Running Tests
Prior to committing any substantial changes to the code base, be sure to run NetBox's test suite to catch any potential errors. Tests are run using the `test` management command. Remember to ensure the Python virtual environment is active before running this command.
Prior to committing any substantial changes to the code base, be sure to run NetBox's test suite to catch any potential errors. Tests are run using the `test` management command, which employs Python's [`unittest`](https://docs.python.org/3/library/unittest.html#module-unittest) library. Remember to ensure the Python virtual environment is active before running this command. Also keep in mind that these commands are executed in the `netbox/` directory, not the root directory of the repository.
To avoid potential issues with your local configuration file, set the `NETBOX_CONFIGURATION` to point to the packaged test configuration at `netbox/configuration_testing.py`. This will handle things like ensuring that the dummy plugin is enabled for comprehensive testing.
```no-highlight
$ python netbox/manage.py test
$ export NETBOX_CONFIGURATION=netbox.configuration_testing
$ cd netbox/
$ python manage.py test
```
In cases where you haven't made any changes to the database (which is most of the time), you can append the `--keepdb` argument to this command to reuse the test database between runs. This cuts down on the time it takes to run the test suite since the database doesn't have to be rebuilt each time. (Note that this argument will cause errors if you've modified any model fields since the previous test run.)
In cases where you haven't made any changes to the database schema (which is typical), you can append the `--keepdb` argument to this command to reuse the test database between runs. This cuts down on the time it takes to run the test suite since the database doesn't have to be rebuilt each time. (Note that this argument will cause errors if you've modified any model fields since the previous test run.)
```no-highlight
$ python netbox/manage.py test --keepdb
$ python manage.py test --keepdb
```
You can also limit the command to running only a specific subset of tests. For example, to run only IPAM and DCIM view tests:
You can also reduce testing time by enabling parallel test execution with the `--parallel` flag. (By default, this will run as many parallel tests as you have processors. To avoid sluggishness, it's a good idea to specify a lower number of parallel tests.) This flag can be combined with `--keepdb`, although if you encounter any strange errors, try running the test suite again with parallelization disabled.
```no-highlight
$ python netbox/manage.py test dcim.tests.test_views ipam.tests.test_views
$ python manage.py test --parallel <n>
```
Finally, it's possible to limit the run to a specific set of tests, specified by their Python path. For example, to run only IPAM and DCIM view tests:
```no-highlight
$ python manage.py test dcim.tests.test_views ipam.tests.test_views
```
This is handy for instances where just a few tests are failing and you want to re-run them individually.
## Submitting Pull Requests
Once you're happy with your work and have verified that all tests pass, commit your changes and push it upstream to your fork. Always provide descriptive (but not excessively verbose) commit messages. When working on a specific issue, be sure to prefix your commit message with the word "Fixes" or "Closes" and the issue number (with a hash mark). This tells GitHub to automatically close the referenced issue once the commit has been merged.

View File

@@ -7,9 +7,8 @@ NetBox is maintained as a [GitHub project](https://github.com/netbox-community/n
There are several official forums for communication among the developers and community members:
* [GitHub issues](https://github.com/netbox-community/netbox/issues) - All feature requests, bug reports, and other substantial changes to the code base **must** be documented in a GitHub issue.
* [GitHub Discussions](https://github.com/netbox-community/netbox/discussions) - The preferred forum for general discussion and support issues. Ideal for shaping a feature request prior to submitting an issue.
* [GitHub discussions](https://github.com/netbox-community/netbox/discussions) - The preferred forum for general discussion and support issues. Ideal for shaping a feature request prior to submitting an issue.
* [#netbox on NetDev Community Slack](https://netdev.chat/) - Good for quick chats. Avoid any discussion that might need to be referenced later on, as the chat history is not retained long.
* [Google Group](https://groups.google.com/g/netbox-discuss) - Legacy mailing list; slowly being phased out in favor of GitHub discussions.
## Governance

View File

@@ -45,6 +45,8 @@ The Django [content types](https://docs.djangoproject.com/en/stable/ref/contrib/
* [ipam.FHRPGroup](../models/ipam/fhrpgroup.md)
* [ipam.IPAddress](../models/ipam/ipaddress.md)
* [ipam.IPRange](../models/ipam/iprange.md)
* [ipam.L2VPN](../models/ipam/l2vpn.md)
* [ipam.L2VPNTermination](../models/ipam/l2vpntermination.md)
* [ipam.Prefix](../models/ipam/prefix.md)
* [ipam.RouteTarget](../models/ipam/routetarget.md)
* [ipam.Service](../models/ipam/service.md)

View File

@@ -8,7 +8,7 @@ Check `base_requirements.txt` for any dependencies pinned to a specific version,
### Link to the Release Notes Page
Add the release notes (`/docs/release-notes/X.Y.md`) to the table of contents within `mkdocs.yml`, and point `index.md` to the new file.
Add the release notes (`/docs/release-notes/X.Y.md`) to the table of contents within `mkdocs.yml`, and add a summary of the major changes to `index.md`.
### Manually Perform a New Install

View File

@@ -4,8 +4,11 @@ The `users.UserConfig` model holds individual preferences for each user in the f
## Available Preferences
| Name | Description |
| ---- | ----------- |
| extras.configcontext.format | Preferred format when rendering config context data (JSON or YAML) |
| pagination.per_page | The number of items to display per page of a paginated table |
| tables.TABLE_NAME.columns | The ordered list of columns to display when viewing the table |
| Name | Description |
|--------------------------|---------------------------------------------------------------|
| data_format | Preferred format when rendering raw data (JSON or YAML) |
| pagination.per_page | The number of items to display per page of a paginated table |
| pagination.placement | Where to display the paginator controls relative to the table |
| tables.${table}.columns | The ordered list of columns to display when viewing the table |
| tables.${table}.ordering | A list of column names by which the table should be ordered |
| ui.colormode | Light or dark mode in the user interface |

View File

@@ -67,4 +67,4 @@ Authorization: Token $TOKEN
## Disabling the GraphQL API
If not needed, the GraphQL API can be disabled by setting the [`GRAPHQL_ENABLED`](../configuration/optional-settings.md#graphql_enabled) configuration parameter to False and restarting NetBox.
If not needed, the GraphQL API can be disabled by setting the [`GRAPHQL_ENABLED`](../configuration/dynamic-settings.md#graphql_enabled) configuration parameter to False and restarting NetBox.

View File

@@ -50,12 +50,14 @@ NetBox is built on the [Django](https://djangoproject.com/) Python framework and
| Application | Django/Python |
| Database | PostgreSQL 10+ |
| Task queuing | Redis/django-rq |
| Live device access | NAPALM |
| Live device access | NAPALM (optional) |
## Supported Python Versions
NetBox supports Python 3.7, 3.8, and 3.9 environments currently. (Support for Python 3.6 was removed in NetBox v3.0.)
NetBox supports Python 3.8, 3.9, and 3.10 environments.
## Getting Started
See the [installation guide](installation/index.md) for help getting NetBox up and running quickly.
Minor NetBox releases (e.g. v3.1) are published three times a year; in April, August, and December. These typically introduce major new features and may contain breaking API changes. Patch releases are published roughly every one to two weeks to resolve bugs and fulfill minor feature requests. These are backward-compatible with previous releases unless otherwise noted. The NetBox maintainers strongly recommend running the latest stable release whenever possible.
Please see the [official installation guide](installation/index.md) for detailed instructions on obtaining and installing NetBox.

View File

@@ -6,8 +6,8 @@ This section of the documentation discusses installing and configuring the NetBo
Begin by installing all system packages required by NetBox and its dependencies.
!!! warning "Python 3.7 or later required"
NetBox v3.0 and v3.1 require Python 3.7, 3.8, or 3.9. It is recommended to install at least Python v3.8, as this will become the minimum supported Python version in NetBox v3.2.
!!! warning "Python 3.8 or later required"
NetBox v3.2 requires Python 3.8, 3.9, or 3.10.
=== "Ubuntu"
@@ -17,16 +17,11 @@ Begin by installing all system packages required by NetBox and its dependencies.
=== "CentOS"
!!! warning
CentOS 8 does not provide Python 3.7 or later via its native package manager. You will need to install it via some other means. [Here is an example](https://tecadmin.net/install-python-3-7-on-centos-8/) of installing Python 3.7 from source.
Once you have Python 3.7 or later installed, install the remaining system packages:
```no-highlight
sudo yum install -y gcc libxml2-devel libxslt-devel libffi-devel libpq-devel openssl-devel redhat-rpm-config
```
Before continuing, check that your installed Python version is at least 3.7:
Before continuing, check that your installed Python version is at least 3.8:
```no-highlight
python3 -V
@@ -117,11 +112,11 @@ Create a system user account named `netbox`. We'll configure the WSGI and HTTP s
## Configuration
Move into the NetBox configuration directory and make a copy of `configuration.example.py` named `configuration.py`. This file will hold all of your local configuration parameters.
Move into the NetBox configuration directory and make a copy of `configuration_example.py` named `configuration.py`. This file will hold all of your local configuration parameters.
```no-highlight
cd /opt/netbox/netbox/netbox/
sudo cp configuration.example.py configuration.py
sudo cp configuration_example.py configuration.py
```
Open `configuration.py` with your preferred editor to begin configuring NetBox. NetBox offers [many configuration parameters](../configuration/index.md), but only the following four are required for new installations:
@@ -234,10 +229,10 @@ Once NetBox has been configured, we're ready to proceed with the actual installa
sudo /opt/netbox/upgrade.sh
```
Note that **Python 3.7 or later is required** for NetBox v3.0 and later releases. If the default Python installation on your server is set to a lesser version, pass the path to the supported installation as an environment variable named `PYTHON`. (Note that the environment variable must be passed _after_ the `sudo` command.)
Note that **Python 3.8 or later is required** for NetBox v3.2 and later releases. If the default Python installation on your server is set to a lesser version, pass the path to the supported installation as an environment variable named `PYTHON`. (Note that the environment variable must be passed _after_ the `sudo` command.)
```no-highlight
sudo PYTHON=/usr/bin/python3.7 /opt/netbox/upgrade.sh
sudo PYTHON=/usr/bin/python3.8 /opt/netbox/upgrade.sh
```
!!! note

View File

@@ -40,7 +40,7 @@ You should see output similar to the following:
● netbox.service - NetBox WSGI Service
Loaded: loaded (/etc/systemd/system/netbox.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2021-08-30 04:02:36 UTC; 14h ago
Docs: https://netbox.readthedocs.io/en/stable/
Docs: https://docs.netbox.dev/
Main PID: 1140492 (gunicorn)
Tasks: 19 (limit: 4683)
Memory: 666.2M

View File

@@ -152,7 +152,7 @@ LOGGING = {
'netbox_auth_log': {
'level': 'DEBUG',
'class': 'logging.handlers.RotatingFileHandler',
'filename': '/opt/netbox/logs/django-ldap-debug.log',
'filename': '/opt/netbox/local/logs/django-ldap-debug.log',
'maxBytes': 1024 * 500,
'backupCount': 5,
},

View File

@@ -11,15 +11,11 @@ The following sections detail how to set up a new instance of NetBox:
5. [HTTP server](5-http-server.md)
6. [LDAP authentication](6-ldap.md) (optional)
The video below demonstrates the installation of NetBox v3.0 on Ubuntu 20.04 for your reference.
<iframe width="560" height="315" src="https://www.youtube.com/embed/7Fpd2-q9_28" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
## Requirements
| Dependency | Minimum Version |
|------------|-----------------|
| Python | 3.7 |
| Python | 3.8 |
| PostgreSQL | 10 |
| Redis | 4.0 |

View File

@@ -39,7 +39,7 @@ You can use the command `systemctl status netbox` to verify that the WSGI servic
● netbox.service - NetBox WSGI Service
Loaded: loaded (/etc/systemd/system/netbox.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2020-10-24 19:23:40 UTC; 25s ago
Docs: https://netbox.readthedocs.io/en/stable/
Docs: https://docs.netbox.dev/
Main PID: 11993 (gunicorn)
Tasks: 6 (limit: 2362)
CGroup: /system.slice/netbox.service

View File

@@ -6,11 +6,11 @@ Prior to upgrading your NetBox instance, be sure to carefully review all [releas
## Update Dependencies to Required Versions
NetBox v3.0 and later requires the following:
NetBox v3.0 and later require the following:
| Dependency | Minimum Version |
|------------|-----------------|
| Python | 3.7 |
| Python | 3.8 |
| PostgreSQL | 10 |
| Redis | 4.0 |
@@ -67,6 +67,11 @@ sudo git checkout master
sudo git pull origin master
```
!!! info "Checking out an older release"
If you need to upgrade to an older version rather than the current stable release, you can check out any valid [git tag](https://github.com/netbox-community/netbox/tags), each of which represents a release. For example, to checkout the code for NetBox v2.11.11, do:
sudo git checkout v2.11.11
## Run the Upgrade Script
Once the new code is in place, verify that any optional Python packages required by your deployment (e.g. `napalm` or `django-auth-ldap`) are listed in `local_requirements.txt`. Then, run the upgrade script:
@@ -76,10 +81,10 @@ sudo ./upgrade.sh
```
!!! warning
If the default version of Python is not at least 3.7, you'll need to pass the path to a supported Python version as an environment variable when calling the upgrade script. For example:
If the default version of Python is not at least 3.8, you'll need to pass the path to a supported Python version as an environment variable when calling the upgrade script. For example:
```no-highlight
sudo PYTHON=/usr/bin/python3.7 ./upgrade.sh
sudo PYTHON=/usr/bin/python3.8 ./upgrade.sh
```
This script performs the following actions:

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -13,7 +13,7 @@ Each circuit is also assigned one of the following operational statuses:
* Deprovisioning
* Decommissioned
Circuits also have optional fields for annotating their installation date and commit rate, and may be assigned to NetBox tenants.
Circuits also have optional fields for annotating their installation and termination dates and commit rate, and may be assigned to NetBox tenants.
!!! note
NetBox currently models only physical circuits: those which have exactly two endpoints. It is common to layer virtualized constructs (_virtual circuits_) such as MPLS or EVPN tunnels on top of these, however NetBox does not yet support virtual circuit modeling.

View File

@@ -2,4 +2,4 @@
This model can be used to represent the boundary of a provider network, the details of which are unknown or unimportant to the NetBox user. For example, it might represent a provider's regional MPLS network to which multiple circuits provide connectivity.
Each provider network must be assigned to a provider. A circuit may terminate to either a provider network or to a site.
Each provider network must be assigned to a provider, and may optionally be assigned an arbitrary service ID. A circuit may terminate to either a provider network or to a site.

View File

@@ -5,4 +5,4 @@ Device bays represent a space or slot within a parent device in which a child de
Child devices are first-class Devices in their own right: That is, they are fully independent managed entities which don't share any control plane with the parent. Just like normal devices, child devices have their own platform (OS), role, tags, and components. LAG interfaces may not group interfaces belonging to different child devices.
!!! note
Device bays are **not** suitable for modeling line cards (such as those commonly found in chassis-based routers and switches), as these components depend on the control plane of the parent device to operate. Instead, line cards and similarly non-autonomous hardware should be modeled as inventory items within a device, with any associated interfaces or other components assigned directly to the device.
Device bays are **not** suitable for modeling line cards (such as those commonly found in chassis-based routers and switches), as these components depend on the control plane of the parent device to operate. Instead, these should be modeled as modules installed within module bays.

View File

@@ -1,3 +1,3 @@
## Device Bay Templates
A template for a device bay that will be created on all instantiations of the parent device type.
A template for a device bay that will be created on all instantiations of the parent device type. Device bays hold child devices, such as blade servers.

View File

@@ -4,13 +4,13 @@ A device type represents a particular make and model of hardware that exists in
Device types are instantiated as devices installed within sites and/or equipment racks. For example, you might define a device type to represent a Juniper EX4300-48T network switch with 48 Ethernet interfaces. You can then create multiple _instances_ of this type named "switch1," "switch2," and so on. Each device will automatically inherit the components (such as interfaces) of its device type at the time of creation. However, changes made to a device type will **not** apply to instances of that device type retroactively.
Some devices house child devices which share physical resources, like space and power, but which functional independently from one another. A common example of this is blade server chassis. Each device type is designated as one of the following:
Some devices house child devices which share physical resources, like space and power, but which function independently. A common example of this is blade server chassis. Each device type is designated as one of the following:
* A parent device (which has device bays)
* A child device (which must be installed within a device bay)
* Neither
!!! note
This parent/child relationship is **not** suitable for modeling chassis-based devices, wherein child members share a common control plane. Instead, line cards and similarly non-autonomous hardware should be modeled as inventory items within a device, with any associated interfaces or other components assigned directly to the device.
This parent/child relationship is **not** suitable for modeling chassis-based devices, wherein child members share a common control plane. Instead, line cards and similarly non-autonomous hardware should be modeled as modules or inventory items within a device.
A device type may optionally specify an airflow direction, such as front-to-rear, rear-to-front, or passive. Airflow direction may also be set separately per device. If it is not defined for a device at the time of its creation, it will inherit the airflow setting of its device type.

View File

@@ -1,6 +1,6 @@
## Interfaces
Interfaces in NetBox represent network interfaces used to exchange data with connected devices. On modern networks, these are most commonly Ethernet, but other types are supported as well. Each interface must be assigned a type, and may optionally be assigned a MAC address, MTU, and IEEE 802.1Q mode (tagged or access). Each interface can also be enabled or disabled, and optionally designated as management-only (for out-of-band management).
Interfaces in NetBox represent network interfaces used to exchange data with connected devices. On modern networks, these are most commonly Ethernet, but other types are supported as well. Each interface must be assigned a type, and may optionally be assigned a MAC address, MTU, and IEEE 802.1Q mode (tagged or access). Each interface can also be enabled or disabled, and optionally designated as management-only (for out-of-band management). Additionally, each interface may optionally be assigned to a VRF.
!!! note
Although devices and virtual machines both can have interfaces, a separate model is used for each. Thus, device interfaces have some properties that are not present on virtual machine interfaces and vice versa.
@@ -11,6 +11,13 @@ Interfaces may be physical or virtual in nature, but only physical interfaces ma
Physical interfaces may be arranged into a link aggregation group (LAG) and associated with a parent LAG (virtual) interface. LAG interfaces can be recursively nested to model bonding of trunk groups. Like all virtual interfaces, LAG interfaces cannot be connected physically.
### Power over Ethernet (PoE)
!!! note
This feature was added in NetBox v3.3.
Physical interfaces can be assigned a PoE mode to indicate PoE capability: power supplying equipment (PSE) or powered device (PD). Additionally, a PoE mode may be specified. This can be one of the listed IEEE 802.3 standards, or a passive setting (24 or 48 volts across two or four pairs).
### Wireless Interfaces
Wireless interfaces may additionally track the following attributes:

View File

@@ -1,3 +1,3 @@
## Interface Templates
A template for a network interface that will be created on all instantiations of the parent device type. Each interface may be assigned a physical or virtual type, and may be designated as "management-only."
A template for a network interface that will be created on all instantiations of the parent device type. Each interface may be assigned a physical or virtual type, and may be designated as "management-only." Power over Ethernet (PoE) mode and type may also be assigned to interface templates.

View File

@@ -1,7 +1,7 @@
# Inventory Items
Inventory items represent hardware components installed within a device, such as a power supply or CPU or line card. Inventory items are distinct from other device components in that they cannot be templatized on a device type, and cannot be connected by cables. They are intended to be used primarily for inventory purposes.
Inventory items represent hardware components installed within a device, such as a power supply or CPU or line card. They are intended to be used primarily for inventory purposes.
Each inventory item can be assigned a manufacturer, part ID, serial number, and asset tag (all optional). A boolean toggle is also provided to indicate whether each item was entered manually or discovered automatically (by some process outside of NetBox).
Each inventory item can be assigned a functional role, manufacturer, part ID, serial number, and asset tag (all optional). A boolean toggle is also provided to indicate whether each item was entered manually or discovered automatically (by some process outside NetBox).
Inventory items are hierarchical in nature, such that any individual item may be designated as the parent for other items. For example, an inventory item might be created to represent a line card which houses several SFP optics, each of which exists as a child item within the device.
Inventory items are hierarchical in nature, such that any individual item may be designated as the parent for other items. For example, an inventory item might be created to represent a line card which houses several SFP optics, each of which exists as a child item within the device. An inventory item may also be associated with a specific component within the same device. For example, you may wish to associate a transceiver with an interface.

View File

@@ -0,0 +1,3 @@
# Inventory Item Roles
Inventory items can be organized by functional roles, which are fully customizable by the user. For example, you might create roles for power supplies, fans, interface optics, etc.

View File

@@ -0,0 +1,3 @@
# Inventory Item Templates
A template for an inventory item that will be automatically created when instantiating a new device. All attributes of this object will be copied to the new inventory item, including the associations with a parent item and assigned component, if any.

View File

@@ -2,5 +2,4 @@
Racks and devices can be grouped by location within a site. A location may represent a floor, room, cage, or similar organizational unit. Locations can be nested to form a hierarchy. For example, you may have floors within a site, and rooms within a floor.
Each location must have a name that is unique within its parent site and location, if any.
Each location must have a name that is unique within its parent site and location, if any, and must be assigned an operational status. (The set of available statuses is configurable.)

View File

@@ -0,0 +1,5 @@
# Modules
A module is a field-replaceable hardware component installed within a device which houses its own child components. The most common example is a chassis-based router or switch.
Similar to devices, modules are instantiated from module types, and any components associated with the module type are automatically instantiated on the new model. Each module must be installed within a module bay on a device, and each module bay may have only one module installed in it. A module may optionally be assigned a serial number and asset tag.

View File

@@ -0,0 +1,3 @@
## Module Bays
Module bays represent a space or slot within a device in which a field-replaceable module may be installed. A common example is that of a chassis-based switch such as the Cisco Nexus 9000 or Juniper EX9200. Modules in turn hold additional components that become available to the parent device.

View File

@@ -0,0 +1,3 @@
## Module Bay Templates
A template for a module bay that will be created on all instantiations of the parent device type. Module bays hold installed modules that do not have an independent management plane, such as line cards.

View File

@@ -0,0 +1,23 @@
# Module Types
A module type represent a specific make and model of hardware component which is installable within a device and has its own child components. For example, consider a chassis-based switch or router with a number of field-replaceable line cards. Each line card has its own model number and includes a certain set of components such as interfaces. Each module type may have a manufacturer, model number, and part number assigned to it.
Similar to device types, each module type can have any of the following component templates associated with it:
* Interfaces
* Console ports
* Console server ports
* Power ports
* Power Outlets
* Front pass-through ports
* Rear pass-through ports
Note that device bays and module bays may _not_ be added to modules.
## Automatic Component Renaming
When adding component templates to a module type, the string `{module}` can be used to reference the `position` field of the module bay into which an instance of the module type is being installed.
For example, you can create a module type with interface templates named `Gi{module}/0/[1-48]`. When a new module of this type is "installed" to a module bay with a position of "3", NetBox will automatically name these interfaces `Gi3/0/[1-48]`.
Automatic renaming is supported for all modular component types (those listed above).

View File

@@ -2,7 +2,8 @@
A virtual chassis represents a set of devices which share a common control plane. A common example of this is a stack of switches which are connected and configured to operate as a single device. A virtual chassis must be assigned a name and may be assigned a domain.
Each device in the virtual chassis is referred to as a VC member, and assigned a position and (optionally) a priority. VC member devices commonly reside within the same rack, though this is not a requirement. One of the devices may be designated as the VC master: This device will typically be assigned a name, services, and other attributes related to managing the VC.
Each device in the virtual chassis is referred to as a VC member, and assigned a position and (optionally) a priority. VC member devices commonly reside within the same rack, though this is not a requirement. One of the devices may be designated as the VC master: This device will typically be assigned a name, services, virtual interfaces, and other attributes related to managing the VC.
If a VC master is defined, interfaces from all VC members are displayed when navigating to its device interfaces view. This does not include other members interfaces declared as management-only.
!!! note
It's important to recognize the distinction between a virtual chassis and a chassis-based device. A virtual chassis is **not** suitable for modeling a chassis-based switch with removable line cards (such as the Juniper EX9208), as its line cards are _not_ physically autonomous devices.

View File

@@ -5,9 +5,11 @@ Sometimes it is desirable to associate additional data with a group of devices o
* Region
* Site group
* Site
* Location (devices only)
* Device type (devices only)
* Role
* Platform
* Cluster type (VMs only)
* Cluster group (VMs only)
* Cluster (VMs only)
* Tenant group

View File

@@ -10,7 +10,7 @@ Within the database, custom fields are stored as JSON data directly alongside ea
Custom fields may be created by navigating to Customization > Custom Fields. NetBox supports six types of custom field:
* Text: Free-form text (up to 255 characters)
* Text: Free-form text (intended for single-line use)
* Long text: Free-form of any length; supports Markdown rendering
* Integer: A whole number (positive or negative)
* Boolean: True or false
@@ -19,16 +19,42 @@ Custom fields may be created by navigating to Customization > Custom Fields. Net
* JSON: Arbitrary data stored in JSON format
* Selection: A selection of one of several pre-defined custom choices
* Multiple selection: A selection field which supports the assignment of multiple values
* Object: A single NetBox object of the type defined by `object_type`
* Multiple object: One or more NetBox objects of the type defined by `object_type`
Each custom field must have a name. This should be a simple database-friendly string (e.g. `tps_report`) and may contain only alphanumeric characters and underscores. You may also assign a corresponding human-friendly label (e.g. "TPS report"); the label will be displayed on web forms. A weight is also required: Higher-weight fields will be ordered lower within a form. (The default weight is 100.) If a description is provided, it will appear beneath the field in a form.
Marking a field as required will force the user to provide a value for the field when creating a new object or when saving an existing object. A default value for the field may also be provided. Use "true" or "false" for boolean fields, or the exact value of a choice for selection fields.
The filter logic controls how values are matched when filtering objects by the custom field. Loose filtering (the default) matches on a partial value, whereas exact matching requires a complete match of the given string to a field's value. For example, exact filtering with the string "red" will only match the exact value "red", whereas loose filtering will match on the values "red", "red-orange", or "bored". Setting the filter logic to "disabled" disables filtering by the field entirely.
A custom field must be assigned to one or more object types, or models, in NetBox. Once created, custom fields will automatically appear as part of these models in the web UI and REST API. Note that not all models support custom fields.
### Custom Field Validation
### Filtering
The filter logic controls how values are matched when filtering objects by the custom field. Loose filtering (the default) matches on a partial value, whereas exact matching requires a complete match of the given string to a field's value. For example, exact filtering with the string "red" will only match the exact value "red", whereas loose filtering will match on the values "red", "red-orange", or "bored". Setting the filter logic to "disabled" disables filtering by the field entirely.
### Grouping
!!! note
This feature was introduced in NetBox v3.3.
Related custom fields can be grouped together within the UI by assigning each the same group name. When at least one custom field for an object type has a group defined, it will appear under the group heading within the custom fields panel under the object view. All custom fields with the same group name will appear under that heading. (Note that the group names must match exactly, or each will appear as a separate heading.)
This parameter has no effect on the API representation of custom field data.
### Visibility
!!! note
This feature was introduced in NetBox v3.3.
When creating a custom field, there are three options for UI visibility. These control how and whether the custom field is displayed within the NetBox UI.
* **Read/write** (default): The custom field is included when viewing and editing objects.
* **Read-only**: The custom field is displayed when viewing an object, but it cannot be edited via the UI. (It will appear in the form as a read-only field.)
* **Hidden**: The custom field will never be displayed within the UI. This option is recommended for fields which are not intended for use by human users.
Note that this setting has no impact on the REST or GraphQL APIs: Custom field data will always be available via either API.
### Validation
NetBox supports limited custom validation for custom field values. Following are the types of validation enforced for each field type:
@@ -41,3 +67,7 @@ NetBox supports limited custom validation for custom field values. Following are
Each custom selection field must have at least two choices. These are specified as a comma-separated list. Choices appear in forms in the order they are listed. Note that choice values are saved exactly as they appear, so it's best to avoid superfluous punctuation or symbols where possible.
If a default value is specified for a selection field, it must exactly match one of the provided choices. The value of a multiple selection field will always return a list, even if only one value is selected.
### Custom Object Fields
An object or multi-object custom field can be used to refer to a particular NetBox object or objects as the "value" for a custom field. These custom fields must define an `object_type`, which determines the type of object to which custom field instances point.

View File

@@ -2,7 +2,7 @@
Custom links allow users to display arbitrary hyperlinks to external content within NetBox object views. These are helpful for cross-referencing related records in systems outside NetBox. For example, you might create a custom link on the device view which links to the current device in a Network Monitoring System (NMS).
Custom links are created by navigating to Customization > Custom Links. Each link is associated with a particular NetBox object type (site, device, prefix, etc.) and will be displayed on relevant views. Each link has display text and a URL, and data from the Netbox item being viewed can be included in the link using [Jinja2 template code](https://jinja2docs.readthedocs.io/en/stable/) through the variable `obj`, and custom fields through `obj.cf`.
Custom links are created by navigating to Customization > Custom Links. Each link is associated with a particular NetBox object type (site, device, prefix, etc.) and will be displayed on relevant views. Each link has display text and a URL, and data from the NetBox item being viewed can be included in the link using [Jinja2 template code](https://jinja2docs.readthedocs.io/en/stable/) through the variable `obj`, and custom fields through `obj.cf`.
For example, you might define a link like this:
@@ -15,7 +15,7 @@ When viewing a device named Router4, this link would render as:
<a href="https://nms.example.com/nodes/?name=Router4">View NMS</a>
```
Custom links appear as buttons in the top right corner of the page. Numeric weighting can be used to influence the ordering of links.
Custom links appear as buttons in the top right corner of the page. Numeric weighting can be used to influence the ordering of links, and each link can be enabled or disabled individually.
!!! warning
Custom links rely on user-created code to generate arbitrary HTML output, which may be dangerous. Only grant permission to create or modify custom links to trusted users.
@@ -24,13 +24,18 @@ Custom links appear as buttons in the top right corner of the page. Numeric weig
The following context data is available within the template when rendering a custom link's text or URL.
| Variable | Description |
|----------|-------------|
| `obj` | The NetBox object being displayed |
| `debug` | A boolean indicating whether debugging is enabled |
| `request` | The current WSGI request |
| `user` | The current user (if authenticated) |
| `perms` | The [permissions](https://docs.djangoproject.com/en/stable/topics/auth/default/#permissions) assigned to the user |
| Variable | Description |
|-----------|-------------------------------------------------------------------------------------------------------------------|
| `object` | The NetBox object being displayed |
| `obj` | Same as `object`; maintained for backward compatability until NetBox v3.5 |
| `debug` | A boolean indicating whether debugging is enabled |
| `request` | The current WSGI request |
| `user` | The current user (if authenticated) |
| `perms` | The [permissions](https://docs.djangoproject.com/en/stable/topics/auth/default/#permissions) assigned to the user |
While most of the context variables listed above will have consistent attributes, the object will be an instance of the specific object being viewed when the link is rendered. Different models have different fields and properties, so you may need to some research to determine the attributes available for use within your template for a specific object type.
Checking the REST API representation of an object is generally a convenient way to determine what attributes are available. You can also reference the NetBox source code directly for a comprehensive list.
## Conditional Rendering
@@ -55,3 +60,7 @@ The link will only appear when viewing a device with a manufacturer name of "Cis
## Link Groups
Group names can be specified to organize links into groups. Links with the same group name will render as a dropdown menu beneath a single button bearing the name of the group.
## Table Columns
Custom links can also be included in object tables by selecting the desired links from the table configuration form. When displayed, each link will render as a hyperlink for its corresponding object. When exported (e.g. as CSV data), each link render only its URL.

View File

@@ -3,7 +3,7 @@
A webhook is a mechanism for conveying to some external system a change that took place in NetBox. For example, you may want to notify a monitoring system whenever the status of a device is updated in NetBox. This can be done by creating a webhook for the device model in NetBox and identifying the webhook receiver. When NetBox detects a change to a device, an HTTP request containing the details of the change and who made it be sent to the specified receiver. Webhooks are managed under Logging > Webhooks.
!!! warning
Webhooks support the inclusion of user-submitted code to generate custom headers and payloads, which may pose security risks under certain conditions. Only grant permission to create or modify webhooks to trusted users.
Webhooks support the inclusion of user-submitted code to generate URL, custom headers and payloads, which may pose security risks under certain conditions. Only grant permission to create or modify webhooks to trusted users.
## Configuration
@@ -12,7 +12,7 @@ A webhook is a mechanism for conveying to some external system a change that too
* **Enabled** - If unchecked, the webhook will be inactive.
* **Events** - A webhook may trigger on any combination of create, update, and delete events. At least one event type must be selected.
* **HTTP method** - The type of HTTP request to send. Options include `GET`, `POST`, `PUT`, `PATCH`, and `DELETE`.
* **URL** - The fuly-qualified URL of the request to be sent. This may specify a destination port number if needed.
* **URL** - The fully-qualified URL of the request to be sent. This may specify a destination port number if needed. Jinja2 templating is supported for this field.
* **HTTP content type** - The value of the request's `Content-Type` header. (Defaults to `application/json`)
* **Additional headers** - Any additional headers to include with the request (optional). Add one header per line in the format `Name: Value`. Jinja2 templating is supported for this field (see below).
* **Body template** - The content of the request being sent (optional). Jinja2 templating is supported for this field (see below). If blank, NetBox will populate the request body with a raw dump of the webhook context. (If the HTTP cotent type is set to `application/json`, this will be formatted as a JSON object.)
@@ -23,7 +23,7 @@ A webhook is a mechanism for conveying to some external system a change that too
## Jinja2 Template Support
[Jinja2 templating](https://jinja.palletsprojects.com/) is supported for the `additional_headers` and `body_template` fields. This enables the user to convey object data in the request headers as well as to craft a customized request body. Request content can be crafted to enable the direct interaction with external systems by ensuring the outgoing message is in a format the receiver expects and understands.
[Jinja2 templating](https://jinja.palletsprojects.com/) is supported for the `URL`, `additional_headers` and `body_template` fields. This enables the user to convey object data in the request headers as well as to craft a customized request body. Request content can be crafted to enable the direct interaction with external systems by ensuring the outgoing message is in a format the receiver expects and understands.
For example, you might create a NetBox webhook to [trigger a Slack message](https://api.slack.com/messaging/webhooks) any time an IP address is created. You can accomplish this using the following configuration:
@@ -43,7 +43,7 @@ The following data is available as context for Jinja2 templates:
* `username` - The name of the user account associated with the change.
* `request_id` - The unique request ID. This may be used to correlate multiple changes associated with a single request.
* `data` - A detailed representation of the object in its current state. This is typically equivalent to the model's representation in NetBox's REST API.
* `snapshots` - Minimal "snapshots" of the object state both before and after the change was made; provided ass a dictionary with keys named `prechange` and `postchange`. These are not as extensive as the fully serialized representation, but contain enough information to convey what has changed.
* `snapshots` - Minimal "snapshots" of the object state both before and after the change was made; provided as a dictionary with keys named `prechange` and `postchange`. These are not as extensive as the fully serialized representation, but contain enough information to convey what has changed.
### Default Request Body
@@ -81,16 +81,3 @@ If no body template is specified, the request body will be populated with a JSON
}
}
```
## Conditional Webhooks
A webhook may include a set of conditional logic expressed in JSON used to control whether a webhook triggers for a specific object. For example, you may wish to trigger a webhook for devices only when the `status` field of an object is "active":
```json
{
"attr": "status",
"value": "active"
}
```
For more detail, see the reference documentation for NetBox's [conditional logic](../reference/conditions.md).

View File

@@ -8,9 +8,3 @@ A first-hop redundancy protocol (FHRP) enables multiple physical interfaces to p
* Gateway Load Balancing Protocol (GLBP)
NetBox models these redundancy groups by protocol and group ID. Each group may optionally be assigned an authentication type and key. (Note that the authentication key is stored as a plaintext value in NetBox.) Each group may be assigned or more virtual IPv4 and/or IPv6 addresses.
## FHRP Group Assignments
Member device and VM interfaces can be assigned to FHRP groups, along with a numeric priority value. For instance, three interfaces, each belonging to a different router, may each be assigned to the same FHRP group to serve a common virtual IP address. Each of these assignments would typically receive a different priority.
Interfaces are assigned to FHRP groups under the interface detail view.

View File

@@ -0,0 +1,5 @@
# FHRP Group Assignments
Member device and VM interfaces can be assigned to FHRP groups, along with a numeric priority value. For instance, three interfaces, each belonging to a different router, may each be assigned to the same FHRP group to serve a common virtual IP address. Each of these assignments would typically receive a different priority.
Interfaces are assigned to FHRP groups under the interface detail view.

21
docs/models/ipam/l2vpn.md Normal file
View File

@@ -0,0 +1,21 @@
# L2VPN
A L2VPN object is NetBox is a representation of a layer 2 bridge technology such as VXLAN, VPLS or EPL. Each L2VPN can be identified by name as well as an optional unique identifier (VNI would be an example).
Each L2VPN instance must have one of the following type associated with it:
* VPLS
* VPWS
* EPL
* EVPL
* EP-LAN
* EVP-LAN
* EP-TREE
* EVP-TREE
* VXLAN
* VXLAN EVPN
* MPLS-EVPN
* PBB-EVPN
!!! note
Choosing VPWS, EPL, EP-LAN, EP-TREE will result in only being able to add two terminations to a given L2VPN.

View File

@@ -0,0 +1,15 @@
# L2VPN Termination
A L2VPN Termination is the termination point of a L2VPN. Certain types of L2VPNs may only have 2 termination points (point-to-point) while others may have many terminations (multipoint).
Each termination consists of a L2VPN it is a member of as well as the connected endpoint which can be an interface or a VLAN.
The following types of L2VPNs are considered point-to-point:
* VPWS
* EPL
* EP-LAN
* EP-TREE
!!! note
Choosing any of the above types will result in only being able to add 2 terminations to a given L2VPN.

View File

@@ -0,0 +1,3 @@
# Service Templates
Service templates can be used to instantiate services on devices and virtual machines. A template defines a name, protocol, and port number(s), and may optionally include a description. Services can be instantiated from templates and applied to devices and/or virtual machines, and may be associated with specific IP addresses.

View File

@@ -2,4 +2,6 @@
VLAN groups can be used to organize VLANs within NetBox. Each VLAN group can be scoped to a particular region, site group, site, location, rack, cluster group, or cluster. Member VLANs will be available for assignment to devices and/or virtual machines within the specified scope.
A minimum and maximum child VLAN ID must be set for each group. (These default to 1 and 4094 respectively.) VLANs created within a group must have a VID that falls between these values (inclusive).
Groups can also be used to enforce uniqueness: Each VLAN within a group must have a unique ID and name. VLANs which are not assigned to a group may have overlapping names and IDs (including VLANs which belong to a common site). For example, you can create two VLANs with ID 123, but they cannot both be assigned to the same group.

View File

@@ -53,3 +53,17 @@ To achieve a logical OR with a different set of constraints, define multiple obj
```
Additionally, where multiple permissions have been assigned for an object type, their collective constraints will be merged using a logical "OR" operation.
### User Token
!!! info "This feature was introduced in NetBox v3.3"
When defining a permission constraint, administrators may use the special token `$user` to reference the current user at the time of evaluation. This can be helpful to restrict users to editing only their own journal entries, for example. Such a constraint might be defined as:
```json
{
"created_by": "$user"
}
```
The `$user` token can be used only as a constraint value, or as an item within a list of values. It cannot be modified or extended to reference specific user attributes.

View File

@@ -3,10 +3,17 @@
A token is a unique identifier mapped to a NetBox user account. Each user may have one or more tokens which he or she can use for authentication when making REST API requests. To create a token, navigate to the API tokens page under your user profile.
!!! note
The creation and modification of API tokens can be restricted per user by an administrator. If you don't see an option to create an API token, ask an administrator to grant you access.
All users can create and manage REST API tokens under the user control panel in the UI. The ability to view, add, change, or delete tokens via the REST API itself is controlled by the relevant model permissions, assigned to users and/or groups in the admin UI. These permissions should be used with great care to avoid accidentally permitting a user to create tokens for other user accounts.
Each token contains a 160-bit key represented as 40 hexadecimal characters. When creating a token, you'll typically leave the key field blank so that a random key will be automatically generated. However, NetBox allows you to specify a key in case you need to restore a previously deleted token to operation.
By default, a token can be used to perform all actions via the API that a user would be permitted to do via the web UI. Deselecting the "write enabled" option will restrict API requests made with the token to read operations (e.g. GET) only.
Additionally, a token can be set to expire at a specific time. This can be useful if an external client needs to be granted temporary access to NetBox.
### Client IP Restriction
!!! note
This feature was introduced in NetBox v3.3.
Each API token can optionally be restricted by client IP address. If one or more allowed IP prefixes/addresses is defined for a token, authentication will fail for any client connecting from an IP address outside the defined range(s). This enables restricting the use a token to a specific client. (By default, any client IP address is permitted.)

View File

@@ -1,5 +1,5 @@
# Clusters
A cluster is a logical grouping of physical resources within which virtual machines run. A cluster must be assigned a type (technological classification), and may optionally be assigned to a cluster group, site, and/or tenant. Each cluster must have a unique name within its assigned group and/or site, if any.
A cluster is a logical grouping of physical resources within which virtual machines run. A cluster must be assigned a type (technological classification) and operational status, and may optionally be assigned to a cluster group, site, and/or tenant. Each cluster must have a unique name within its assigned group and/or site, if any.
Physical devices may be associated with clusters as hosts. This allows users to track on which host(s) a particular virtual machine may reside. However, NetBox does not support pinning a specific VM within a cluster to a particular host device.

View File

@@ -1,6 +1,6 @@
# Virtual Machines
A virtual machine represents a virtual compute instance hosted within a cluster. Each VM must be assigned to exactly one cluster.
A virtual machine represents a virtual compute instance hosted within a cluster. Each VM must be assigned to a site and/or cluster, and may optionally be assigned to a particular host device within a cluster.
Like devices, each VM can be assigned a platform and/or functional role, and must have one of the following operational statuses assigned to it:

View File

@@ -1,3 +1,3 @@
## Interfaces
Virtual machine interfaces behave similarly to device interfaces, and can be assigned IP addresses, VLANs, and services. However, given their virtual nature, they lack properties pertaining to physical attributes. For example, VM interfaces do not have a physical type and cannot have cables attached to them.
Virtual machine interfaces behave similarly to device interfaces, and can be assigned to VRFs, and may have IP addresses, VLANs, and services attached to them. However, given their virtual nature, they lack properties pertaining to physical attributes. For example, VM interfaces do not have a physical type and cannot have cables attached to them.

View File

@@ -1,6 +1,6 @@
# Wireless LANs
A wireless LAN is a set of interfaces connected via a common wireless channel. Each instance must have an SSID, and may optionally be correlated to a VLAN. Wireless LANs can be arranged into hierarchical groups.
A wireless LAN is a set of interfaces connected via a common wireless channel. Each instance must have an SSID, and may optionally be correlated to a VLAN. Wireless LANs can be arranged into hierarchical groups, and each may be associated with a particular tenant.
An interface may be attached to multiple wireless LANs, provided they are all operating on the same channel. Only wireless interfaces may be attached to wireless LANs.

View File

@@ -1,6 +1,6 @@
# Wireless Links
A wireless link represents a connection between exactly two wireless interfaces. It may optionally be assigned an SSID and a description. It may also have a status assigned to it, similar to the cable model.
A wireless link represents a connection between exactly two wireless interfaces. It may optionally be assigned an SSID and a description. It may also have a status assigned to it, similar to the cable model. Each wireless link may also be assigned to a particular tenant.
Each wireless link may have authentication attributes associated with it, including:

View File

@@ -1,429 +0,0 @@
# Plugin Development
This documentation covers the development of custom plugins for NetBox. Plugins are essentially self-contained [Django apps](https://docs.djangoproject.com/en/stable/) which integrate with NetBox to provide custom functionality. Since the development of Django apps is already very well-documented, we'll only be covering the aspects that are specific to NetBox.
Plugins can do a lot, including:
* Create Django models to store data in the database
* Provide their own "pages" (views) in the web user interface
* Inject template content and navigation links
* Establish their own REST API endpoints
* Add custom request/response middleware
However, keep in mind that each piece of functionality is entirely optional. For example, if your plugin merely adds a piece of middleware or an API endpoint for existing data, there's no need to define any new models.
!!! warning
While very powerful, the NetBox plugins API is necessarily limited in its scope. The plugins API is discussed here in its entirety: Any part of the NetBox code base not documented here is _not_ part of the supported plugins API, and should not be employed by a plugin. Internal elements of NetBox are subject to change at any time and without warning. Plugin authors are **strongly** encouraged to develop plugins using only the officially supported components discussed here and those provided by the underlying Django framework so as to avoid breaking changes in future releases.
## Initial Setup
### Plugin Structure
Although the specific structure of a plugin is largely left to the discretion of its authors, a typical NetBox plugin looks something like this:
```no-highlight
project-name/
- plugin_name/
- templates/
- plugin_name/
- *.html
- __init__.py
- middleware.py
- navigation.py
- signals.py
- template_content.py
- urls.py
- views.py
- README
- setup.py
```
The top level is the project root, which can have any name that you like. Immediately within the root should exist several items:
* `setup.py` - This is a standard installation script used to install the plugin package within the Python environment.
* `README` - A brief introduction to your plugin, how to install and configure it, where to find help, and any other pertinent information. It is recommended to write README files using a markup language such as Markdown.
* The plugin source directory, with the same name as your plugin. This must be a valid Python package name (e.g. no spaces or hyphens).
The plugin source directory contains all the actual Python code and other resources used by your plugin. Its structure is left to the author's discretion, however it is recommended to follow best practices as outlined in the [Django documentation](https://docs.djangoproject.com/en/stable/intro/reusable-apps/). At a minimum, this directory **must** contain an `__init__.py` file containing an instance of NetBox's `PluginConfig` class.
### Create setup.py
`setup.py` is the [setup script](https://docs.python.org/3.7/distutils/setupscript.html) we'll use to install our plugin once it's finished. The primary function of this script is to call the setuptools library's `setup()` function to create a Python distribution package. We can pass a number of keyword arguments to inform the package creation as well as to provide metadata about the plugin. An example `setup.py` is below:
```python
from setuptools import find_packages, setup
setup(
name='netbox-animal-sounds',
version='0.1',
description='An example NetBox plugin',
url='https://github.com/netbox-community/netbox-animal-sounds',
author='Jeremy Stretch',
license='Apache 2.0',
install_requires=[],
packages=find_packages(),
include_package_data=True,
zip_safe=False,
)
```
Many of these are self-explanatory, but for more information, see the [setuptools documentation](https://setuptools.readthedocs.io/en/latest/setuptools.html).
!!! note
`zip_safe=False` is **required** as the current plugin iteration is not zip safe due to upstream python issue [issue19699](https://bugs.python.org/issue19699)
### Define a PluginConfig
The `PluginConfig` class is a NetBox-specific wrapper around Django's built-in [`AppConfig`](https://docs.djangoproject.com/en/stable/ref/applications/) class. It is used to declare NetBox plugin functionality within a Python package. Each plugin should provide its own subclass, defining its name, metadata, and default and required configuration parameters. An example is below:
```python
from extras.plugins import PluginConfig
class AnimalSoundsConfig(PluginConfig):
name = 'netbox_animal_sounds'
verbose_name = 'Animal Sounds'
description = 'An example plugin for development purposes'
version = '0.1'
author = 'Jeremy Stretch'
author_email = 'author@example.com'
base_url = 'animal-sounds'
required_settings = []
default_settings = {
'loud': False
}
config = AnimalSoundsConfig
```
NetBox looks for the `config` variable within a plugin's `__init__.py` to load its configuration. Typically, this will be set to the PluginConfig subclass, but you may wish to dynamically generate a PluginConfig class based on environment variables or other factors.
#### PluginConfig Attributes
| Name | Description |
| ---- | ----------- |
| `name` | Raw plugin name; same as the plugin's source directory |
| `verbose_name` | Human-friendly name for the plugin |
| `version` | Current release ([semantic versioning](https://semver.org/) is encouraged) |
| `description` | Brief description of the plugin's purpose |
| `author` | Name of plugin's author |
| `author_email` | Author's public email address |
| `base_url` | Base path to use for plugin URLs (optional). If not specified, the project's `name` will be used. |
| `required_settings` | A list of any configuration parameters that **must** be defined by the user |
| `default_settings` | A dictionary of configuration parameters and their default values |
| `min_version` | Minimum version of NetBox with which the plugin is compatible |
| `max_version` | Maximum version of NetBox with which the plugin is compatible |
| `middleware` | A list of middleware classes to append after NetBox's build-in middleware |
| `template_extensions` | The dotted path to the list of template extension classes (default: `template_content.template_extensions`) |
| `menu_items` | The dotted path to the list of menu items provided by the plugin (default: `navigation.menu_items`) |
All required settings must be configured by the user. If a configuration parameter is listed in both `required_settings` and `default_settings`, the default setting will be ignored.
### Create a Virtual Environment
It is strongly recommended to create a Python [virtual environment](https://docs.python.org/3/tutorial/venv.html) specific to your plugin. This will afford you complete control over the installed versions of all dependencies and avoid conflicting with any system packages. This environment can live wherever you'd like, however it should be excluded from revision control. (A popular convention is to keep all virtual environments in the user's home directory, e.g. `~/.virtualenvs/`.)
```shell
python3 -m venv /path/to/my/venv
```
You can make NetBox available within this environment by creating a path file pointing to its location. This will add NetBox to the Python path upon activation. (Be sure to adjust the command below to specify your actual virtual environment path, Python version, and NetBox installation.)
```shell
cd $VENV/lib/python3.7/site-packages/
echo /opt/netbox/netbox > netbox.pth
```
### Install the Plugin for Development
To ease development, it is recommended to go ahead and install the plugin at this point using setuptools' `develop` mode. This will create symbolic links within your Python environment to the plugin development directory. Call `setup.py` from the plugin's root directory with the `develop` argument (instead of `install`):
```no-highlight
$ python setup.py develop
```
## Database Models
If your plugin introduces a new type of object in NetBox, you'll probably want to create a [Django model](https://docs.djangoproject.com/en/stable/topics/db/models/) for it. A model is essentially a Python representation of a database table, with attributes that represent individual columns. Model instances can be created, manipulated, and deleted using [queries](https://docs.djangoproject.com/en/stable/topics/db/queries/). Models must be defined within a file named `models.py`.
Below is an example `models.py` file containing a model with two character fields:
```python
from django.db import models
class Animal(models.Model):
name = models.CharField(max_length=50)
sound = models.CharField(max_length=50)
def __str__(self):
return self.name
```
Once you have defined the model(s) for your plugin, you'll need to create the database schema migrations. A migration file is essentially a set of instructions for manipulating the PostgreSQL database to support your new model, or to alter existing models. Creating migrations can usually be done automatically using Django's `makemigrations` management command.
!!! note
A plugin must be installed before it can be used with Django management commands. If you skipped this step above, run `python setup.py develop` from the plugin's root directory.
```no-highlight
$ ./manage.py makemigrations netbox_animal_sounds
Migrations for 'netbox_animal_sounds':
/home/jstretch/animal_sounds/netbox_animal_sounds/migrations/0001_initial.py
- Create model Animal
```
Next, we can apply the migration to the database with the `migrate` command:
```no-highlight
$ ./manage.py migrate netbox_animal_sounds
Operations to perform:
Apply all migrations: netbox_animal_sounds
Running migrations:
Applying netbox_animal_sounds.0001_initial... OK
```
For more background on schema migrations, see the [Django documentation](https://docs.djangoproject.com/en/stable/topics/migrations/).
### Using the Django Admin Interface
Plugins can optionally expose their models via Django's built-in [administrative interface](https://docs.djangoproject.com/en/stable/ref/contrib/admin/). This can greatly improve troubleshooting ability, particularly during development. To expose a model, simply register it using Django's `admin.register()` function. An example `admin.py` file for the above model is shown below:
```python
from django.contrib import admin
from .models import Animal
@admin.register(Animal)
class AnimalAdmin(admin.ModelAdmin):
list_display = ('name', 'sound')
```
This will display the plugin and its model in the admin UI. Staff users can create, change, and delete model instances via the admin UI without needing to create a custom view.
![NetBox plugin in the admin UI](../media/plugins/plugin_admin_ui.png)
## Views
If your plugin needs its own page or pages in the NetBox web UI, you'll need to define views. A view is a particular page tied to a URL within NetBox, which renders content using a template. Views are typically defined in `views.py`, and URL patterns in `urls.py`. As an example, let's write a view which displays a random animal and the sound it makes. First, we'll create the view in `views.py`:
```python
from django.shortcuts import render
from django.views.generic import View
from .models import Animal
class RandomAnimalView(View):
"""
Display a randomly-selected animal.
"""
def get(self, request):
animal = Animal.objects.order_by('?').first()
return render(request, 'netbox_animal_sounds/animal.html', {
'animal': animal,
})
```
This view retrieves a random animal from the database and and passes it as a context variable when rendering a template named `animal.html`, which doesn't exist yet. To create this template, first create a directory named `templates/netbox_animal_sounds/` within the plugin source directory. (We use the plugin's name as a subdirectory to guard against naming collisions with other plugins.) Then, create a template named `animal.html` as described below.
### Extending the Base Template
NetBox provides a base template to ensure a consistent user experience, which plugins can extend with their own content. This template includes four content blocks:
* `title` - The page title
* `header` - The upper portion of the page
* `content` - The main page body
* `javascript` - A section at the end of the page for including Javascript code
For more information on how template blocks work, consult the [Django documentation](https://docs.djangoproject.com/en/stable/ref/templates/builtins/#block).
```jinja2
{% extends 'base/layout.html' %}
{% block content %}
{% with config=settings.PLUGINS_CONFIG.netbox_animal_sounds %}
<h2 class="text-center" style="margin-top: 200px">
{% if animal %}
The {{ animal.name|lower }} says
{% if config.loud %}
{{ animal.sound|upper }}!
{% else %}
{{ animal.sound }}
{% endif %}
{% else %}
No animals have been created yet!
{% endif %}
</h2>
{% endwith %}
{% endblock %}
```
The first line of the template instructs Django to extend the NetBox base template and inject our custom content within its `content` block.
!!! note
Django renders templates with its own custom [template language](https://docs.djangoproject.com/en/stable/topics/templates/#the-django-template-language). This is very similar to Jinja2, however there are some important differences to be aware of.
Finally, to make the view accessible to users, we need to register a URL for it. We do this in `urls.py` by defining a `urlpatterns` variable containing a list of paths.
```python
from django.urls import path
from . import views
urlpatterns = [
path('random/', views.RandomAnimalView.as_view(), name='random_animal'),
]
```
A URL pattern has three components:
* `route` - The unique portion of the URL dedicated to this view
* `view` - The view itself
* `name` - A short name used to identify the URL path internally
This makes our view accessible at the URL `/plugins/animal-sounds/random/`. (Remember, our `AnimalSoundsConfig` class sets our plugin's base URL to `animal-sounds`.) Viewing this URL should show the base NetBox template with our custom content inside it.
## REST API Endpoints
Plugins can declare custom endpoints on NetBox's REST API to retrieve or manipulate models or other data. These behave very similarly to views, except that instead of rendering arbitrary content using a template, data is returned in JSON format using a serializer. NetBox uses the [Django REST Framework](https://www.django-rest-framework.org/), which makes writing API serializers and views very simple.
First, we'll create a serializer for our `Animal` model, in `api/serializers.py`:
```python
from rest_framework.serializers import ModelSerializer
from netbox_animal_sounds.models import Animal
class AnimalSerializer(ModelSerializer):
class Meta:
model = Animal
fields = ('id', 'name', 'sound')
```
Next, we'll create a generic API view set that allows basic CRUD (create, read, update, and delete) operations for Animal instances. This is defined in `api/views.py`:
```python
from rest_framework.viewsets import ModelViewSet
from netbox_animal_sounds.models import Animal
from .serializers import AnimalSerializer
class AnimalViewSet(ModelViewSet):
queryset = Animal.objects.all()
serializer_class = AnimalSerializer
```
Finally, we'll register a URL for our endpoint in `api/urls.py`. This file **must** define a variable named `urlpatterns`.
```python
from rest_framework import routers
from .views import AnimalViewSet
router = routers.DefaultRouter()
router.register('animals', AnimalViewSet)
urlpatterns = router.urls
```
With these three components in place, we can request `/api/plugins/animal-sounds/animals/` to retrieve a list of all Animal objects defined.
![NetBox REST API plugin endpoint](../media/plugins/plugin_rest_api_endpoint.png)
!!! warning
This example is provided as a minimal reference implementation only. It does not address authentication, performance, or myriad other concerns that plugin authors should have.
## Navigation Menu Items
To make its views easily accessible to users, a plugin can inject items in NetBox's navigation menu under the "Plugins" header. Menu items are added by defining a list of PluginMenuItem instances. By default, this should be a variable named `menu_items` in the file `navigation.py`. An example is shown below.
```python
from extras.plugins import PluginMenuButton, PluginMenuItem
from utilities.choices import ButtonColorChoices
menu_items = (
PluginMenuItem(
link='plugins:netbox_animal_sounds:random_animal',
link_text='Random sound',
buttons=(
PluginMenuButton('home', 'Button A', 'fa fa-info', ButtonColorChoices.BLUE),
PluginMenuButton('home', 'Button B', 'fa fa-warning', ButtonColorChoices.GREEN),
)
),
)
```
A `PluginMenuItem` has the following attributes:
* `link` - The name of the URL path to which this menu item links
* `link_text` - The text presented to the user
* `permissions` - A list of permissions required to display this link (optional)
* `buttons` - An iterable of PluginMenuButton instances to display (optional)
A `PluginMenuButton` has the following attributes:
* `link` - The name of the URL path to which this button links
* `title` - The tooltip text (displayed when the mouse hovers over the button)
* `icon_class` - Button icon CSS class (NetBox currently supports [Font Awesome 4.7](https://fontawesome.com/v4.7.0/icons/))
* `color` - One of the choices provided by `ButtonColorChoices` (optional)
* `permissions` - A list of permissions required to display this button (optional)
!!! note
Any buttons associated within a menu item will be shown only if the user has permission to view the link, regardless of what permissions are set on the buttons.
## Extending Core Templates
Plugins can inject custom content into certain areas of the detail views of applicable models. This is accomplished by subclassing `PluginTemplateExtension`, designating a particular NetBox model, and defining the desired methods to render custom content. Four methods are available:
* `left_page()` - Inject content on the left side of the page
* `right_page()` - Inject content on the right side of the page
* `full_width_page()` - Inject content across the entire bottom of the page
* `buttons()` - Add buttons to the top of the page
Additionally, a `render()` method is available for convenience. This method accepts the name of a template to render, and any additional context data you want to pass. Its use is optional, however.
When a PluginTemplateExtension is instantiated, context data is assigned to `self.context`. Available data include:
* `object` - The object being viewed
* `request` - The current request
* `settings` - Global NetBox settings
* `config` - Plugin-specific configuration parameters
For example, accessing `{{ request.user }}` within a template will return the current user.
Declared subclasses should be gathered into a list or tuple for integration with NetBox. By default, NetBox looks for an iterable named `template_extensions` within a `template_content.py` file. (This can be overridden by setting `template_extensions` to a custom value on the plugin's PluginConfig.) An example is below.
```python
from extras.plugins import PluginTemplateExtension
from .models import Animal
class SiteAnimalCount(PluginTemplateExtension):
model = 'dcim.site'
def right_page(self):
return self.render('netbox_animal_sounds/inc/animal_count.html', extra_context={
'animal_count': Animal.objects.count(),
})
template_extensions = [SiteAnimalCount]
```
## Background Tasks
By default, Netbox provides 3 differents [RQ](https://python-rq.org/) queues to run background jobs : *high*, *default* and *low*.
These 3 core queues can be used out-of-the-box by plugins to define background tasks.
Plugins can also define dedicated queues. These queues can be configured under the PluginConfig class `queues` attribute. An example configuration
is below:
```python
class MyPluginConfig(PluginConfig):
name = 'myplugin'
...
queues = [
'queue1',
'queue2',
'queue-whatever-the-name'
]
```
The PluginConfig above creates 3 queues with the following names: *myplugin.queue1*, *myplugin.queue2*, *myplugin.queue-whatever-the-name*.
As you can see, the queue's name is always preprended with the plugin's name, to avoid any name clashes between different plugins.
In case you create dedicated queues for your plugin, it is strongly advised to also create a dedicated RQ worker instance. This instance should only listen to the queues defined in your plugin - to avoid impact between your background tasks and netbox internal tasks.
```
python manage.py rqworker myplugin.queue1 myplugin.queue2 myplugin.queue-whatever-the-name
```

Some files were not shown because too many files have changed in this diff Show More