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

View file

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