v2.0.0 - 2023-09-29 #4568
glennmatthews
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
!!! note
Please thoroughly review the release overview below to see what changes may affect you during upgrade. Our "Upgrading from Nautobot v1.X" guide provides a lot of information around pre- and post-migration helpers we have written that should assist you in a successful 2.0 upgrade. If you have any questions, please reach out to us on the #nautobot channel on Network to Code's Slack community or GitHub Discussions.
Release Overview
Added
Alpha UI 2.0 (#3142)
Nautobot 2.0 includes an "alpha" version of a new user interface (UI) for Nautobot, based on the React web framework.
Users can switch between the existing UI and new UI for views supported in the new UI via a "View in New UI" link in the page footer of the existing UI and a "Return to Legacy UI" link in the left sidebar of the new UI.
!!! tip
The new UI also includes a "Submit Feedback" link that can be used to easily submit feedback regarding the new UI to the Nautobot maintainers.
As of Nautobot release 2.0.0, the new UI supports read-only access to Locations, Device Types, Devices, Prefixes, and IP Addresses; these views will be enhanced and refined, and support for additional models and workflows will be added, throughout the Nautobot 2.x release lifecycle.
!!! info
As of Nautobot release 2.0.0, the new UI, as an alpha feature, does not yet support Nautobot Apps (plugins), but this capability will be added and supported in a future release.
Assign an IP Address to Multiple Interfaces (#2403)
Introduced the ability to assign one
IPAddress
to multipleInterfaces
/Devices
andVMInterfaces
/VirtualMachines
by creating a many to many relationship betweenIPAddress
andInterface
/VMInterface
models represented as a through table modelIPAddressToInterface
. This feature allows you to model a network environment where you have anycastIPAddresses
are shared extensively among a large number ofDevices
/VirtualMachines
.As a result of this feature and associated changes, you can no longer assign
Interfaces
/VMInterfaces
during bulk creation ofIPAddresses
, but a separate bulk-create endpoint has been introduced to allow the bulk import ofIPAddressToInterface
assignments.Generic Role Model (#1063)
DeviceRole
,RackRole
, IPAMRole
, andIPAddressRoleChoices
have all been merged into a single genericRole
model. ARole
can now be created and associated to one or more of the content-types that support reference to arole
. These model content-types includedcim.device
,dcim.rack
,virtualization.virtualmachine
,ipam.ipaddress
,ipam.prefix
, andipam.vlan
.IPAM Namespaces (#3337)
The new Namespace model expands on the functionality previously provided by
VRF.enforce_unique
and theENFORCE_GLOBAL_UNIQUE
settings flag, both of which have now been removed. Within a namespace, all VRFs, prefixes, and IP addresses must be unique and non-duplicated. For more details please refer to the documentation.Natural Key Support Across Nautobot Models (#2900)
Nautobot's
BaseModel
base class and related classes now implement automatic support for Django natural keys for lookup and referencing. For example:Developers can refer to the documentation on natural keys for details on how to support and use this feature.
Two new configuration settings,
DEVICE_NAME_AS_NATURAL_KEY
andLOCATION_NAME_AS_NATURAL_KEY
, have been added to allow an administrator to customize the natural-key behavior of these two widely-used models.REST API Query Depth Parameter (#3042)
Added the
?depth
query parameter in Nautobot v2.X to replace the?brief
parameter in the REST API. It enables nested serialization functionality and offers a more dynamic and comprehensive browsable API. It allows users greater control of the API response data and it is available for both retrieving a single object and a list of objects. This parameter is a positive integer value that can range from 0 to 10. To learn more more, check out the documentation on the?depth
query parameter.Site Fields Added 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
andtime_zone
fields.Changed
Aggregate Model Migrated to Prefix (#3302)
The
ipam.Aggregate
model has been removed and all existing aggregates will be migrated toipam.Prefix
withtype
set to "Container". TheAggregate.date_added
field will be migrated toPrefix.date_allocated
and changed from a Date field to a DateTime field with the time set to00:00
.Aggregate.tenant
,Aggregate.rir
andAggregate.description
will be migrated over to the same fields onPrefix
.See the upgrade guide for more details on the data migration.
Changed
created
Field to DateTimeField for ChangeLoggedModel (#2076)The
created
field of all models that inherit fromChangedLoggedModel
, which includesOrganizationalModel
andPrimaryModel
and therefore most objects in the core data model, has been changed from aDateField
to aDateTimeField
for added granularity. Preexisting records will show as created at midnight UTC on their original creation date.All such objects may now be filtered by date or time or a combination of both. All other date-based behavior such as filtering works as it did before.
Collapsed
nautobot.utilities
intonautobot.core
(#2721)nautobot.utilities
no longer exists as a separate Python module or Django app. Its functionality has been collapsed into thenautobot.core
app. See details at Python Code Location Changes.Collapsed Region and Site Models into Location (#2517)
Initial Data Migration
The
Site
andRegion
models have been removed in v2.0 and have been replaced withLocation
of specificLocationType
. As a result, the existingSite
andRegion
data will be migrated to correspondingLocationType
andLocation
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 (id
,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 (id
,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.Model instances that were previously associated to the
ContentType
forSite
(ComputedField
,CustomField
,CustomLink
,ExportTemplate
,ImageAttachment
,JobHook
,Note
,Relationship
,Status
,Tag
andWebhook
) will have theirContentType
replaced withLocation
. 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 (id
,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 (id
,name
,description
,tenant
,facility
,asn
,latitude
,longitude
, etc.) will be created with its parent set to the corresponding "region"Location
if any.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.Model instances that had a
site
attribute (CircuitTermination
,Device
,Location
,PowerPanel
,Rack
,RackGroup
,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.Model instances that were previously associated to the
ContentType
forSite
orRegion
(ComputedField
,CustomField
,CustomLink
,ExportTemplate
,ImageAttachment
,JobHook
,Note
,Relationship
,Status
,Tag
andWebhook
) will have theirContentType
replaced withLocation
. 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.Remove Site and Region Related Fields from Models
Region
andSite
relationships are being removed from these models:CircuitTermination
,Device
,Location
,Rack
,RackGroup
,PowerFeed
,PowerPanel
,ConfigContext
,Prefix
,VLAN
,VLANGroup
,Cluster
.The
ContentType
forRegion
andSite
are being replaced withLocation
on these models:ComputedField
,CustomField
,CustomLink
,ExportTemplate
,ImageAttachment
,JobHook
,Note
,Relationship
,Status
,Tag
andWebhook
.The
region
andsite
fields are being removed in thefilter
data ofDynamicGroup
objects. The previously associated values are being added to the existinglocation
field and its associated list of filter values or to a newlocation
key with an empty list if one does not exist.Check out the API and UI endpoints changes incurred by the changes stated above in the "Upgrading from Nautobot v1.X" guide.
Check out the Region and Site Related Data Model Migration Guide to learn how to migrate your Nautobot Apps and data models from
Site
andRegion
toLocation
.Corrected Filter Fields (#2804)
!!! warning
This change may introduce breaking changes to your existing
DynamicGroup
filters,ObjectPermission
filters,Relationship
filters, and any other saved references to these fields. You should review any existing instances of these models before and after upgrading your production environment for any potentially subtle change. Please refer to the Upgrading from Nautobot v1.X guide for more details.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>
whereashas_console_ports
and similar filters remain the same.Check out the specific changes documented in the table at UI and REST API Filter Changes
Enhanced Filter Fields (#2804)
!!! warning
This change may introduce breaking changes to your existing
DynamicGroup
filters,ObjectPermission
filters,Relationship
filters, and any other saved references to these fields. You should review any existing instances of these models before and after upgrading your production environment for any potentially subtle change. Please refer to the Upgrading from Nautobot v1.X guide for more details.Many filter fields have been enhanced to enable filtering by both names and UUID primary keys.
For example in v1.X, to filter
RackGroups
with a specificparent
value in the UI or make changes to them via the REST API, you could only to input slugs as the filter values:/dcim/rack-groups/?parent=<slug>
Now in v2.x, you are able to filter those
RackGroups
by their parent(s) names or UUID primary keys:/dcim/rack-groups/?parent=<name>
or/dcim/rack-groups/?parent=<uuid>
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
, andIPAddressRoleChoices
have all been removed and replaced with aextras.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 theIPAddress
model has also been changed from a choice field to a foreign key related field to theextras.Role
model.Job Overhaul (#765)
Within Nautobot 2.0, Jobs has undergone significant changes within the overall functionality of Jobs along with migration for existing 1.x Jobs operation. Database changes for Jobs will affect DryRun functionality. Other significant changes to Jobs in 2.0 provide greater interoperability with Celery for registering, logging, and tracking however 2.0 will be moving away from previous backwards compatibility scripts. These improvements will simplify Job implementation and help reduce administration overhead for status tracking on completions and/or failures. For more details, refer to Migrating Jobs from Nautobot v1.X to Nautobot v2.0.
Prefix
is_pool
Field and "Container" Status replaced by New FieldPrefix.type
(#1362)A new
type
field was added toPrefix
to replace theis_pool
boolean field and the "Container" status. Thetype
field can be set to "Network", "Pool" or "Container", with "Network" being the default.Existing prefixes with a status of "Container" will be migrated to the "Container" type. Existing prefixes with
is_pool
set will be migrated to the "Pool" type. Prefixes with bothis_pool
set and a status of "Container" will be migrated to the "Pool" type.The "Container" status will be removed and all prefixes will be migrated to the "Active" status if it exists. If the "Active" status was deleted, prefixes will be migrated to the first available prefix status in the database that is not "Container".
Renamed Database Foreign Keys and Related Names (#2520)
!!! warning
This change may introduce breaking changes to your existing
DynamicGroup
filters,ObjectPermission
filters,Relationship
filters, and any other saved references to these fields. You should review any existing instances of these models before and after upgrading your production environment for any potentially subtle change. Please refer to the Upgrading from Nautobot v1.X guide for more details.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:and to filter
Circuit
objects oftype
"circuit-type-2", you would do:Now in v2.x, we have renamed the Foreign Key field
type
on Circuit Model tocircuit_type
, because this naming convention made it clearer that this Foregin Key field is pointing to the modelCircuitType
. The same operations would look like: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 withCircuitTermination
instances located in sites ["ams01", "ams02", "atl03"], you would do:Now in v2.x, we have renamed the Foreign Key field
circuit
'srelated_name
attributeterminations
onCircuitTermination
Model tocircuit_terminations
, the same operations would look like:Check out more
related-name
changes documented in the table Renamed Database FieldsRenamed Filter Fields (#2804)
!!! warning
This change may introduce breaking changes to your existing
DynamicGroup
filters,ObjectPermission
filters,Relationship
filters, and any other saved references to these fields. You should review any existing instances of these models before and after upgrading your production environment for any potentially subtle change. Please refer to the Upgrading from Nautobot v1.X guide for more details.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 thecabled
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
REST API Versioning Behavior (#2799)
In Nautobot 2.0 and later, the REST API defaults, when the caller doesn't request a specific API version, to using the latest available version of the REST API. This is a change from Nautobot 1.x, where the default behavior was to use the 1.2 version of the REST API even when newer versions were available.
Revamped CSV Import and Export (#254)
Exporting objects and lists of objects to CSV format has been totally reimplemented in a new framework for ease of use and maintainability. Instead of accessing
http://nautobot/<app>/<model>/?export
users can now use the URL patternhttp://nautobot/api/<app>/<model>/?format=csv
(the "Export" links in the UI have of course been updated accordingly), as the new CSV rendering for exports is based on the REST API serializer definitions. This results in substantially more comprehensive CSV representations of many models.Conversely, importing objects from CSV format has also been reimplemented in the same new framework. The REST API can now accept CSV files as well as the existing JSON support, and the UI for importing CSVs uses this same framework behind the scenes.
!!! warning
The Nautobot 2.0 CSV formats for exports and imports are not backwards-compatible with the Nautobot 1.x CSV formats. In general, the CSV formats are subject to refinement in future releases, and should not be considered a stable API for data portability between differing Nautobot versions.
An immediate benefit users can notice from this reimplementation is that CSVs should now generally be "round-trip" capable, meaning that you can export a set of records to CSV format and then import that CSV into a different Nautobot instance (or delete the records and use the CSV to recreate them) without needing to "massage" the CSV into a different set of columns or fields. One caveat to this is many-to-many fields (such as
VRF.import_targets
orInterface.tagged_vlans
), which are not currently included in CSV exports or supported for CSV import, with the exception of objecttags
which are supported. Support for many-to-many export and import via CSV may be added in a future release.A benefit to App developers is that data models no longer need to define a
csv_headers
attribute or implement ato_csv
method, because implementing the REST API for a model is now sufficient to enable CSV import/export support for that model. Similarly, there is no longer a need to implement aCSVForm
for each model in order to support CSV import.In addition to the above improvements, you can now reference related objects in your CSV by using a combination of unique fields. For instance:
Instead of:
you can use:
This enhancement allows you to specify related objects using their unique attributes, making data import even more intuitive and flexible.
Removed
Brief REST API Query Parameter (#3042)
Support for
?brief
REST API query parameter andNested*Serializers
have been removed in Nautobot v2.X. They are replaced by the new?depth
query parameter.django-cacheops
(#1721)Nautobot no longer uses
django-cacheops
for caching of database queries or other information. In some cases this has been replaced by the use of Django's native Redis caching capabilities.The configuration settings
CACHEOPS
,CACHEOPS_DEFAULTS
,CACHEOPS_DEGRADE_ON_FAILURE
,CACHEOPS_ENABLED
,CACHEOPS_HEALTH_CHECK_ENABLED
,CACHEOPS_REDIS
, etc. are now unused by Nautobot and may be removed from your configuration.Legacy
manage.py
Removed (#1634)When we launched Nautobot we introduced the
nautobot-server
command as the primary entrypoint to managing your application, replacing the legacymanage.py
script that is common with Django-based applications. The originalmanage.py
was left there initially in v1.0.0 as a fallback, however it is no longer needed, so we have removed it in Nautobot 2.0.Redundant Filter Fields (#2804)
!!! warning
This change may introduce breaking changes to your existing
DynamicGroup
filters,ObjectPermission
filters,Relationship
filters, and any other saved references to these fields. You should review any existing instances of these models before and after upgrading your production environment for any potentially subtle change. Please refer to the Upgrading from Nautobot v1.X guide for more details.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 names 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
Circuits
with a specificprovider
value in the UI or make changes to them via the REST API with a UUID primary key, you would use:/circuits/circuits/?provider_id=<uuid>
Now in v2.x, that format is no longer supported. Instead, you would use:
/circuits/circuits/?provider=<uuid>
Check out the specific changes documented in the table at UI and REST API Filter Changes
RQ support (#2523)
Support for RQ and
django-rq
, deprecated since Nautobot 1.1.0, has been fully removed from Nautobot 2.0.Slug Fields (#2662)
The
slug
field has been removed from all core models except forGitRepository
. Generally, Nautobot URLs that referenced theslug
field have been changed to use the primary key instead. For example, the URL forhttps://nautobot/dcim/locations/building-01
would change to a URL similar tohttps://nautobot/dcim/locations/e41f381a-a53b-485a-886f-9d36859b47a1
. There are a small number of URLs that still reference a value that's not the primary key, including some URLs related to secrets providers, cables and jobs.A
natural_slug
property has been added to all models that inherit fromBaseModel
to provide a human-readable value for use in tools that require a loose reference to a Nautobot object, but this value is not equivalent to theslug
field and is not guaranteed to be unique.A natural key interface has been provided for most models to allow for uniquely referencing objects by a name that is friendlier than the primary key. For more information on the usage of natural keys vs primary keys see the documentation for Uniquely Identifying a Nautobot Object.
Contributors
New Contributors
url
field to GraphQL output #4163Full Changelog: v1.6.2...v2.0.0
This discussion was created from the release v2.0.0 - 2023-09-29.
Beta Was this translation helpful? Give feedback.
All reactions