caching_config) has been removed from the plugins API (see #6639).cacheops_* metrics have been removed from the Prometheus exporter (see #6639).invalidate management command has been removed.?connected=True filter applied.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.
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.
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.
color field to front and rear portsdisplay_field argument on ObjectVarCACHE_TIMEOUT configuration parameter has been removed.RELEASE_CHECK_TIMEOUT configuration parameter has been removed./api/users/tokens/ endpoint
provision/ child endpoint can be used to provision new REST API tokens by supplying a valid username and password/api/dcim/console-connections/api/dcim/power-connections/api/dcim/interface-connectionslength is now a decimal valuedisplay_name attribute (use display instead)display_name attribute (use display instead)color fieldcolor fielddisplay_name attribute (use display instead)color fieldcolor fieldlatitude and longitude are now decimal fields rather than stringsdisplay_name attribute (use display instead)mark_utilized boolean fielddisplay_name attribute (use display instead)display_name attribute (use display instead)vcpus is now a decimal field rather than a string