Project Structure
Project Structure¶
This document provides an overview of the NetBox LibreNMS Plugin's codebase organization.
Main Directories¶
netbox_librenms_plugin/— Main plugin codeviews/— User-facing pages and actionsbase/— Shared sync-page logic for interfaces, cables, IP addresses, VLANs, and modulesobject_sync/— Device and Virtual Machine views registered as NetBox object tabssync/— Actions that apply interface, cable, IP address, VLAN, module, device-field, location, and migration changesimports/— Device import list and action endpointsmapping_views.py— Generic views for Mappings and Rules & Patternsmixins.py— Shared permissions, LibreNMS API access, caching, and server selectionsettings_views.py— Plugin settings and connection testingstatus_check.py— Device and Virtual Machine status pages
api/— REST API serializers, views, and URLsimport_utils/— Import pipeline logic, split into focused modulesdevice_operations.py— Device validation and creationvm_operations.py— VM creation and import logicbulk_import.py— Multi-device import orchestrationfilters.py— LibreNMS device filtering and retrievalpermissions.py— Permission helpers for background jobscache.py— Import cache helperscollisions.py— Duplicate and identity-collision handlingvirtual_chassis.py— Virtual Chassis import helpers
import_validation_helpers.py— Validation state mutation during import (role/cluster/rack assignment, issue removal, status recalculation)librenms_api.py— LibreNMS API client, server selection, and device lookupinterface_sync.py— Shared interface creation and update logicinterface_relationships.py— Parent, child, and LAG relationship resolutionip_addressing.py— Shared IP address handlingsync_cache.pyandcache_signals.py— Sync-tab cache coordination and invalidationjobs.py— Background import jobssignals.py— Public extension signalsmodels.py,forms.py,filters.py, andfiltersets.py— Data models and user input/query definitionstables/— NetBox table definitions for sync, status, mapping, and rule pagestemplates/netbox_librenms_plugin/— Page templatesinc/— Shared template fragmentshtmx/— HTMX response fragments_<resource>_sync.htmland_<resource>_sync_content.html— Sync-tab wrappers and refreshable content
static/netbox_librenms_plugin/— Plugin JavaScript and CSStests/— Primary Django and plugin test suitemigrations/— Django migrationsnavigation.py,urls.py, andconstants.py— Plugin registration, routing, and shared constantsutils.py— Shared matching, normalization, and data-conversion helpersdocs/— User and developer documentation plus screenshotscontrib/— Example mapping, normalization, and rule files for bulk importtests/e2e/— End-to-end tests outside the primary Django test suitetools/— Repository-specific lint and maintenance utilities.devcontainer/— Local NetBox development environment and helper scripts