IP Fabric adapter
V3 route
Prepare a configuration package and register it. Then create and review a plan before applying the reviewed plan or running a confirmed sync; Run a sync has the canonical procedure.
What is IP Fabric?
The IP Fabric network infrastructure management platform provides on-demand network discovery, advanced analytics, and in-depth engineering visibility.
Its lightweight discovery capabilities (via SSH or Telnet) quickly detect the current network state, including detailed data for each address and port.
A network model of gathered data reconstructs the topologies for each switching and routing protocol, enabling cross-technology analysis of upstream and downstream relationships.
Dependencies and dependents are calculated for each network element, allowing analysis to represent each aspect of the network in the context of productivity impact on downstream hosts and network devices. The immediate productivity impact of performance and capacity is also calculated for each user and every element.
Requirements
This Adapter uses the IP Fabric SDK, distributed as ipfabric on PyPI.
ipfabric is declared in its own ipfabric package extra, not in the service extra the default
Sync image installs. Every current ipfabric release depends unconditionally on niquests, whose
urllib3-future dependency ships a .pth hook that replaces the real urllib3 package in
site-packages at interpreter start — for every process in the image, not just this adapter. That
would silently move every other requests-based adapter (pynetbox, pynautobot, slurpit-sdk, the
generic REST adapter) onto urllib3-future too, so it is not installed by default.
To use this adapter, build a custom Sync image that also installs the ipfabric extra, for example
by changing the image's uv sync step to --extra service --extra ipfabric. Confirm before doing so
that urllib3-future replacing urllib3 for the whole image is acceptable for your deployment.
Sync directions supported
- IP Fabric → Infrahub
Currently, the IP Fabric adapter supports only one-way synchronization from IP Fabric to Infrahub. Syncing data back into IP Fabric is not yet supported.
Although IP Fabric data cannot be edited, additional information such as Device Attributes and Site Separation rules can be updated from Infrahub data.
Schema
Our infrahub repository contains an example schema that serves as a starting point for syncing IP Fabric data into Infrahub.
This schema follows best practices for Infrahub, but it does not map the IP Fabric data model one-to-one since Infrahub may have additional use cases.
Installing the example schema
To install the example schema into Infrahub, follow these steps:
mkdir ipfabric-sync
cd ipfabric-sync
curl -o schema.yml https://raw.githubusercontent.com/opsmill/infrahub/refs/heads/stable/models/examples/ipfabric/ipfabric.yml
infrahubctl schema load schema.yml
Configuration
infrahub-sync allows defining what gets synchronized from a source to a destination. The shipped config.yml is a legacy mapping input that matches the example schema; wrap it in a V3 configuration-package envelope before registration.
To download the example config.yml
curl https://raw.githubusercontent.com/opsmill/infrahub-sync/refs/heads/main/examples/ipfabric_to_infrahub/config.yml > config.yml
Configuration parameters
The source.name is set to ipfabricsync, instructing infrahub-sync to use the IP Fabric adapter.
The settings dictionary is passed directly to the IP Fabric Python SDK for authentication and connection details. Some of these parameters can be found in the IP Fabric SDK Docs.
Below is a snippet from the example config.yml file:
---
name: from-ipfabric
source:
name: ipfabricsync
settings:
base_url: "https://<IPFABRIC-ENDPOINT>"
auth: "<TOKEN>"
verify_ssl: true # Default value
Schema mapping
The configuration file allows mapping tables from IP Fabric into Infrahub models. Below is an example showing how to:
- Set the destination Infrahub model (
InfraDevice) - Map source data from IP Fabric’s Path (
tables/inventory/devices) - Specify field mappings between IP Fabric and Infrahub models
schema_mapping:
- name: InfraDevice
identifiers: ["hostname"]
mapping: tables/inventory/devices
fields:
- name: hostname
mapping: hostname
- name: serial_number
mapping: sn
- name: hardware_serial_number
mapping: snHw
- name: fqdn
mapping: fqdn
- name: model
mapping: model
reference: TemplateDeviceType
- name: location
mapping: siteName
reference: LocationGeneric
- name: platform
mapping: platform
reference: InfraPlatform
- name: version
mapping: version
reference: InfraNOSVersion
The table URI can be found by selecting Table Description in any IP Fabric table and copying everything after the version in the URL description.
For more details regarding, refer to the IP Fabric API Docs.