or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

circuits.mdcloud.mdcore-framework.mddcim.mdextensibility.mdindex.mdipam.mdtenancy-users.mdvirtualization-cloud.mdwireless.md
tile.json

tessl/pypi-nautobot

Source of truth and network automation platform for network infrastructure management.

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/nautobot@2.4.x

To install, run

npx @tessl/cli install tessl/pypi-nautobot@2.4.0

index.mddocs/

Nautobot

A comprehensive network source of truth and automation platform built as a Django web application. Nautobot serves as a flexible data platform that enables network infrastructure management through customizable data models, REST APIs, GraphQL interfaces, and Git integration. The platform supports an extensible plugin architecture for creating custom network automation applications, provides comprehensive data validation and relationship management, and offers features like webhooks, change logging, and role-based permissions.

Package Information

  • Package Name: nautobot
  • Package Type: pypi
  • Language: Python
  • Installation: pip install nautobot

Core Imports

import nautobot

For Django setup (required before using any models or APIs):

import nautobot
nautobot.setup()  # Configure Django with Nautobot settings

For model imports:

from nautobot.dcim.models import Device, Location, Interface
from nautobot.ipam.models import IPAddress, Prefix, VLAN
from nautobot.extras.models import Tag, Status, Role

For API usage:

from nautobot.core.api.serializers import NautobotModelSerializer
from nautobot.dcim.api.views import DeviceViewSet

Basic Usage

import nautobot
nautobot.setup()

# Working with devices
from nautobot.dcim.models import Device, Location, DeviceType

# Get all devices
devices = Device.objects.all()

# Get devices at a specific location
location = Location.objects.get(name="Datacenter-1")
location_devices = Device.objects.filter(location=location)

# Create a new device
from nautobot.extras.models import Status
active_status = Status.objects.get(name="Active")

device = Device.objects.create(
    name="router-01",
    device_type=DeviceType.objects.get(model="ASR1001-X"),
    location=location,
    status=active_status
)

# Working with IP addresses
from nautobot.ipam.models import IPAddress, Namespace

# Create an IP address
namespace = Namespace.objects.get(name="Global")
ip = IPAddress.objects.create(
    address="192.168.1.1/24",
    namespace=namespace,
    status=active_status
)

# Assign IP to device interface
from nautobot.dcim.models import Interface
interface = Interface.objects.get(device=device, name="GigabitEthernet0/0/0")
ip.assigned_object = interface
ip.save()

Architecture

Nautobot follows a modular Django architecture with several key components:

  • Models: Database schema and business logic organized by functional area (DCIM, IPAM, etc.)
  • APIs: REST and GraphQL APIs providing full CRUD operations
  • Jobs: Celery-based background task system for automation workflows
  • Plugins: Extensible app architecture allowing custom functionality
  • UI: Django-based web interface with customizable views and forms
  • Data Sources: Git integration for configuration and data management

The plugin system enables third-party developers to extend Nautobot with custom models, APIs, views, and automation logic while maintaining compatibility with the core platform.

Capabilities

Core Framework

Core functionality including Django setup, base models, API infrastructure, form handling, job system, and plugin architecture. Provides the foundation for all other modules.

def setup(config_path=None):
    """Configure Django with Nautobot settings."""

class BaseModel:
    """Abstract base model with UUID primary key, natural keys, and validation."""
    
class NautobotModelSerializer:
    """Main model serializer for API operations."""
    
class NautobotAppConfig:
    """Base app configuration class for plugins."""

Core Framework

Device and Infrastructure Management (DCIM)

Physical and virtual network infrastructure management including devices, locations, racks, cables, power, and device components. Provides comprehensive modeling of network hardware and connectivity.

class Device:
    """Physical network devices."""

class Location:
    """Physical locations/sites."""
    
class Interface:
    """Network interfaces on devices."""
    
class Cable:
    """Physical cable connections."""

Device and Infrastructure Management

IP Address Management (IPAM)

IP address space management including prefixes, IP addresses, VLANs, VRFs, namespaces, and routing. Supports hierarchical IP space organization and VLAN management.

class IPAddress:
    """Individual IP addresses."""
    
class Prefix:
    """IP prefixes/networks."""
    
class VLAN:
    """Virtual LANs."""
    
class VRF:
    """Virtual routing and forwarding instances."""

IP Address Management

Extensibility and Automation

Advanced features including custom fields, relationships, jobs, webhooks, templates, secrets management, and configuration contexts. Enables customization and automation workflows.

class Job:
    """Background job definitions."""
    
class CustomField:
    """Runtime-configurable custom fields."""
    
class Relationship:
    """Custom object relationships."""
    
class Webhook:
    """Webhook integrations."""

Extensibility and Automation

Circuit Management

Service provider circuit management including circuits, providers, and circuit terminations. Manages external network connectivity and carrier services.

class Circuit:
    """Service provider circuits."""
    
class Provider:
    """Service providers."""
    
class CircuitTermination:
    """Circuit endpoints."""

Circuit Management

Tenancy and User Management

Multi-tenancy support and user management including tenants, groups, permissions, and authentication. Provides role-based access control and organizational separation.

class Tenant:
    """Tenant objects for multi-tenancy."""
    
class User:
    """Extended user model."""
    
class ObjectPermission:
    """Object-level permissions."""

Tenancy and User Management

Virtualization and Cloud

Virtual infrastructure management including virtual machines, cloud services, and wireless networks. Extends the DCIM model to virtual and cloud environments.

class VirtualMachine:
    """Virtual machines."""
    
class VMInterface:
    """Virtual machine interfaces."""

Virtualization and Cloud

Installation and Setup

# Install Nautobot
pip install nautobot

# Basic setup in your application
import nautobot
nautobot.setup()  # Must be called before using models or APIs

# Access the version
print(nautobot.__version__)  # "2.4.17"

Configuration

Nautobot requires Django configuration. The setup() function handles this automatically:

import nautobot

# Use default configuration path
nautobot.setup()

# Or specify custom configuration
nautobot.setup(config_path="/path/to/nautobot_config.py")

Common Patterns

Model Access:

from nautobot.dcim.models import Device
devices = Device.objects.filter(status__name="Active")

API Usage:

from nautobot.dcim.api.serializers import DeviceSerializer
from nautobot.dcim.models import Device

device = Device.objects.first()
serializer = DeviceSerializer(device)
data = serializer.data

Custom Fields:

from nautobot.extras.models import CustomField
custom_field = CustomField.objects.create(
    type="text",
    name="asset_tag",
    label="Asset Tag"
)

Job Creation:

from nautobot.extras.jobs import Job

class MyCustomJob(Job):
    class Meta:
        name = "My Custom Job"
        description = "Custom automation job"
    
    def run(self):
        # Job logic here
        pass