Selecting Pynetbox Version

If you have:And you need:Then you need to use:Because:
NetBox 3.7.0 or newerVPNspynetbox 7.3.3 or newervpn app was added in pynetbox
NetBox 3.5.0 or newerASN rangespynetbox 7.1.0 or newerasn_ranges.available_asns was added in pynetbox
NetBox 3.3.0 or newerCable terminationspynetbox 7.0.0 or newerCable terminations were changed in NetBox 3.3
NetBox older than 3.3.0Cable terminationspynetbox 6.6.2 (or older)pynetbox 7.0.0 (or newer) only supports NetBox 3.3 or newer
NetBox 3.2.0 or newer/api/ipam/vlan-groups/<id>/available_vlans pynetbox 6.5.0 or newerFeature was added in NetBox 3.2
NetBox 3.1.1 or newer/api/ipam/prefixes/<id>/available_ips (or _prefixes)pynetbox 6.4.1 or newerNetBox behaviour was changed, pynetbox was updated to support that
NetBox 3.1.0 or newer/api/wirelesspynetbox 6.4.0 or newerwireless app was added in pynetbox
NetBox 3.0.0 or newer/api/users/tokens/provisionpynetbox 6.3.0 or newerApi.create_token() was added in pynetbox
NetBox 2.10.0 or newer/api/statuspynetbox 5.2.0 or newerApi.status() was added in pynetbox
NetBox 2.9.0 or newer/api/userspynetbox 5.2.0 or newerusers app was added in pynetbox
NetBox 2.9.0 or newerTagspynetbox 5.1.2 or newerTag handling was changed in NetBox, pynetbox was updated to support that

Whenever upgrading pynetbox always read the full release notes between your current version and the new version to see the affecting changes.

Reminder: You can check Api.version in your code to make it compatible with various NetBox versions if needed, for example (see also Comparing Version Numbers in Python):

import os

import pynetbox
# pkg_resources is part of setuptools
from pkg_resources import parse_version as version


token = os.getenv("NETBOX_TOKEN")
netbox = pynetbox.api("https://netbox.example.com", token)

if version(netbox.version) >= version("3.1"):
    print("NetBox 3.1+ detected")
else:
    print("Not running the latest NetBox series yet eh?")

Leave a Reply