Netbox Negistry Importer
Tool to pull data from Negistry (ripe IP ranges) and synchronize it with a Netbox (SOT) as a prefixes.
Install
- Clone repository
git@gitlab.cesnet.cz:701/done/netbox_negistry_importer.git
- Go into the repository
cd netbox_network_importer
- Create
virtualenvpython3 -m venv venv
- Activate it
source venv/bin/activate
- Install the tool
pip install .
- Setup configuration file
cp config/.secrets.yaml.sample config/.secrets.yamlcp config/settings.yaml.sample config/settings.yaml
Alternatives
pip install git+ssh://git@gitlab.cesnet.cz/701/done/netbox_negistry_importer.git- installs the package
- Setup configuration files! (see below)
Pre-requisite
To operate, the Netbox Negistry Importer is dependent on the following items:
- Access to Netbox API
- Access to Negistry API
- Created Custom Field on Netbox
"results": [
{
"display": "Client ID",
"content_types": [
"ipam.prefix",
],
"type": {
"value": "text",
"label": "Text"
},
"object_type": null,
"data_type": "string",
"name": "client_id",
"label": "Client ID",
"description": "",
"required": false,
"filter_logic": {
"value": "loose",
"label": "Loose"
},
"default": null,
"weight": 100,
"validation_minimum": null,
"validation_maximum": null,
"validation_regex": "",
"choices": [],
},
{
"display": "Negistry primary key",
"content_types": [
"ipam.prefix"
],
"type": {
"value": "text",
"label": "Text"
},
"object_type": null,
"data_type": "string",
"name": "negistry_primary_key",
"label": "Negistry primary key",
"description": "IP range from Negistry",
"required": false,
"filter_logic": {
"value": "loose",
"label": "Loose"
},
"default": null,
"weight": 100,
"validation_minimum": null,
"validation_maximum": null,
"validation_regex": "",
"choices": [],
},
{
"display": "Netname",
"content_types": [
"ipam.prefix",
],
"type": {
"value": "text",
"label": "Text"
},
"object_type": null,
"data_type": "string",
"name": "netname",
"label": "Netname",
"description": "",
"required": false,
"filter_logic": {
"value": "loose",
"label": "Loose"
},
"default": null,
"weight": 100,
"validation_minimum": null,
"validation_maximum": null,
"validation_regex": "",
"choices": [],
}
]
- Created "negistry" tag on Netbox
{
"display": "negistry",
"name": "negistry",
"slug": "negistry",
"description": "Negistry Prefix",
}
Configuration file
The configuration properties must be provided via the configuration files.
Netbox Negistry Importer try to find the configuration file in folders:
<PROJECT_ROOT>/config//etc/netbox_negistry_importer//home/<user>/.config/netbox_negistry_importer/- Or you can set path to configuratin files like:
SETTINGS_FILE_FOR_DYNACONF=/some/custom/path/settings.yaml SECRETS_FOR_DYNACONF=/some/another/path/.secrets.yaml import_negistry
# settings.yaml
---
LOGLEVEL: DEBUG
NEGISTRY_URL: <negistry_url>
NETBOX_INSTANCE_URL: <netbox_url>
# .secrets.yaml
---
NETBOX_API_TOKEN: <TOKEN>
Execute
The Netbox Negistry Importer runs only in apply mode.
Apply Mode
Execution:
import_negistry# runs the importer
Metadata
Release files for netbox-negistry-importer 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| netbox_negistry_importer-0.2.0.tar.gz | 7.2 kB | Details |
Release files / netbox_negistry_importer-0.2.0.tar.gz
| Download URL | netbox_negistry_importer-0.2.0.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b0bc49c8438443d9e984a8b1bca4c4affb34e570e73b827323ef8cb9eda289e9
|
|
BLAKE2b-256 checksum How to use checksums |
3c941185007afdd685fb5dbdcc03c261ca9f79b60be7afc431bac94bf3295ce0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
|