cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
277
Views
11
Helpful
3
Replies
Highlighted
Enthusiast

Unable to get interface description with uniq

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
Highlighted
Cisco Employee

Re: Unable to get interface description with uniq

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

Highlighted
Enthusiast

Re: Unable to get interface description with uniq

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.

Highlighted
Cisco Employee

Re: Unable to get interface description with uniq

this is a bug.  I see the same thing.

let me get this fixed.