4.3 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.
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.
Enhancements
- #2434 - Add option to assign IP address upon creating a new interface
- #3665 - Enable rendering export templates via REST API
- #3682 - Add
color
field 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
- #5532 - Drop support for Python 3.6
- #5994 - Drop support for
display_field
argument on ObjectVar - #6068 - Drop support for legacy static CSV export
- #6338 - Decimal fields are no longer coerced to strings in REST API
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
- dcim.Cable
length
is now a decimal value
- dcim.Device
- Removed the
display_name
attribute (usedisplay
instead)
- Removed the
- dcim.DeviceType
- Removed the
display_name
attribute (usedisplay
instead)
- Removed the
- dcim.FrontPort
- Added
color
field
- Added
- dcim.FrontPortTemplate
- Added
color
field
- Added
- dcim.Rack
- Removed the
display_name
attribute (usedisplay
instead)
- Removed the
- dcim.RearPort
- Added
color
field
- Added
- dcim.RearPortTemplate
- Added
color
field
- Added
- dcim.Site
latitude
andlongitude
are now decimal fields rather than strings
- extras.ContentType
- Removed the
display_name
attribute (usedisplay
instead)
- Removed the
- ipam.Prefix
- Added the
mark_utilized
boolean field
- Added the
- ipam.VLAN
- Removed the
display_name
attribute (usedisplay
instead)
- Removed the
- ipam.VRF
- Removed the
display_name
attribute (usedisplay
instead)
- Removed the
- virtualization.VirtualMachine
vcpus
is now a decimal field rather than a string