6.5 KiB
NetBox v3.0
v3.0-beta1 (FUTURE)
Breaking Changes
- The default CSV export format for all objects now includes all available data. Additionally, the CSV headers now use human-friendly titles rather than the raw field names.
- Support for queryset caching configuration (
caching_config) has been removed from the plugins API (see #6639). - The
cacheops_*metrics have been removed from the Prometheus exporter (see #6639). - The
invalidatemanagement command has been removed. - The redundant REST API endpoints for console, power, and interface connections have been removed. The same data can be retrieved using the respective model endpoints with the
?connected=Truefilter applied.
New Features
REST API Token Provisioning (#5264)
This release introduces the /api/users/tokens/ REST API endpoint, which includes a child endpoint that can be employed by a user to provision a new REST API token. This allows a user to gain REST API access without needing to first create a token via the web UI.
$ curl -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json; indent=4" \
https://netbox/api/users/tokens/provision/
{
"username": "hankhill",
"password: "I<3C3H8",
}
If the supplied credentials are valid, NetBox will create and return a new token for the user.
Custom Model Validation (#5963)
This release introduces the CUSTOM_VALIDATORS configuration parameter, which allows administrators to map NetBox models to custom validator classes to enforce custom validation logic. For example, the following configuration requires every site to have a name of at least ten characters and a description:
from extras.validators import CustomValidator
CUSTOM_VALIDATORS = {
'dcim.site': (
CustomValidator({
'name': {
'min_length': 10,
},
'description': {
'required': True,
}
}),
)
}
CustomValidator can also be subclassed to enforce more complex logic by overriding its validate() method. See the custom validation documentation for more details.
Custom Queue Support for Plugins (#6651)
NetBox uses Redis and Django-RQ for background task queuing. Whereas previous releases employed only a single default queue, NetBox now provides a high-, medium- (default), and low-priority queue for use by plugins. (These will also likely be used internally as new functionality is added in future releases.)
Plugins can also now create their own custom queues by defining a queues list within their PluginConfig class:
class MyPluginConfig(PluginConfig):
name = 'myplugin'
...
queues = [
'queue1',
'queue2',
'queue-whatever-the-name'
]
Note that NetBox's rqworker process will not service custom queues by default, since it has not way to infer the priority of each queue. Plugin authors should be diligent in including instructions for proper queue setup in their plugin's documentation.
Enhancements
- #2434 - Add option to assign IP address upon creating a new interface
- #3665 - Enable rendering export templates via REST API
- #3682 - Add
colorfield to front and rear ports - #4609 - Allow marking prefixes as fully utilized
- #5806 - Add kilometer and mile as choices for cable length unit
- #6154 - Allow decimal values for cable lengths
- #6590 - Introduce a nightly housekeeping command to clear expired sessions and change records
Other Changes
- #5223 - Remove the console/power/interface connections REST API endpoints
- #5532 - Drop support for Python 3.6
- #5994 - Drop support for
display_fieldargument on ObjectVar - #6068 - Drop support for legacy static CSV export
- #6338 - Decimal fields are no longer coerced to strings in REST API
- #6639 - Drop support for queryset caching (django-cacheops)
- #6713 - Checking for new releases is now done as part of the housekeeping routine
Configuration Changes
- The
CACHE_TIMEOUTconfiguration parameter has been removed. - The
RELEASE_CHECK_TIMEOUTconfiguration parameter has been removed.
REST API Changes
- Added the
/api/users/tokens/endpoint- The
provision/child endpoint can be used to provision new REST API tokens by supplying a valid username and password
- The
- Removed the following "connections" endpoints:
/api/dcim/console-connections/api/dcim/power-connections/api/dcim/interface-connections
- dcim.Cable
lengthis now a decimal value
- dcim.Device
- Removed the
display_nameattribute (usedisplayinstead)
- Removed the
- dcim.DeviceType
- Removed the
display_nameattribute (usedisplayinstead)
- Removed the
- dcim.FrontPort
- Added
colorfield
- Added
- dcim.FrontPortTemplate
- Added
colorfield
- Added
- dcim.Rack
- Removed the
display_nameattribute (usedisplayinstead)
- Removed the
- dcim.RearPort
- Added
colorfield
- Added
- dcim.RearPortTemplate
- Added
colorfield
- Added
- dcim.Site
latitudeandlongitudeare now decimal fields rather than strings
- extras.ContentType
- Removed the
display_nameattribute (usedisplayinstead)
- Removed the
- ipam.Prefix
- Added the
mark_utilizedboolean field
- Added the
- ipam.VLAN
- Removed the
display_nameattribute (usedisplayinstead)
- Removed the
- ipam.VRF
- Removed the
display_nameattribute (usedisplayinstead)
- Removed the
- virtualization.VirtualMachine
vcpusis now a decimal field rather than a string