Nautobot v2.0
This document describes all new features and changes in Nautobot 2.0.
If you are a user migrating from Nautobot v1.X, please refer to the "Upgrading from Nautobot v1.X" documentation.
Release Overview
Added
Generic Role Model (#1063)
DeviceRole, RackRole, IPAM Role, and IPAddressRoleChoices have all been merged into a single generic Role model. A role can now be created and associated to one or more of the content-types that previously implemented role as a field. These model content-types include dcim.device, dcim.rack, virtualization.virtualmachine, ipam.ipaddress, ipam.prefix, and ipam.vlan.
Added Site Fields to Location (#2954)
Added Site Model Fields to Location. Location Model now has asn
, comments
, contact_email
, contact_name
, contact_phone
, facility
, latitude
, longitude
, physical_address
, shipping_address
and time_zone
fields.
Changed
Collapse Region and Site Models into Location (#2517)
Initial Data Migration
The Site
and Region
models have been removed in v2.0 and have been replaced with Location
of specific LocationType
. As a result, the existing Site
and Region
data will be migrated to corresponding LocationType
and Location
objects. Here is what to expect:
-
If you do not have any
Site
andRegion
instances in your existing database, running this data migration will do nothing. -
If you only have
Region
instances in your existing database, aLocationType
named Region will be created and for each legacyRegion
instance, a correspondingLocation
instance with the same attributes (name
,description
, etc.) and hierarchy will be created. -
If you only have
Site
instances in your existing database:-
A
LocationType
named Site will be created and every preexisting root levelLocationType
in your database will be updated to have the new SiteLocationType
as their parent. -
For each legacy
Site
instance, a correspondingLocation
instance with the same attributes (name
,description
,tenant
,facility
,asn
,latitude
,longitude
, etc.) will be created, and any preexistingLocations
in your database will be updated to have the appropriate "site"Locations
as their parents. -
Model instances that had a
site
field (CircuitTermination
,Device
,PowerPanel
,RackGroup
,Rack
,Prefix
,VLANGroup
,VLAN
,Cluster
) assigned and did not have alocation
attribute assigned will be updated to have theirlocation
point to the newLocation
corresponding to thatSite
. All other attributes on these models will remain unchanged.
For Example:
-
We will start with a
Site
instance with name AMS01 as the baseSite
for two top-levelLocation
objects with names root-01 and root-02 respectively. -
During the data migration, a
LocationType
named Site will be created, and aLocation
of SiteLocationType
named AMS01 with all the information (asn
,latitude
, etc.) from the baseSite
will be created. -
The
Location
objects named root-01 and root-02 will have this AMS01Location
set as theirparent
.
-
-
If you have both
Site
andRegion
instances in your existing database:-
A
LocationType
named Region will be created. -
For each legacy
Region
instance, a correspondingLocation
instance with the same attributes (name
,description
, etc.) will be created. -
A
LocationType
named Site will be created with the newLocationType
named Region set as itsparent
. -
Every pre-existing root-level
LocationType
in your database will be updated to have the newLocationType
named Site as itsparent
. -
For each legacy
Site
instance, a corresponding "site"Location
instance with the same attributes (name
,description
,tenant
,facility
,asn
,latitude
,longitude
, etc.) will be created with its parent set to the corresponding "region"Location
if any.- If you have
Site
instances in your database without aRegion
assigned to them, one additionalLocation
named Global Region ofLocationType
Region will be created and eachLocation
ofLocationType
Site created from the legacy region-lessSite
instances will have the Global RegionLocation
as their parent.
- If you have
-
Model instances that had a
site
attribute (CircuitTermination
,Device
,PowerPanel
,RackGroup
,Rack
,Prefix
,VLANGroup
,VLAN
,Cluster
) assigned and did not have alocation
attribute assigned will be updated to have theirlocation
point to the newLocation
ofLocationType
Site. All other attributes on these models will remain unchanged.
For Example:
-
There are two
Site
instances and oneRegion
instance in your existing database. TheRegion
with name America has one childSite
instance named AMS01. And the otherSite
instance named AUS01 is not associated with anyRegion
(region
attribute is set toNone
). -
The
Site
AMS01 is the baseSite
for two top-levelLocation
objects with names root-01 and root-02 respectively. -
During the data migration, a
LocationType
named Region and aLocation
of thisLocationType
named America with all the same information will be created. -
The
LocationType
named Site with itsparent
set as the newLocationType
Region and aLocation
ofLocationType
named AMS01 with all the same information (asn
,latitude
, etc.) will be created. TheLocation
AMS01 will haveLocation
America as itsparent
and each -Location
root-01 and root-02 will haveLocation
AMS01 as itsparent
. -
Finally, the
Site
instance AUS01, since it does not have aRegion
instance associated with it, its correspondingLocation
AUS01 will have a newLocation
named Global Region ofLocationType
Region as itsparent
. -
In addition, legacy
Site
instance with name AMS01 also has threeDevice
instances associated with it named ams01-edge-01, ams01-edge-02, and ams01-edge-03. -
However, ams01-edge-01 only has its
site
attribute set asSite
AMS01 whereas ams01-edge-02 and ams01-edge-03 have both itssite
andlocation
attributes setSite
AMS01 andLocation
root-01 respectively. -
During the data migration, ams01-edge-01's
location
attribute will point to the newLocation
ofLocationType
Site with name AMS01 while devices ams01-edge-02 and ams01-edge-03 will remain unchanged.
-
Collapsed nautobot.utilities
into nautobot.core
(#2721)
nautobot.utilities
no longer exists as a separate Python module or Django app. Its functionality has been collapsed into the nautobot.core
app. See details at Python Code Location Changes.
Renamed Database Foreign Keys and Related Names (#2520)
Some Foreign Key fields have been renamed to follow a more self-consistent pattern across the Nautobot app. This change is aimed to offer more clarity and predictability when it comes to related object database operations:
For example in v1.x to create a circuit object with type
"circuit-type-1", you would do:
Circuit.objects.create(
cid="Circuit 1",
provider="provider-1",
type="circuit-type-1",
status="active",
)
and to filter Circuit
objects of type
"circuit-type-2", you would do:
Circuit.objects.filter(type="circuit-type-2")
Now in v2.x, we have renamed the Foreign Key field type
on Circuit Model to circuit_type
, because this naming convention made it clearer that this Foregin Key field is pointing to the model CircuitType
. The same operations would look like:
Circuit.objects.create(
cid="Circuit 1",
provider="provider-1",
circuit_type="circuit-type-1",
status="active",
)
Circuit.objects.filter(circuit_type="circuit-type-2")
Check out more Foreign Key related changes documented in the table Renamed Database Fields
In addition to the changes made to Foreign Key fields' own names, some of their related_names
are also renamed:
For example in v1.x, to query Circuit
objects with CircuitTermination
instances located in sites ["ams01", "ams02", "atl03"], you would do:
Circuit.objects.filter(terminations__site__in=["ams01", "ams02", "atl03"])
Now in v2.x, we have renamed the Foreign Key field circuit
's related_name
attribute terminations
on CircuitTermination
Model to circuit_terminations
, the same operations would look like:
Circuit.objects.filter(circuit_terminations__site__in=["ams01", "ams02", "atl03"])
Check out more related-name
changes documented in the table Renamed Database Fields
Renamed Filter Fields (#2804)
Some filter fields have been renamed to reflect their functionalities better.
For example in v1.X, to filter FrontPorts
that has a cable attached in the UI or make changes to them via Rest API, you would use the cabled
filter:
/dcim/front-ports/?cabled=True
Now in v2.x, you would instead use the has_cable
filter which has a more user-friendly name:
/dcim/front-ports/?has_cable=True
Check out the specific changes documented in the table at UI and REST API Filter Changes
Enhanced Filter Fields (#2804)
Many filter fields have been enhanced to enable filtering by both slugs and UUID primary keys.
For example in v1.X, to filter Regions
with a specific parent
value in the UI or make changes to them via Rest API, you are only able to input slugs as the filter values:
/dcim/regions/?parent=<slug>
Now in v2.x, you are able to filter those Regions
by slugs or UUID primary keys:
/dcim/regions/?parent=<slug>
or /dcim/regions/?parent=<uuid>
Check out the specific changes documented in the table at UI and REST API Filter Changes
Corrected Filter Fields (#2804)
There were also instances where a foreign-key related field (e.g. console_ports
) was incorrectly mapped to a boolean membership filter (e.g. has_console_ports
), making it impossible to filter based on specific values of the foreign key:
For example in v1.x:
/dcim/devices/?console_ports=True
and /dcim/devices/?has_console_ports=True
are functionally the same and this behavior is incorrect.
This has been addressed in v2.x as follows:
console_ports
and similar filters are taking foreign key UUIDs as input values and can be used in this format: /dcim/devices/?console_ports=<uuid>
whereas has_console_ports
and similar filters remain the same.
Check out the specific changes documented in the table at UI and REST API Filter Changes
Generic Role Model (#1063)
The DeviceRole
, RackRole
, ipam.Role
, and IPAddressRoleChoices
have all been removed and replaced with a extras.Role
model, This means that all references to any of the replaced models and choices now points to this generic role model.
In addition, the role
field of the IPAddress
model has also been changed from a choice field to a foreign key related field to the extras.Role
model.
Removed
Removed Redundant Filter Fields (#2804)
As a part of breaking changes made in v2.X, shadowed filter/filterset fields are being removed throughout Nautobot.
In Nautobot 1.x, for some of the foreign-key related fields:
- The field was shadowed for the purpose of replacing the PK filter with a lookup-based on a more human-readable value (typically slug
, if available).
- A PK-based filter was available as well, generally with a name suffixed by _id
Now these two filter fields will be replaced by a single filter field that can support both slugs and UUID primary keys as inputs; As a result, PK-based filters suffixed by _id
will no longer be supported in v2.0.
For example in v1.X, to filter Devices
with a specific site
value in the UI or make changes to them via Rest API with a UUID primary key, you will use:
/dcim/devices/?site_id=<uuid>
Now in v2.x, that format is no longer supported. Instead, you would use:
/dcim/devices/?site=<uuid>
Check out the specific changes documented in the table at UI and REST API Filter Changes
Removed RQ support (#2523)
Support for RQ and django-rq
, deprecated since Nautobot 1.1.0, has been fully removed from Nautobot 2.0.
v2.0.0-alpha.1 (2023-01-31)
Added
- #204 - Added style guide documentation for importing python modules in Nautobot.
- #1731 - Added missing filters to
circuits
app. - #1733 - Added support for filtering on many more fields to the
Tenant
andTenantGroup
filtersets. - #2954 - Added fields (
contact_name
,latitude
, etc.) fromSite
model toLocation
model to prepare for merging all sites into locations. - #2955 - Added "Region" and "Site"
LocationTypes
and their respective locations based on existingSite
andRegion
instances. - #3132 - Added the ability for apps to register their models for inclusion in the global Nautobot search.
Changed
- #204 - Changed imports to use module namespaces in
utilities/filters.py
. - #510 - The
Region
,RackGroup
,TenantGroup
, andInventoryItem
models are now based ondjango-tree-queries
instead ofdjango-mptt
. This does change the API for certain tree operations on these models, for exampleget_ancestors()
is nowancestors()
andget_descendants()
is nowdescendants()
. - #510 - The UI and REST API for
Region
,RackGroup
, andTenantGroup
now provide only the related count of objects (e.g.site_count
forRegion
) that are directly related to each instance. Formerly they provided a cumulative total including objects related to its descendants as well. - #510 - Renamed field
_depth
totree_depth
in the REST API forRegion
,RackGroup
,TenantGroup
, andInventoryItem
. - #510 - Renamed InventoryItem database relation
child_items
and filter fieldschild_items
andhas_child_items
tochildren
andhas_children
respectively. - #2163 -
JobLogEntry.log_object
,JobLogEntry.absolute_url
,ScheduledJob.queue
, andWebHook.ca_file_path
no longer permit null database values; use""
instead if needed. - #2822 - Collapsed
DeviceRole
,RackRole
, IPAMRole
model andIPAddressRoleChoices
into a single genericRole
model. - #2674 - Updated development dependency
black
to~22.10.0
. - #2721 - Collapsed
nautobot.utilities
intonautobot.core
. Refer to the 2.0 migration guide for details. - #2771 - Updated
jsonschema
version to~4.17.0
. - #2788 - Changed REST framework allowed versions logic to support 1.2-1.5 and 2.0+.
- #2803 - Updated
mkdocs-include-markdown-plugin
to3.9.1
. - #2809 - Renamed
tag
filter onTenantFilterSet
totags
same as elsewhere. - #2844 - Updated development dependency
mkdocstrings-python
to 0.8.0. - #2872 - Refactored imports in
utilities
app to follow new code style. - #2883 - Updated
django-taggit
to3.1.0
. - #2942 - Updated
django-tree-queries
to0.13.0
. - #2943 - Updated dependency
rich
to~12.6.0
. - #2955 - Changed
CircuitTermination
,Device
,PowerPanel
,RackGroup
,Rack
,Prefix
,VLANGroup
,VLAN
,Cluster
instances associated with existingSite
model instances to use the newly created correspondingLocations
ofLocationType
"Site". - #2993 - Implemented initial database backend for Celery task results.
- #3027 - Updated dependencies
prometheus-client
,django-storages
,drf-spectacular
,black
,django-debug-toolbar
,mkdocstrings
,mkdocstrings-python
,pylint
,requests
,selenium
,watchdog
. - #3068 - Renamed fields on
Circuit
model:type
tocircuit_type
,terminations
tocircuit_terminations
,termination_a
tocircuit_termination_a
, andtermination_z
tocircuit_termination_z
. - #3068 - Renamed reverse-relation
circuittermination
tocircuit_terminations
on theCablePath
model. - #3068 - Renamed
group
field tovlan_group
on VLAN model, renamedipaddresses
toip_addresses
onService
model. - #3068 - Renamed
group
field totenant_group
onTenant
model. - #3069 - Renamed foreign key fields and related names in Virtualization and DCIM apps to follow a common naming convention. See v2 upgrade guide for full list of changes.
- #3177 - Updated
VLANFactory
to generate longer and more "realistic"VLAN
names.
Fixed
- #1982 - Fixed a UI presentation/validation issue with dynamic-groups using foreign-key filters that aren't explicitly defined in the corresponding FilterForm.
- #2808 - Fixed incorrectly named filters in
circuits
app. - #3126 - Fixed
Interface
not raising exception when adding aVLAN
from a differentSite
intagged_vlans
. - #3153 - Made integration test
CableConnectFormTestCase.test_js_functionality
more resilient and less prone to erroneous failures. - #3167 - Fixed
ObjectChange
records not being migrated andlegacy_role__name
not being a property inRole
migrations. - #3177 - Fixed a spurious failure in
BulkEditObjectsViewTestCase.test_bulk_edit_objects_with_constrained_permission
.
Removed
- #510 - Removed dependency on
django-mptt
. Models (Region
,RackGroup
,TenantGroup
,InventoryItem
) that previously were based on MPTT are now implemented usingdjango-tree-queries
instead. - #1731 - Removed redundant filters from
circuits
app. - #2163 - Removed unused
NullableCharField
,NullableCharFieldFilter
andMACAddressField
(not to be confused withMACAddressCharField
, which remains) classes. - #2523 - Removed
django-rq
dependency and support for RQ workers. - #2815 - Removed
pycryptodome
dependency as it is no longer used. - #2993 - Removed
NAUTOBOT_CELERY_RESULT_BACKEND
environment variable used to customize where Celery stores task results. - #2993 - Removed optional settings documentation for
CELERY_RESULT_BACKEND
as it is no longer user-serviceable. - #2993 - Removed optional settings documentation for
CELERY_RESULT_BACKEND_TRANSPORT_OPTIONS
as it is no longer user-serviceable. - #3130 - Removed
CSS_CLASSES
definitions from legacyChoiceSets
.
Contributors
Full Changelog: v1.5.9...v2.0.0-alpha.1