Skip to content

Release v2.6.12 #3908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 141 commits into from
Jan 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
05570ae
Clean tagged VLANs
hSaria Dec 31, 2019
aa4f73f
Removed trailing space
hSaria Jan 1, 2020
a110b0b
Removed no-longer-used choices (now handled via API-based select)
hSaria Jan 1, 2020
d267aeb
Filter VLANs to only those in the current site or global
hSaria Jan 1, 2020
1a57120
3589 changelog
hSaria Jan 1, 2020
7ad9e8a
More informative error message
hSaria Jan 1, 2020
37bc17d
Fixes #2365: Toggle for showing available prefixes/ip addresses
hSaria Jan 2, 2020
6a7af22
Merge branch 'develop' into 2365-show-available-toggle
hSaria Jan 2, 2020
f81641a
Corrected ticket number
Jan 2, 2020
2a219ef
`is not None` not needed as the value 'false' is a string
Jan 2, 2020
8e3a371
Added default to cookie
Jan 2, 2020
28ae684
Templatized show_available toggle
Jan 2, 2020
d3c6caf
Limit tagged validation to tagged interfaces
hSaria Jan 2, 2020
feb04f0
Post-release version bump
jeremystretch Jan 3, 2020
fa55571
Merge remote-tracking branch 'netbox-community/develop' into 3589-int…
hSaria Jan 3, 2020
9d8ab81
Removed changelog (temporarily while merging)
hSaria Jan 3, 2020
1c0de00
Merge remote-tracking branch 'netbox-community/develop' into 2365-sho…
hSaria Jan 3, 2020
e1c61c5
Changelog
hSaria Jan 3, 2020
04f3e58
Line seperator
hSaria Jan 3, 2020
e1d1f52
Closes #3090: Filter field for interface
hSaria Jan 3, 2020
3556051
Height was a touch off
hSaria Jan 3, 2020
28eca9a
Forgot le seperator
hSaria Jan 3, 2020
4b19073
Fixed #3187: Rack multi-selection field
hSaria Jan 4, 2020
dba40cd
Changelog (may conflict because adding headers)
hSaria Jan 4, 2020
792f383
Fixes #2050: Image preview for attachments
hSaria Jan 4, 2020
067af26
Changelog (may conflict with other merges)
hSaria Jan 4, 2020
c45daca
Removed changes that will be covered in #3840
hSaria Jan 5, 2020
7dddd47
Updated changelog
hSaria Jan 5, 2020
d4df965
Merge pull request #3845 from hSaria/3187-elevation-rack-filter
jeremystretch Jan 6, 2020
9bd2af4
Merge branch 'develop' into 2050-image-preview
jeremystretch Jan 6, 2020
d1f8178
Merge branch 'develop' into 3589-interface-tagged-vlans
hSaria Jan 6, 2020
258cc4b
Merge pull request #3846 from hSaria/2050-image-preview
jeremystretch Jan 6, 2020
206732e
Merge branch 'develop' into 2365-show-available-toggle
hSaria Jan 6, 2020
cfb8b3c
Merge branch 'develop' into 3090-interface-filtering
hSaria Jan 6, 2020
15545b7
Merge pull request #3814 from hSaria/3589-interface-tagged-vlans
jeremystretch Jan 6, 2020
07a1bae
Limit toggle selector to visible input fields
hSaria Jan 6, 2020
1833397
Merge branch '3090-interface-filtering' of https://github.com/hSaria/…
hSaria Jan 6, 2020
4b5c4b7
Initial work on filter tests
jeremystretch Jan 4, 2020
8d0aaa4
Add IPAM filter tests (WIP)
jeremystretch Jan 6, 2020
05bfe94
Add remaining IPAM filter tests
jeremystretch Jan 7, 2020
a7ec0c1
Move toggles js code to static
hSaria Jan 6, 2020
6a3cd83
Moved regex note to tooltip
hSaria Jan 6, 2020
e7ee448
Fixes #3853: Fix device role link on config context view
jeremystretch Jan 7, 2020
f267a53
Add filter tests for secrets
jeremystretch Jan 7, 2020
39d0261
Add tests for tenancy filters
jeremystretch Jan 7, 2020
227921e
Add tests for virtualization filters
jeremystretch Jan 7, 2020
770f4c9
Fixes #3856: Allow filtering VM interfaces by multiple MAC addresses
jeremystretch Jan 7, 2020
190e683
Removed cookie-based storage; now based on request
hSaria Jan 7, 2020
32f39e1
Changed default to showing available
hSaria Jan 7, 2020
acb2f32
Add tests for DCIM filters
jeremystretch Jan 7, 2020
832fd49
Add DeviceType filter tests
jeremystretch Jan 7, 2020
74997a1
Fixes #3857: Fix group custom links rendering
Jan 8, 2020
996d49d
Fixes #3440: Total cable trace length
Jan 8, 2020
ea05b5b
Fixes #1982: Swagger NAPALM documentation
Jan 8, 2020
a7982bb
Add device filter tests
jeremystretch Jan 8, 2020
dc475f4
Fixes #2113: Adjust NAPALM settings with headers
Jan 8, 2020
ce8d470
Added NAPALM documentation
Jan 8, 2020
98a66f7
NAPALM settings changelog
Jan 8, 2020
f49467b
Corrected optional arg assignment
Jan 8, 2020
5cac900
Add console port, console server port filter tests
jeremystretch Jan 8, 2020
8fef6ed
Fixes #3862: Allow filtering device components by multiple device names
jeremystretch Jan 8, 2020
38c16d7
Merge branch 'develop' into 3834-filter-tests
jeremystretch Jan 8, 2020
39fba4f
Fix InterfaceTestCase.test_mac_address
jeremystretch Jan 8, 2020
e9b2ad9
Fix DeviceTestCase.test_cluster
jeremystretch Jan 8, 2020
8519f54
Merge branch 'develop' into 3857-group-custom-link
hSaria Jan 8, 2020
eb40275
Fixes #3623: Word expansion for interfaces
Jan 8, 2020
396bb28
Added example and handled invalid ranges gracefully
Jan 8, 2020
bca7435
Add remaining tests for device component filters
jeremystretch Jan 8, 2020
40c30ba
Add tests for InventoryItem, VirtualChassis filters
jeremystretch Jan 8, 2020
e312c30
Add CableFilter test
jeremystretch Jan 8, 2020
c04d8ca
Add tests for PowerPanel and PowerFeed filters
jeremystretch Jan 8, 2020
b1e8145
Standardize usage of self.filterset for test cases
jeremystretch Jan 8, 2020
4151e52
Clean up filter imports
jeremystretch Jan 8, 2020
4030e5e
Add filter tests for extras
jeremystretch Jan 9, 2020
1cdbfd6
Fixes #3668: search address by DNS name when assigning
Jan 9, 2020
9980910
Merge pull request #3866 from netbox-community/3834-filter-tests
jeremystretch Jan 9, 2020
b36d0ca
Merge pull request #3858 from hSaria/3857-group-custom-link
jeremystretch Jan 9, 2020
6537f35
Fixes #3864: Disallow /0 masks
Jan 9, 2020
f3b3235
Merge branch 'develop' into 3864-disallow-0-masks
hSaria Jan 9, 2020
54227ca
Fixes #3851: Allow passing initial data to custom script forms
jeremystretch Jan 9, 2020
73e4564
Fixes #3872: Limit related IPs table
Jan 9, 2020
c9ec8b7
Merge pull request #3821 from hSaria/2365-show-available-toggle
jeremystretch Jan 9, 2020
40625d1
Merge branch 'develop' into 3668-address-assign-dns-filter
hSaria Jan 9, 2020
60e4812
Merge branch 'develop' into 2113-napalm-settings
hSaria Jan 9, 2020
094553d
Merge branch 'develop' into 3623-interface-word-expansion
hSaria Jan 9, 2020
4f9271e
Merge branch 'develop' into 3440-total-cable-length
hSaria Jan 9, 2020
b23eaec
Merge branch 'develop' into 3090-interface-filtering
hSaria Jan 9, 2020
959a0da
Merge pull request #3838 from hSaria/3090-interface-filtering
jeremystretch Jan 9, 2020
92ec4bd
Merge pull request #3859 from hSaria/3440-total-cable-length
jeremystretch Jan 9, 2020
472486a
Changed to `q` filter
Jan 9, 2020
581ed52
Added changelog for 3009
Jan 9, 2020
b53480d
Merge branch 'develop' into 3668-address-assign-dns-filter
hSaria Jan 9, 2020
86865b9
Added changelog for 3009
Jan 9, 2020
989d6f5
Merge pull request #3871 from hSaria/3864-disallow-0-masks
jeremystretch Jan 9, 2020
46c712e
Moved NAPALM parameter to decorator
Jan 9, 2020
ad565e5
Removed exception for empty methods
Jan 9, 2020
9d085ad
Changed `NAPALM-` prefix to `X-NAPALM-`
Jan 9, 2020
c66dca3
Merge pull request #3860 from hSaria/1982-swagger-napalm
jeremystretch Jan 9, 2020
7e0073d
Merge pull request #3863 from hSaria/2113-napalm-settings
jeremystretch Jan 9, 2020
67f4d8f
Replaced with pagination
Jan 9, 2020
03b10b6
Merge branch 'develop' into 3872-limit-related-ips
hSaria Jan 9, 2020
c13b9d8
Added tests for IPv4
Jan 9, 2020
e5c5a1a
Fixes #3849: Fix ordering of models when dumping data to JSON
jeremystretch Jan 9, 2020
6019260
Merge pull request #3873 from hSaria/3872-limit-related-ips
jeremystretch Jan 9, 2020
883655c
Fixes #3393: Paginate circuits at the provider details view
hSaria Jan 9, 2020
94a7d8e
Hid the provider column
hSaria Jan 9, 2020
1e740a7
Corrected placement of changelog
hSaria Jan 9, 2020
4eacc57
Fixes #3876: set min and max values for ASN field
hSaria Jan 9, 2020
c1ed2b6
Merge pull request #3875 from hSaria/3393-provider-circuit-paginate
jeremystretch Jan 9, 2020
6c19c88
Replaced ASN bounds with constants
hSaria Jan 9, 2020
789cf82
Merge pull request #3879 from hSaria/3876-asn-field-bounds
jeremystretch Jan 9, 2020
d88b345
Add configuration file for GitHub Stale bot
jeremystretch Jan 10, 2020
0296aa2
Clean up Stale bot config formatting
jeremystretch Jan 10, 2020
fe89982
Removed redundant list call
Jan 10, 2020
2eba84d
Added tests for IPv6
Jan 10, 2020
acb66c7
Negative tests for expand_ipaddress_pattern
Jan 10, 2020
71120d9
Added tests for alphanumeric
Jan 10, 2020
a5413a5
Merge branch 'develop' into 3623-interface-word-expansion
hSaria Jan 10, 2020
cb91c92
Merge pull request #3865 from hSaria/3623-interface-word-expansion
jeremystretch Jan 10, 2020
4be7ca0
Merge branch 'develop' into 3668-address-assign-dns-filter
jeremystretch Jan 10, 2020
fc1245c
Merge pull request #3867 from hSaria/3668-address-assign-dns-filter
jeremystretch Jan 10, 2020
6bc8f2e
Fixes #3882: Fix filtering of devices by rack group
jeremystretch Jan 10, 2020
f451403
Fixes #3021: Added tenancy filter to cables
Jan 10, 2020
f20d16f
Fixes #3491: include content of webhook error response
Jan 10, 2020
509a115
Extend section regarding test adaptation
jeremystretch Jan 10, 2020
b7e7802
Closes #3891: Add local_context_data filter for virtual machines
jeremystretch Jan 10, 2020
422c6ba
Fixes #3895: Elevations filter regression
hSaria Jan 11, 2020
a2308b9
Fixes #3898: Call str of cable on delete to save PK in id_string
hSaria Jan 12, 2020
49fa243
Added post-delete cable ID test
hSaria Jan 12, 2020
fe0fbea
Fixes #3902: relax non-essential required fields
hSaria Jan 13, 2020
2f98f13
Merge pull request #3896 from hSaria/3895-elevations-keyerror
jeremystretch Jan 13, 2020
3d78a67
Store a private copy of the pk during init and use that with __str__
hSaria Jan 13, 2020
608006e
Set the private pk after super save
hSaria Jan 13, 2020
32ffc1b
Fixes #3905: divide by zero on power feeds with low values
hSaria Jan 13, 2020
b64f4b9
Merge pull request #3903 from hSaria/3902-relax-connect
jeremystretch Jan 13, 2020
0f42219
Merge pull request #3906 from hSaria/3905-powerfeed-divide-by-zero
jeremystretch Jan 13, 2020
736cd70
Merge branch 'develop' into 3898-cable-str-pk
hSaria Jan 13, 2020
cf48037
Merge pull request #3899 from hSaria/3898-cable-str-pk
jeremystretch Jan 13, 2020
0fd0e76
Merge pull request #3888 from hSaria/3491-webhook-error-message
jeremystretch Jan 13, 2020
66daeda
Merge pull request #3887 from hSaria/3021-cable-tenant-filter
jeremystretch Jan 13, 2020
c3c3000
Release v2.6.12
jeremystretch Jan 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Configuration for Lock (https://github.com/apps/lock)

# Number of days of inactivity before a closed issue or pull request is locked
daysUntilLock: 90

# Skip issues and pull requests created before a given timestamp. Timestamp must
# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable
skipCreatedBefore: 2020-01-01

# Issues and pull requests with these labels will be ignored. Set to `[]` to disable
exemptLabels: []

# Label to add before locking, such as `outdated`. Set to `false` to disable
lockLabel: false

# Comment to post before locking. Set to `false` to disable
lockComment: false

# Assign `resolved` as the reason for locking. Set to `false` to disable
setLockReason: true

# Limit to only `issues` or `pulls`
# only: issues
7 changes: 7 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
# Configuration for Stale (https://github.com/apps/stale)

# Number of days of inactivity before an issue becomes stale
daysUntilStale: 14

# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7

# Issues with these labels will never be considered stale
exemptLabels:
- "status: accepted"
- "status: gathering feedback"
- "status: blocked"

# Label to use when marking an issue as stale
staleLabel: wontfix

# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
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).

# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: >
This issue has been automatically closed due to lack of activity. In an
Expand Down
65 changes: 65 additions & 0 deletions docs/additional-features/napalm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# NAPALM

NetBox supports integration with the [NAPALM automation](https://napalm-automation.net/) library. NAPALM allows NetBox to fetch live data from devices and return it to a requester via its REST API.

!!! info
To enable the integration, the NAPALM library must be installed. See [installation steps](../../installation/2-netbox/#napalm-automation-optional) for more information.

```
GET /api/dcim/devices/1/napalm/?method=get_environment

{
"get_environment": {
...
}
}
```

## Authentication

By default, the [`NAPALM_USERNAME`](../../configuration/optional-settings/#napalm_username) and [`NAPALM_PASSWORD`](../../configuration/optional-settings/#napalm_password) are used for NAPALM authentication. They can be overridden for an individual API call through the `X-NAPALM-Username` and `X-NAPALM-Password` headers.

```
$ curl "http://localhost/api/dcim/devices/1/napalm/?method=get_environment" \
-H "Authorization: Token f4b378553dacfcfd44c5a0b9ae49b57e29c552b5" \
-H "Content-Type: application/json" \
-H "Accept: application/json; indent=4" \
-H "X-NAPALM-Username: foo" \
-H "X-NAPALM-Password: bar"
```

## Method Support

The list of supported NAPALM methods depends on the [NAPALM driver](https://napalm.readthedocs.io/en/latest/support/index.html#general-support-matrix) configured for the platform of a device. NetBox only supports [get](https://napalm.readthedocs.io/en/latest/support/index.html#getters-support-matrix) methods.

## Multiple Methods

More than one method in an API call can be invoked by adding multiple `method` parameters. For example:

```
GET /api/dcim/devices/1/napalm/?method=get_ntp_servers&method=get_ntp_peers

{
"get_ntp_servers": {
...
},
"get_ntp_peers": {
...
}
}
```

## Optional Arguments

The behavior of NAPALM drivers can be adjusted according to the [optional arguments](https://napalm.readthedocs.io/en/latest/support/index.html#optional-arguments). NetBox exposes those arguments using headers prefixed with `X-NAPALM-`.


For instance, the SSH port is changed to 2222 in this API call:

```
$ curl "http://localhost/api/dcim/devices/1/napalm/?method=get_environment" \
-H "Authorization: Token f4b378553dacfcfd44c5a0b9ae49b57e29c552b5" \
-H "Content-Type: application/json" \
-H "Accept: application/json; indent=4" \
-H "X-NAPALM-port: 2222"
```
12 changes: 10 additions & 2 deletions docs/development/extending-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ If the new field will be included in the object list view, add a column to the m

Edit the object's view template to display the new field. There may also be a custom add/edit form template that needs to be updated.

### 11. Adjust API and model tests
### 11. Create/extend test cases

Extend the model and/or API tests to verify that the new field and any accompanying validation logic perform as expected. This is especially important for relational fields.
Create or extend the relevant test cases to verify that the new field and any accompanying validation logic perform as expected. This is especially important for relational fields. NetBox incorporates various test suites, including:

* API serializer/view tests
* Filter tests
* Form tests
* Model tests
* View tests

Be diligent to ensure all of the relevant test suites are adapted or extended as necessary to test any new functionality.
37 changes: 37 additions & 0 deletions docs/release-notes/version-2.6.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
# v2.6.12 (2020-01-13)

## Enhancements

* [#1982](https://github.com/netbox-community/netbox/issues/1982) - Improved NAPALM method documentation in Swagger (OpenAPI)
* [#2050](https://github.com/netbox-community/netbox/issues/2050) - Preview image attachments when hovering over the link
* [#2113](https://github.com/netbox-community/netbox/issues/2113) - Allow NAPALM driver settings to be changed with request headers
* [#2589](https://github.com/netbox-community/netbox/issues/2589) - Toggle the display of child prefixes/IP addresses
* [#3009](https://github.com/netbox-community/netbox/issues/3009) - Search by description when assigning IP address to interfaces
* [#3021](https://github.com/netbox-community/netbox/issues/3021) - Add `tenant` filter field for cables
* [#3090](https://github.com/netbox-community/netbox/issues/3090) - Enable filtering of interfaces by name on the device view
* [#3187](https://github.com/netbox-community/netbox/issues/3187) - Add rack selection field to rack elevations view
* [#3393](https://github.com/netbox-community/netbox/issues/3393) - Paginate assigned circuits at the provider details view
* [#3440](https://github.com/netbox-community/netbox/issues/3440) - Add total path length to cable trace
* [#3491](https://github.com/netbox-community/netbox/issues/3491) - Include content of response on webhook error
* [#3623](https://github.com/netbox-community/netbox/issues/3623) - Enable word expansion during interface creation
* [#3668](https://github.com/netbox-community/netbox/issues/3668) - Enable searching by DNS name when assigning IP address
* [#3851](https://github.com/netbox-community/netbox/issues/3851) - Allow passing initial data to custom script forms
* [#3891](https://github.com/netbox-community/netbox/issues/3891) - Add `local_context_data` filter for virtual machines

## Bug Fixes

* [#3589](https://github.com/netbox-community/netbox/issues/3589) - Fix validation on tagged VLANs of an interface
* [#3849](https://github.com/netbox-community/netbox/issues/3849) - Fix ordering of models when dumping data to JSON
* [#3853](https://github.com/netbox-community/netbox/issues/3853) - Fix device role link on config context view
* [#3856](https://github.com/netbox-community/netbox/issues/3856) - Allow filtering VM interfaces by multiple MAC addresses
* [#3857](https://github.com/netbox-community/netbox/issues/3857) - Fix rendering of grouped custom links
* [#3862](https://github.com/netbox-community/netbox/issues/3862) - Allow filtering device components by multiple device names
* [#3864](https://github.com/netbox-community/netbox/issues/3864) - Disallow /0 masks for prefixes and IP addresses
* [#3872](https://github.com/netbox-community/netbox/issues/3872) - Paginate related IPs on the IP address view
* [#3876](https://github.com/netbox-community/netbox/issues/3876) - Fix minimum/maximum value rendering for site ASN field
* [#3882](https://github.com/netbox-community/netbox/issues/3882) - Fix filtering of devices by rack group
* [#3898](https://github.com/netbox-community/netbox/issues/3898) - Fix references to deleted cables without a label
* [#3905](https://github.com/netbox-community/netbox/issues/3905) - Fix divide-by-zero on power feeds with low power values

---

# v2.6.11 (2020-01-03)

## Bug Fixes
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pages:
- Custom Scripts: 'additional-features/custom-scripts.md'
- Export Templates: 'additional-features/export-templates.md'
- Graphs: 'additional-features/graphs.md'
- NAPALM: 'additional-features/napalm.md'
- Prometheus Metrics: 'additional-features/prometheus-metrics.md'
- Reports: 'additional-features/reports.md'
- Tags: 'additional-features/tags.md'
Expand Down
7 changes: 7 additions & 0 deletions netbox/circuits/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
from .constants import *
from .models import Circuit, CircuitTermination, CircuitType, Provider

__all__ = (
'CircuitFilter',
'CircuitTerminationFilter',
'CircuitTypeFilter',
'ProviderFilter',
)


class ProviderFilter(CustomFieldFilterSet, CreatedUpdatedFilterSet):
id__in = NumericInFilter(
Expand Down
Loading