09-04-2016 05:05 AM - edited 03-01-2019 04:31 AM
I am using uniq to pull information from APIC-EM, But I noticed that when I pull information regarding devices interfaces, I don't see interface description. Using regular query works.
09-05-2016 06:06 PM
Will pass this to uniq developer. In the mean while is it possible to share your code snippet ?
09-06-2016 12:59 PM
Hi,
Here is my 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'])" I want "print(interface['description'])" but as I mentioned it doesn't work.
09-06-2016 01:29 PM
this is a bug. I see the same thing.
let me get this fixed.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide