Skip to content

Commit

Permalink
Merge branch 'feature' into feature-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Jul 17, 2024
2 parents 938aa7b + b2c5a46 commit d3e2993
Show file tree
Hide file tree
Showing 176 changed files with 16,216 additions and 11,780 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ body:
attributes:
label: NetBox Version
description: What version of NetBox are you currently running?
placeholder: v4.0.6
placeholder: v4.0.7
validations:
required: true
- type: dropdown
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ body:
attributes:
label: NetBox version
description: What version of NetBox are you currently running?
placeholder: v4.0.6
placeholder: v4.0.7
validations:
required: true
- type: dropdown
Expand Down
11 changes: 11 additions & 0 deletions docs/configuration/error-reporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ The sampling rate for errors. Must be a value between 0 (disabled) and 1.0 (repo

---

## SENTRY_SEND_DEFAULT_PII

Default: False

Maps to the Sentry SDK's [`send_default_pii`](https://docs.sentry.io/platforms/python/configuration/options/#send-default-pii) parameter. If enabled, certain personally identifiable information (PII) is added.

!!! warning "Sensitive data"
If you enable this option, be aware that sensitive data such as cookies and authentication tokens will be logged.

---

## SENTRY_TAGS

An optional dictionary of tag names and values to apply to Sentry error reports.For example:
Expand Down
4 changes: 2 additions & 2 deletions docs/configuration/system.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ The dotted path to the desired search backend class. `CachedValueSearchBackend`

Default: None (local storage)

The backend storage engine for handling uploaded files (e.g. image attachments). NetBox supports integration with the [`django-storages`](https://django-storages.readthedocs.io/en/stable/) package, which provides backends for several popular file storage services. If not configured, local filesystem storage will be used.
The backend storage engine for handling uploaded files (e.g. image attachments). NetBox supports integration with the [`django-storages`](https://django-storages.readthedocs.io/en/stable/) and [`django-storage-swift`](https://github.com/dennisv/django-storage-swift) packages, which provide backends for several popular file storage services. If not configured, local filesystem storage will be used.

The configuration parameters for the specified storage backend are defined under the `STORAGE_CONFIG` setting.

Expand All @@ -187,7 +187,7 @@ The configuration parameters for the specified storage backend are defined under

Default: Empty

A dictionary of configuration parameters for the storage backend configured as `STORAGE_BACKEND`. The specific parameters to be used here are specific to each backend; see the [`django-storages` documentation](https://django-storages.readthedocs.io/en/stable/) for more detail.
A dictionary of configuration parameters for the storage backend configured as `STORAGE_BACKEND`. The specific parameters to be used here are specific to each backend; see the documentation for your selected backend ([`django-storages`](https://django-storages.readthedocs.io/en/stable/) or [`django-storage-swift`](https://github.com/dennisv/django-storage-swift)) for more detail.

If `STORAGE_BACKEND` is not defined, this setting will be ignored.

Expand Down
2 changes: 2 additions & 0 deletions docs/development/release-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,6 @@ First, run the `build-site` action, by navigating to Actions > build-site > Run

Once the documentation files have been compiled, they must be published by running the `deploy-kinsta` action. Select the desired deployment environment (staging or production) and specify `latest` as the deploy tag.

Clear the CDN cache from the [Kinsta](https://my.kinsta.com/) portal. Navigate to _Sites_ / _NetBox Labs_ / _Live_, select _CDN_ in the left-nav, click the _Clear CDN cache_ button, and confirm the clear operation.

Finally, verify that the documentation at <https://netboxlabs.com/docs/netbox/en/stable/> has been updated.
4 changes: 4 additions & 0 deletions docs/features/facilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ A site typically represents a building within a region and/or site group. Each s

A location can be any logical subdivision within a building, such as a floor or room. Like regions and site groups, locations can be nested into a self-recursive hierarchy for maximum flexibility. And like sites, each location has an operational status assigned to it.

## Rack Types

A rack type represents a unique specification of a rack which exists in the real world. Each rack type can be setup with weight, height, and unit ordering. New racks of this type can then be created in NetBox, and any associated specifications will be automatically replicated from the device type.

## Racks

Finally, NetBox models each equipment rack as a discrete object within a site and location. These are physical objects into which devices are installed. Each rack can be assigned an operational status, type, facility ID, and other attributes related to inventory tracking. Each rack also must define a height (in rack units) and width, and may optionally specify its physical dimensions.
Expand Down
47 changes: 6 additions & 41 deletions docs/models/dcim/rack.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ The [location](./location.md) within a site where the rack has been installed (o

The rack's name or identifier. Must be unique to the rack's location, if assigned.

### Rack Type

The [physical type](./racktype.md) of this rack. The rack type defines physical attributes such as height and weight.

### Status

Operational status.
Expand All @@ -43,44 +47,5 @@ The unique physical serial number assigned to this rack.

A unique, locally-administered label used to identify hardware resources.

### Type

A rack can be designated as one of the following types:

* 2-post frame
* 4-post frame
* 4-post cabinet
* Wall-mounted frame
* Wall-mounted cabinet

### Width

The canonical distance between the two vertical rails on a face. (This is typically 19 inches, however other standard widths exist.)

### Height

The height of the rack, measured in units.

### Starting Unit

The number of the numerically lowest unit in the rack. This value defaults to one, but may be higher in certain situations. For example, you may want to model only a select range of units within a shared physical rack (e.g. U13 through U24).

### Outer Dimensions

The external width and depth of the rack can be tracked to aid in floorplan calculations. These measurements must be designated in either millimeters or inches.

### Mounting Depth

The maximum depth of a mounted device that the rack can accommodate, in millimeters. For four-post frames or cabinets, this is the horizontal distance between the front and rear vertical rails. (Note that this measurement does _not_ include space between the rails and the cabinet doors.)

### Weight

The numeric weight of the rack, including a unit designation (e.g. 10 kilograms or 20 pounds).

### Maximum Weight

The maximum total weight capacity for all installed devices, inclusive of the rack itself.

### Descending Units

If selected, the rack's elevation will display unit 1 at the top of the rack. (Most racks use ascending numbering, with unit 1 assigned to the bottommost position.)
!!! note
Some additional fields pertaining to physical attributes such as height and weight can also be defined on each rack, but should generally be defined instead on the [rack type](./racktype.md).
57 changes: 57 additions & 0 deletions docs/models/dcim/racktype.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Rack Types

A rack type defines the physical characteristics of a particular model of [rack](./rack.md).

## Fields

### Manufacturer

The [manufacturer](./manufacturer.md) which produces this type of rack.

### Name

The unique name of the rack type.

### Form Factor

A rack can be designated as one of the following form factors:

* 2-post frame
* 4-post frame
* 4-post cabinet
* Wall-mounted frame
* Wall-mounted cabinet

### Width

The canonical distance between the two vertical rails on a face. (This is typically 19 inches, however other standard widths exist.)

### Height

The height of the rack, measured in units.

### Starting Unit

The number of the numerically lowest unit in the rack. This value defaults to one, but may be higher in certain situations. For example, you may want to model only a select range of units within a shared physical rack (e.g. U13 through U24).

### Outer Dimensions

The external width and depth of the rack can be tracked to aid in floorplan calculations. These measurements must be designated in either millimeters or inches.

### Mounting Depth

The maximum depth of a mounted device that the rack can accommodate, in millimeters. For four-post frames or cabinets, this is the horizontal distance between the front and rear vertical rails. (Note that this measurement does _not_ include space between the rails and the cabinet doors.)

### Weight

The numeric weight of the rack, including a unit designation (e.g. 10 kilograms or 20 pounds).

### Maximum Weight

The maximum total weight capacity for all installed devices, inclusive of the rack itself.

### Descending Units

If selected, the rack's elevation will display unit 1 at the top of the rack. (Most racks use ascending numbering, with unit 1 assigned to the bottommost position.)


17 changes: 17 additions & 0 deletions docs/models/extras/notification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Notification

A notification alerts a user that a specific action has taken place in NetBox, such as an object being modified or a background job completing. A notification may be generated via a user's [subscription](./subscription.md) to a particular object, or by an event rule targeting a [notification group](./notificationgroup.md) of which the user is a member.

## Fields

### User

The recipient of the notification.

### Object

The object to which the notification relates.

### Event Type

The type of event indicated by the notification.
17 changes: 17 additions & 0 deletions docs/models/extras/notificationgroup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Notification Group

A set of NetBox users and/or groups of users identified as recipients for certain [notifications](./notification.md).

## Fields

### Name

The name of the notification group.

### Users

One or more users directly designated as members of the notification group.

### Groups

All users of any selected groups are considered as members of the notification group.
15 changes: 15 additions & 0 deletions docs/models/extras/subscription.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Subscription

A record indicating that a user is to be notified of any changes to a particular NetBox object. A notification maps exactly one user to exactly one object.

When an object to which a user is subscribed changes, a [notification](./notification.md) is generated for the user.

## Fields

### User

The subscribed user.

### Object

The object to which the user is subscribed.
4 changes: 2 additions & 2 deletions docs/models/ipam/vlangroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ A unique human-friendly name.

A unique URL-friendly identifier. (This value can be used for filtering.)

### Minimum & Maximum VLAN IDs
### VLAN ID Ranges

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).
The set of VLAN IDs which are encompassed by the group. By default, this will be the entire range of valid IEEE 802.1Q VLAN IDs (1 to 4094, inclusive). VLANs created within a group must have a VID that falls within one of these ranges. Ranges may not overlap.

### Scope

Expand Down
13 changes: 8 additions & 5 deletions docs/plugins/development/views.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,22 +191,25 @@ class MyView(generic.ObjectView):

### Extra Template Content

Plugins can inject custom content into certain areas of core NetBox views. This is accomplished by subclassing `PluginTemplateExtension`, designating a particular NetBox model, and defining the desired method(s) to render custom content. Five methods are available:
Plugins can inject custom content into certain areas of core NetBox views. This is accomplished by subclassing `PluginTemplateExtension`, optionally designating one or more particular NetBox models, and defining the desired method(s) to render custom content. Five methods are available:

| Method | View | Description |
|---------------------|-------------|-----------------------------------------------------|
| `navbar()` | All | Inject content inside the top navigation bar |
| `list_buttons()` | List view | Add buttons to the top of the page |
| `buttons()` | Object view | Add buttons to the top of the page |
| `alerts()` | Object view | Inject content at the top of the page |
| `left_page()` | Object view | Inject content on the left side of the page |
| `right_page()` | Object view | Inject content on the right side of the page |
| `full_width_page()` | Object view | Inject content across the entire bottom of the page |
| `buttons()` | Object view | Add buttons to the top of the page |
| `list_buttons()` | List view | Add buttons to the top of the page |

!!! info "The `navbar()` method was introduced in NetBox v4.1."

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:
To control where the custom content is injected, plugin authors can specify an iterable of models by overriding the `models` attribute on the subclass. Extensions which do not specify a set of models will be invoked on every view, where supported.

When a PluginTemplateExtension is instantiated, context data is assigned to `self.context`. Available data includes:

* `object` - The object being viewed (object views only)
* `model` - The model of the list view (list views only)
Expand All @@ -223,7 +226,7 @@ from netbox.plugins import PluginTemplateExtension
from .models import Animal

class SiteAnimalCount(PluginTemplateExtension):
model = 'dcim.site'
models = ['dcim.site']

def right_page(self):
return self.render('netbox_animal_sounds/inc/animal_count.html', extra_context={
Expand Down
16 changes: 16 additions & 0 deletions docs/plugins/removal.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,19 @@ DROP TABLE
netbox=> DROP TABLE pluginname_bar;
DROP TABLE
```

### Remove the Django Migration Records

After removing the tables created by a plugin, the migrations that created the tables need to be removed from Django's migration history as well. This is necessary to make it possible to reinstall the plugin at a later time. If the migration history were left in place, Django would skip all migrations that were executed in the course of a previous installation, which would cause the plugin to fail after reinstallation.

```no-highlight
netbox=> SELECT * FROM django_migrations WHERE app='pluginname';
id | app | name | applied
-----+------------+------------------------+-------------------------------
492 | pluginname | 0001_initial | 2023-12-21 11:59:59.325995+00
493 | pluginname | 0002_add_foo | 2023-12-21 11:59:59.330026+00
netbox=> DELETE FROM django_migrations WHERE app='pluginname';
```

!!! warning
Exercise extreme caution when altering Django system tables. Users are strongly encouraged to perform a backup of their database immediately before taking these actions.
38 changes: 37 additions & 1 deletion docs/release-notes/version-4.0.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
# NetBox v4.0

## v4.0.7 (FUTURE)
## v4.0.8 (FUTURE)

---

## v4.0.7 (2024-07-09)

### Enhancements

* [#14554](https://github.com/netbox-community/netbox/issues/14554) - Add support for [django-storage-swift](https://github.com/dennisv/django-storage-swift) storage backend
* [#16424](https://github.com/netbox-community/netbox/issues/16424) - Enable filtering of devices by cluster and cluster group
* [#16716](https://github.com/netbox-community/netbox/issues/16716) - Display NAT address (if any) for OOB IP address under device view
* [#16725](https://github.com/netbox-community/netbox/issues/16725) - Always position the admin section last in the navigation menu
* [#16791](https://github.com/netbox-community/netbox/issues/16791) - Add 200 & 400 Gbps selections for circuit termination port speed
* [#16802](https://github.com/netbox-community/netbox/issues/16802) - Introduce `SENTRY_SEND_DEFAULT_PII` configuration parameter and disable PII export by default
* [#16817](https://github.com/netbox-community/netbox/issues/16817) - Add 200 & 400 Gbps selections for circuit commit rate

### Bug Fixes

* [#16523](https://github.com/netbox-community/netbox/issues/16523) - Restore highlighting of current device in virtual chassis members panel
* [#16654](https://github.com/netbox-community/netbox/issues/16654) - Fix parent item assignment for inventory item bulk import
* [#16657](https://github.com/netbox-community/netbox/issues/16657) - Fix translation of object types in global search
* [#16679](https://github.com/netbox-community/netbox/issues/16679) - Avoid overwriting custom JSON fields during bulk edit
* [#16689](https://github.com/netbox-community/netbox/issues/16689) - System configuration view should reflect static parameters when no config revisions exist
* [#16714](https://github.com/netbox-community/netbox/issues/16714) - Fix cloning of device types with 0U height
* [#16721](https://github.com/netbox-community/netbox/issues/16721) - Fix errant API request after deselecting a rack in device edit form
* [#16723](https://github.com/netbox-community/netbox/issues/16723) - Fix escaping of path to virtual environment in `upgrade.sh`
* [#16735](https://github.com/netbox-community/netbox/issues/16735) - Object list "results" tab should show a count of zero when empty
* [#16747](https://github.com/netbox-community/netbox/issues/16747) - Avoid clearing entire search cache when manually reindexing specific apps/models
* [#16758](https://github.com/netbox-community/netbox/issues/16758) - Ensure manually selected lagnuage persists across browser sessions
* [#16779](https://github.com/netbox-community/netbox/issues/16779) - Fix saved filter selection for child object lists
* [#16780](https://github.com/netbox-community/netbox/issues/16780) - IKE proposal created via REST API should not require authentication_algorithm
* [#16796](https://github.com/netbox-community/netbox/issues/16796) - Allow assignment of VM with no site to a cluster with a site
* [#16806](https://github.com/netbox-community/netbox/issues/16806) - Fix redirect URL when creating contact assignments with "add another" button
* [#16807](https://github.com/netbox-community/netbox/issues/16807) - Fix layout of VLAN edit form when custom fields are present
* [#16808](https://github.com/netbox-community/netbox/issues/16808) - Fix event rule triggering in scenario where objects are updated immediately prior to deletion
* [#16813](https://github.com/netbox-community/netbox/issues/16813) - Fix AttributeError exception when filtering bookmarks in dashboard widget by object type
* [#16843](https://github.com/netbox-community/netbox/issues/16843) - Permit creation of IKE policies via REST API without specifying an IKE mode

---

Expand Down
7 changes: 7 additions & 0 deletions docs/release-notes/version-4.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@
### Enhancements

* [#7537](https://github.com/netbox-community/netbox/issues/7537) - Add a serial number field for virtual machines
* [#8984](https://github.com/netbox-community/netbox/issues/8984) - Enable filtering of custom script output by log level
* [#15156](https://github.com/netbox-community/netbox/issues/15156) - Add `display_url` field to all REST API serializers
* [#16359](https://github.com/netbox-community/netbox/issues/16359) - Enable plugins to embed content in the top navigation bar
* [#16580](https://github.com/netbox-community/netbox/issues/16580) - Enable individual views to enforce `LOGIN_REQUIRED` selectively (remove `AUTH_EXEMPT_PATHS`)

### Plugins

* [#16726](https://github.com/netbox-community/netbox/issues/16726) - Extend `PluginTemplateExtension` to enable registering multiple models

### Other Changes

Expand Down
Loading

0 comments on commit d3e2993

Please sign in to comment.