cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
636
Views
11
Helpful
3
Replies

Unable to get interface description with uniq

arikgelman
Level 4
Level 4

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.

3 Replies 3

yawming
Cisco Employee
Cisco Employee

Will pass this to uniq developer. In the mean while is it possible to share your code snippet ?

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.

this is a bug.  I see the same thing.

let me get this fixed.