21 lines
423 B
Python
21 lines
423 B
Python
import pynetbox
|
|
|
|
from oxi.manager import OxidizedAPI
|
|
from settings import settings
|
|
|
|
|
|
netbox = pynetbox.api(
|
|
settings.nb_url,
|
|
token=settings.nb_token)
|
|
netbox.http_session.verify = False
|
|
|
|
filters = {
|
|
"has_primary_ip": "true",
|
|
"tenant": "vimpelcom",
|
|
"role": "Kommutator",
|
|
}
|
|
|
|
|
|
# devices = netbox.dcim.devices.filter(**filters)
|
|
# for device in devices:
|
|
# print(f"{device.name} (IP: {device.primary_ip})") |