scripts/netbox-dump: also add interface type and ip addresses

This commit is contained in:
Franzi 2023-03-26 15:21:16 +02:00
parent a738b49aa4
commit 66c6a92ec5
Signed by: kunsi
GPG Key ID: 12E3D2136B818350
1 changed files with 6 additions and 0 deletions

View File

@ -25,6 +25,10 @@ QUERY = """{
enabled
description
mode
type
ip_addresses {
address
}
untagged_vlan {
name
}
@ -130,6 +134,8 @@ for device in data["device_list"]:
"description": description,
"enabled": interface["enabled"],
"mode": interface["mode"],
"type": interface["type"],
"ips": sorted({i['address'] for i in interface['ip_addresses']}),
"untagged_vlan": interface["untagged_vlan"]["name"]
if interface["untagged_vlan"]
else None,