18 lines
379 B
Python
18 lines
379 B
Python
import pynetbox
|
|
|
|
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})") |