feat(netbox): Add NetBox API client for fabric intent retrieval

Implements FabricNetBoxClient using pynetbox to fetch:
- Device and interface data
- BGP sessions and peer groups (plugin)
- L2VPN/EVPN VNI mappings
- VRF and route target configuration
- MLAG custom fields

Relates to #5
This commit is contained in:
darnodo
2026-01-08 12:57:50 +01:00
parent 555f8436f1
commit 4799c4cbf2
3 changed files with 792 additions and 0 deletions

36
src/netbox/__init__.py Normal file
View File

@@ -0,0 +1,36 @@
"""
NetBox Client Module for Fabric Orchestrator.
This module provides a NetBox API client for fetching fabric intent data
using pynetbox.
Usage:
from src.netbox import FabricNetBoxClient
client = FabricNetBoxClient(
url="http://netbox.local",
token="your-token"
)
# Get all leaf devices
leaves = client.get_leaf_devices()
# Get complete intent for a device
intent = client.get_device_intent("leaf1")
"""
from .client import (
FabricNetBoxClient,
NetBoxAPIError,
NetBoxConnectionError,
NetBoxError,
NetBoxNotFoundError,
)
__all__ = [
"FabricNetBoxClient",
"NetBoxError",
"NetBoxConnectionError",
"NetBoxNotFoundError",
"NetBoxAPIError",
]