You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/administration/error-reporting.md
+3-15
Original file line number
Diff line number
Diff line change
@@ -4,27 +4,15 @@
4
4
5
5
### Enabling Error Reporting
6
6
7
-
NetBox supports 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.
8
-
9
-
```python
10
-
SENTRY_ENABLED=True
11
-
```
12
-
13
-
### Using a Custom DSN
14
-
15
-
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:
Once you have obtained a DSN, configure Sentry in NetBox's `configuration.py` file with the following parameters:
7
+
NetBox supports native integration with [Sentry](https://sentry.io/) for automatic error reporting. To enable this functionality, set `SENTRY_ENABLED` to True and define your unique [data source name (DSN)](https://docs.sentry.io/product/sentry-basics/concepts/dsn-explainer/) in `configuration.py`.
Copy file name to clipboardExpand all lines: docs/configuration/data-validation.md
+21
Original file line number
Diff line number
Diff line change
@@ -87,3 +87,24 @@ The following colors are supported:
87
87
*`gray`
88
88
*`black`
89
89
*`white`
90
+
91
+
---
92
+
93
+
## PROTECTION_RULES
94
+
95
+
!!! tip "Dynamic Configuration Parameter"
96
+
97
+
This is a mapping of models to [custom validators](../customization/custom-validation.md) against which an object is evaluated immediately prior to its deletion. If validation fails, the object is not deleted. An example is provided below:
Copy file name to clipboardExpand all lines: docs/configuration/miscellaneous.md
+16-2
Original file line number
Diff line number
Diff line change
@@ -80,6 +80,17 @@ changes in the database indefinitely.
80
80
81
81
---
82
82
83
+
## CHANGELOG_SKIP_EMPTY_CHANGES
84
+
85
+
Default: True
86
+
87
+
If enabled, a change log record will not be created when an object is updated without any changes to its existing field values.
88
+
89
+
!!! note
90
+
The object's `last_updated` field will always reflect the time of the most recent update, regardless of this parameter.
91
+
92
+
---
93
+
83
94
## DATA_UPLOAD_MAX_MEMORY_SIZE
84
95
85
96
Default: `2621440` (2.5 MB)
@@ -92,9 +103,12 @@ The maximum size (in bytes) of an incoming HTTP request (i.e. `GET` or `POST` da
92
103
93
104
!!! tip "Dynamic Configuration Parameter"
94
105
95
-
Default: False
106
+
Default: True
107
+
108
+
By default, NetBox will prevent the creation of duplicate prefixes and IP addresses in the global table (that is, those which are not assigned to any VRF). This validation can be disabled by setting `ENFORCE_GLOBAL_UNIQUE` to False.
96
109
97
-
By default, NetBox will permit users to create duplicate prefixes and IP addresses in the global table (that is, those which are not assigned to any VRF). This behavior can be disabled by setting `ENFORCE_GLOBAL_UNIQUE` to True.
110
+
!!! info "Changed in v3.7"
111
+
The default value for this parameter was changed from False to True in NetBox v3.7.
Copy file name to clipboardExpand all lines: docs/configuration/required-parameters.md
+3-6
Original file line number
Diff line number
Diff line change
@@ -59,10 +59,7 @@ DATABASE = {
59
59
60
60
## REDIS
61
61
62
-
[Redis](https://redis.io/) is an in-memory data store similar to memcached. While Redis has been an optional component of
63
-
NetBox since the introduction of webhooks in version 2.4, it is required starting in 2.6 to support NetBox's caching
64
-
functionality (as well as other planned features). In 2.7, the connection settings were broken down into two sections for
65
-
task queuing and caching, allowing the user to connect to different Redis instances/databases per feature.
62
+
[Redis](https://redis.io/) is a lightweight in-memory data store similar to memcached. NetBox employs Redis for background task queuing and other features.
66
63
67
64
Redis is configured using a configuration setting similar to `DATABASE` and these settings are the same for both of the `tasks` and `caching` subsections:
Copy file name to clipboardExpand all lines: docs/customization/custom-fields.md
+12-4
Original file line number
Diff line number
Diff line change
@@ -40,14 +40,22 @@ Related custom fields can be grouped together within the UI by assigning each th
40
40
41
41
This parameter has no effect on the API representation of custom field data.
42
42
43
-
### Visibility
43
+
### Visibility & Editing
44
44
45
-
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.
45
+
!!! info "This feature was improved in NetBox v3.7."
46
46
47
-
***Read/write** (default): The custom field is included when viewing and editing objects.
48
-
***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.)
47
+
When creating a custom field, users can control the conditions under which it may be displayed and edited within the NetBox user interface. The following choices are available for controlling the display of a custom field on an object:
48
+
49
+
***Always** (default): The custom field is included when viewing an object.
50
+
***If Set**: The custom field is included only if a value has been defined for the object.
49
51
***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.
50
52
53
+
Additionally, the following options are available for controlling whether custom field values can be altered within the NetBox UI:
54
+
55
+
***Yes** (default): The custom field's value may be modified when editing an object.
56
+
***No**: The custom field is displayed for reference when editing an object, but its value may not be modified.
57
+
***Hidden**: The custom field is not displayed when editing an object.
58
+
51
59
Note that this setting has no impact on the REST or GraphQL APIs: Custom field data will always be available via either API.
Copy file name to clipboardExpand all lines: docs/customization/custom-validation.md
+2
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,8 @@ The `CustomValidator` class supports several validation types:
26
26
*`regex`: Application of a [regular expression](https://en.wikipedia.org/wiki/Regular_expression)
27
27
*`required`: A value must be specified
28
28
*`prohibited`: A value must _not_ be specified
29
+
*`eq`: A value must be equal to the specified value
30
+
*`neq`: A value must _not_ be equal to the specified value
29
31
30
32
The `min` and `max` types should be defined for numeric values, whereas `min_length`, `max_length`, and `regex` are suitable for character strings (text values). The `required` and `prohibited` validators may be used for any field, and should be passed a value of `True`.
Copy file name to clipboardExpand all lines: docs/development/application-registry.md
+9-1
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ A dictionary of particular features (e.g. custom fields) mapped to the NetBox mo
31
31
'dcim': ['site', 'rack', 'devicetype', ...],
32
32
...
33
33
},
34
-
'webhooks': {
34
+
'event_rules': {
35
35
'extras': ['configcontext', 'tag', ...],
36
36
'dcim': ['site', 'rack', 'devicetype', ...],
37
37
},
@@ -41,6 +41,10 @@ A dictionary of particular features (e.g. custom fields) mapped to the NetBox mo
41
41
42
42
Supported model features are listed in the [features matrix](./models.md#features-matrix).
43
43
44
+
### `models`
45
+
46
+
This key lists all models which have been registered in NetBox which are not designated for private use. (Setting `_netbox_private` to True on a model excludes it from this list.) As with individual features under `model_features`, models are organized by app label.
47
+
44
48
### `plugins`
45
49
46
50
This store maintains all registered items for plugins, such as navigation menus, template extensions, etc.
@@ -49,6 +53,10 @@ This store maintains all registered items for plugins, such as navigation menus,
49
53
50
54
A dictionary mapping each model (identified by its app and label) to its search index class, if one has been registered for it.
51
55
56
+
### `tables`
57
+
58
+
A dictionary mapping table classes to lists of extra columns that have been registered by plugins using the `register_table_column()` utility function. Each column is defined as a tuple of name and column instance.
59
+
52
60
### `views`
53
61
54
62
A hierarchical mapping of registered views for each model. Mappings are added using the `register_model_view()` decorator, and URLs paths can be generated from these using `get_model_urls()`.
[Django migrations](https://docs.djangoproject.com/en/stable/topics/migrations/) are used to express changes to the database schema. In most cases, Django can generate these automatically, however very complex changes may require manual intervention. Always remember to specify a short but descriptive name when generating a new migration.
@@ -16,7 +29,7 @@ Where possible, try to merge related changes into a single migration. For exampl
16
29
!!! warning "Do not alter existing migrations"
17
30
Migrations can only be merged within a release. Once a new release has been published, its migrations cannot be altered (other than for the purpose of correcting a bug).
18
31
19
-
## 2. Add validation logic to `clean()`
32
+
## 3. Add validation logic to `clean()`
20
33
21
34
If the new field introduces additional validation requirements (beyond what's included with the field itself), implement them in the model's `clean()` method. Remember to call the model's original method using `super()` before or after your custom validation as appropriate:
22
35
@@ -31,15 +44,15 @@ class Foo(models.Model):
31
44
raise ValidationError()
32
45
```
33
46
34
-
## 3. Update relevant querysets
47
+
## 4. Update relevant querysets
35
48
36
49
If you're adding a relational field (e.g. `ForeignKey`) and intend to include the data when retrieving a list of objects, be sure to include the field using `prefetch_related()` as appropriate. This will optimize the view and avoid extraneous database queries.
37
50
38
-
## 4. Update API serializer
51
+
## 5. Update API serializer
39
52
40
53
Extend the model's API serializer in `<app>.api.serializers` to include the new field. In most cases, it will not be necessary to also extend the nested serializer, which produces a minimal representation of the model.
41
54
42
-
## 5. Add fields to forms
55
+
## 6. Add fields to forms
43
56
44
57
Extend any forms to include the new field(s) as appropriate. These are found under the `forms/` directory within each app. Common forms include:
45
58
@@ -48,23 +61,23 @@ Extend any forms to include the new field(s) as appropriate. These are found und
48
61
* **CSV import** - The form used when bulk importing objects in CSV format
49
62
* **Filter** - Displays the options available for filtering a list of objects (both UI and API)
50
63
51
-
## 6. Extend object filter set
64
+
## 7. Extend object filter set
52
65
53
66
If the new field should be filterable, add it to the `FilterSet` for the model. If the field should be searchable, remember to query it in the FilterSet's `search()` method.
54
67
55
-
## 7. Add column to object table
68
+
## 8. Add column to object table
56
69
57
70
If the new field will be included in the object list view, add a column to the model's table. For simple fields, adding the field name to `Meta.fields` will be sufficient. More complex fields may require declaring a custom column. Also add the field name to `default_columns` if the column should be present in the table by default.
58
71
59
-
## 8. Update the SearchIndex
72
+
## 9. Update the SearchIndex
60
73
61
74
Where applicable, add the new field to the model's SearchIndex for inclusion in global search.
62
75
63
-
## 9. Update the UI templates
76
+
## 10. Update the UI templates
64
77
65
78
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.
66
79
67
-
## 10. Create/extend test cases
80
+
## 11. Create/extend test cases
68
81
69
82
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:
70
83
@@ -74,8 +87,8 @@ Create or extend the relevant test cases to verify that the new field and any ac
74
87
* Model tests
75
88
* View tests
76
89
77
-
Be diligent to ensure all of the relevant test suites are adapted or extended as necessary to test any new functionality.
90
+
Be diligent to ensure all the relevant test suites are adapted or extended as necessary to test any new functionality.
78
91
79
-
## 11. Update the model's documentation
92
+
## 12. Update the model's documentation
80
93
81
94
Each model has a dedicated page in the documentation, at `models/<app>/<model>.md`. Update this file to include any relevant information about the new field.
0 commit comments