A Netbox plugin for importing device and module types from the device type library.
Project description
NetBox Device Type Importer Plugin
Netbox plugin for easy import DeviceType/ModuleType from NetBox Device Type Library.
[!WARNING]
Importing Device/Module Type definitions uses Async IO and can take some time (10 to 20 mins) to complete.
The plugin uses GitHub GraphQL API to load DeviceType or ModuleType from NetBox Device Type Library.
The plugin loads only file tree representation from a Github repo and shows it as a table with vendor and model columns.
DeviceType definitions files are loaded when you try to import selected models.
So, if you have a lot of models in the repo, it can take a lot of time to load them all.
Please be patient and don't refresh the page while the plugin is loading data from Github.
Description
The plugin uses GitHub GraphQL API to load DeviceType or ModuleType from NetBox Device Type Library. The plugin loads only file tree representation from a Github repo and shows it as a table with vendor and model columns. DeviceType definitions files are loaded when you try to import selected models.
To use GraphQL API you need to set GitHub personal access token in plugin settings. You don't need to grant any permissions to the token.
How to create the token, see "Creating a personal access token."
Compatibility
| NetBox Version | NetBox Device Type Importer Version |
|---|---|
| NetBox 4.5 | >= 0.0.1 |
Installation
The plugin is available as a Python package in pypi and can be installed with pip
pip install netbox-device-module-type-importer
Enable the plugin in /opt/netbox/netbox/netbox/configuration.py:
PLUGINS = ['netbox_device_module_type_importer',]
Restart NetBox and add netbox-device-module-type-importer to your local_requirements.txt
Perform database migrations:
cd /opt/netbox
source venv/bin/activate
python ./netbox/manage.py migrate netbox_device_module_type_importer
Full documentation on using plugins with NetBox: Using Plugins - NetBox Documentation
Configuration
Put your GitHub personal access token to NetBox plugins config
Minimum configuration
PLUGINS_CONFIG = {
'netbox_device_module_type_importer': {
"github_token": "<YOUR-GITHUB-TOKEN>"
}
}
Additional configuration
You can configure the plugin to use different GitHub GraphQL API endpoint, batch size, and concurrency settings.
PLUGINS_CONFIG = {
'netbox_device_module_type_importer': {
"repo_owner": "netbox-community",
"repo": "devicetype-library",
"github_url": "https://api.github.com/graphql",
"batch_size": 50,
"max_concurrent_requests": 20,
"max_concurrent_vendors": 20,
}
}
Benchmarking using AsyncIO versus SyncIO
Note that based on benchmark tests, all connectivity to GitHub is done synchronously. The plugin uses AsyncIO to load DeviceType definitions from GitHub in parallel, which significantly reduces the time it takes to load all models from the repo.
| Configuration | Time (s) | Files/s | Speedup |
|---|---|---|---|
| Synchronous | 360.65s | 14.7 | 1.00× |
| Async (req=10, vendors=5) | 88.56s | 59.9 | 4.07× |
| Async (req=15, vendors=10) | 57.71s | 91.9 | 6.25× |
| Async (req=20, vendors=20) | 31.39s | 169.0 | 11.49× |
Contribute
Contributions are always welcome! Please see the Contribution Guidelines
Screenshots
Future
- Import device images from GitHub repo
- Add support for Gitlab repositories
Credits
- Thanks to Nikolay Yuzefovich for providing the original version of DeviceType Importer.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file netbox_device_module_type_importer-0.0.3.tar.gz.
File metadata
- Download URL: netbox_device_module_type_importer-0.0.3.tar.gz
- Upload date:
- Size: 22.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ab5eb19ed4945d7a3f1eedae4fc5601903f16bfb5e291fb16ef39466ab18d13
|
|
| MD5 |
58d388a359318fa81b5754e74695ca76
|
|
| BLAKE2b-256 |
7813cdb7d169965fe4cab5f3963cc10f03863c8b528fd4abe0c8cf244ab47e87
|
Provenance
The following attestation bundles were made for netbox_device_module_type_importer-0.0.3.tar.gz:
Publisher:
publish.yml on andy-shady-org/netbox-device-module-type-importer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
netbox_device_module_type_importer-0.0.3.tar.gz -
Subject digest:
7ab5eb19ed4945d7a3f1eedae4fc5601903f16bfb5e291fb16ef39466ab18d13 - Sigstore transparency entry: 1446893450
- Sigstore integration time:
-
Permalink:
andy-shady-org/netbox-device-module-type-importer@ea1ce359c58dc0b1cef14ec8246c55f37900c16b -
Branch / Tag:
refs/tags/v0.0.3 - Owner: https://github.com/andy-shady-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ea1ce359c58dc0b1cef14ec8246c55f37900c16b -
Trigger Event:
release
-
Statement type:
File details
Details for the file netbox_device_module_type_importer-0.0.3-py3-none-any.whl.
File metadata
- Download URL: netbox_device_module_type_importer-0.0.3-py3-none-any.whl
- Upload date:
- Size: 34.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05388dfa8a02a91d58e4abf878854ea263c9ff8d76a7e3dc7b6f434ddc70b613
|
|
| MD5 |
290a44664f8174efae00c9683a74871f
|
|
| BLAKE2b-256 |
b7a253c4f5c8c6f7088a6238bc6856b08050001c3caccab9d566f44f8234e5a5
|
Provenance
The following attestation bundles were made for netbox_device_module_type_importer-0.0.3-py3-none-any.whl:
Publisher:
publish.yml on andy-shady-org/netbox-device-module-type-importer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
netbox_device_module_type_importer-0.0.3-py3-none-any.whl -
Subject digest:
05388dfa8a02a91d58e4abf878854ea263c9ff8d76a7e3dc7b6f434ddc70b613 - Sigstore transparency entry: 1446893707
- Sigstore integration time:
-
Permalink:
andy-shady-org/netbox-device-module-type-importer@ea1ce359c58dc0b1cef14ec8246c55f37900c16b -
Branch / Tag:
refs/tags/v0.0.3 - Owner: https://github.com/andy-shady-org
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ea1ce359c58dc0b1cef14ec8246c55f37900c16b -
Trigger Event:
release
-
Statement type: