Using uniq to pull information from APIC-EM, But noticed that when pulling information regarding devices interfaces, don't see interface description. Using regular query works.
Here is the code in python 3:
from uniq.apis.nb.client_manager import NbClientManager
client = NbClientManager(
server="sandboxapic.cisco.com",
username="devnetuser",
password="Cisco123!",
connect=True)
allHosts = client.networkdevice.getAllNetworkDevice()
allHosts = client.serialize(allHosts)
for host in allHosts['response']:
print(host['id'])
try:
allInterfaces = client.interface.getInterfaceByDeviceId(deviceId = host['id'])
allInterfaces = client.serialize(allInterfaces)
for interface in allInterfaces['response']:
print(interface['portName'])
except:
print("No information from device id: " + host['id'])
Insted of "print(interface['portName'])" want "print(interface['description'])" but it doesn't work.
This is a bug.
Comments
0 comments
Please sign in to leave a comment.