cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
736
Views
0
Helpful
2
Replies

get-network-device-list.py tabulate issue with switch stack

edward ventura
Beginner
Beginner

Hello,

 

I'm new to the world of coding but have an extensive background with Cisco.  I've recently installed APIC-EM to see what it can do.  I found the 'get-network-device-list.py' in the learning labs to be very practical.  I tweaked the device_list within the python script to get '[item["hostname"],item["managementIpAddress"],item["serialNumber"],item["platformId"],item["softwareVersion"]' as these are values I'd like to see.  Using tabulate makes this information easily transportable to an excel doc. I was really excited about this until I added a switch stack.  No more nice columns.  Each switch in the stack provides a "serialNumber" along with "platformId" for that one respective device item.  This throws off the nice column flow.

 

I'm posting here to see if anyone has run into this yet and/or can offer some advice to get me going in the correct direction.

 

Thanks in advance for any assistance!

2 REPLIES 2

yawming
Cisco Employee
Cisco Employee

Your code is fine, just resize you terminal window to make it wider

Joe Clarke
Hall of Fame Cisco Employee Hall of Fame Cisco Employee
Hall of Fame Cisco Employee

Hmmm, I don't have a stack with which to test.  Can you post the output of the APIC-EM JSON (maybe from Swagger under the "API" link at the top of the APIC-EM pages) for such a network-device?  I think maybe you're saying the platformId is a list rather than one value?  The resulting output of your script showing the stack output would also be helpful.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: